Customers

The Customers endpoints allow you to retrieve, create, update, and delete information about Customers in a database.


List all Customers

This query allows you to retrieve a paginated list of all your Customers. By default, a maximum of 25 Customers are shown per page.

Arguments

  • Name
    query
    Type
    String!
    Description

    Supported filter parameters: order_by order_dir

  • Name
    after
    Type
    String
    Description

    Returns the elements that come after the specified cursor.

  • Name
    first
    Type
    String
    Description

    Returns up to the first n elements from the list.

Fields

  • Label
    Customer!
    Description

    The Customer! query type.

Request

POST
https://api.lightfunnels.com/graphql
query CustomersQuery($first: Int, $after: String, $query: String!){
	customers(query: "order_by:id order_dir:desc", after: "WzVE4OTA5LDEe/4OTA5XQ==", first: 10){
		edges{
			node{
				id
				_id
				avatar
				full_name
				expenses
				orders_count
				updated_at
				created_at
			}
			cursor
		}
		pageInfo{
			endCursor
			hasNextPage
		}
	}
}

Response

{
		"data": {
			"edges": [{
				"node": {
					"id": "Q3VzdG9tZXI6MTkxMzUw",
					"_id": 191350,
					"avatar": "//www.gravatar.com/avatar/...",
					"full_name": "Yassir Ennazk",
					"expenses": 0,
					"orders_count": 1,
					"updated_at": "an hour ago",
					"created_at": "an hour ago",
					"__typename": "Customer"
				},
				"cursor": "WzE5MTM1MCwxOTEzNTBd"
			}],
			"pageInfo": {
				"endCursor": "WzE0Njk5MSwxNDY5OTFd",
				"hasNextPage": true
			}
		}
	}

Create a Customer

This query allows you to add a new Customer.

Arguments

Fields

  • Label
    Customer!
    Description

    The Customer! query type.

Request

POST
https://api.lightfunnels.com/graphql
mutation mutationName($node: InputCustomer!) {
	createCustomer(node: $node){
		# Customer type fields
	}
}

Response

{
		"data": {
			"createCustomer": {
				"id": "Q3VzdG9tZXI6MTkxMzUw",
				"_id": 191350,
				"avatar": "//www.gravatar.com/avatar/...",
				"full_name": "Yassir Ennazk",
				...
			}
		}
	}

Retrieve a Customer

This query allows you to retrieve a Customer by providing their id.

Arguments

  • Name
    id
    Type
    Int!
    Description

    The Customer id.

Fields

  • Label
    Customer!
    Description

    The Customer! query type.

Request

POST
https://api.lightfunnels.com/graphql
	query CustomerQuery($id: Int!){
		customer(id: $id){
			# Customer type fields
		}
	}

Response

	{
		"data": {
			"node": {
				"id": "Q3VzdG9tZXI6MTkxMzUw",
				"_id": 191350,
				"avatar": "//www.gravatar.com/avatar/...",
				"full_name": "Yassir Ennazk",
				...
			}
		}
	}

Update a Customer

This query allows you to perform an update on a Customer.

Arguments

  • Name
    id
    Type
    Int!
    Description

    The Customer id.

  • Name
    node
    Label
    InputUpdateCustomer!
    Description

    The Customer node.

Fields

  • Label
    Customer!
    Description

    The Customer! query type.

Request

Post
https://api.lightfunnels.com/graphql
mutation updateCustomerMutation($node: InputUpdateCustomer!, $id: Int!){
		updateCustomer(node: $node, id: $id){
			# Customer type fields
		}
	}

Response

{
		"data": {
			"updateCustomer": {
				"id": "Q3VzdG9tZXI6MTkxMzUw",
				"_id": 191350,
				"avatar": "//www.gravatar.com/avatar/...",
				"full_name": "Yassir Ennazk",
				...
			}
		}
	}