Cashramp
  • Introduction
    • Getting Started
    • API Endpoints
    • Authentication
    • Webhooks
    • Integration Guide
    • SDKs
  • Hosted payments
    • Deposits
    • Withdrawals
    • Cancel Payment
  • Onchain Payments
    • On-Off Ramp
  • Cashramp API
    • Queries
    • Customers
    • Payment Methods
    • Withdraw Onchain
Powered by GitBook
On this page
  • Create a customer
  • Get all customers
  • Get a customer
  1. Cashramp API

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
            }
        }
    }
}
PreviousQueriesNextPayment Methods

Last updated 9 months ago