Customers

Manage your customers

Create a customer

createCustomer.gql
mutation {
    createCustomer(
        email: "test@example.com",
        firstName: "John",
        lastName: "Doe"
    ) {
        id
        email
        firstName
        lastName
    }
}

Get all customers

query {
    account {
        merchantCustomers {
            nodes {
                id
                email
                firstName
                lastName
            }
            pageInfo {
                startCursor
                endCursor
                hasNextPage
                hasPreviousPage
            }
        }
    }
}

merchantCustomers is a paginated field. To fetch more data, you can pass in an endCursor as an after argument to it.

query {
    account {
        merchantCustomer(after: "Mg") {
            ...
        }
    }
}

Get a customer

customer.gql
query {
    node(id: "TWVyY2hhbnRDdXN0b21lci05ODFmYzVjMy1jNjYwLTQyMzAtYTgzNi0xM2EyOWZlMjRiOWY=") {
        ... on MerchantCustomer {
            id
            email
            firstName
            lastName
            p2pPaymentMethods {
                id
                value
            }
        }
    }
}

Last updated