Skip to main content

createCustomerCollection

Requires permission payments:collection:create.

Records money received from a customer, optionally allocating it to invoices. The collection date must be valid, and an idempotency key makes a retry safe. Requires permission to create collections.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateCustomerCollection($input: CreateCustomerCollectionInput!) {
createCustomerCollection(input: $input) {
id
checkNumber
currencyCode
paymentNumber
referenceNumber
status
allocations {
id
invoiceNumber
paymentNumber
createdAt
amount
appliedFromAdvance
}
}
}

Variables:

{
"input": {
"amount": 0,
"collectionDate": "2025-01-15T00:00:00Z",
"collectionMethod": "BANK_TRANSFER",
"currency": "string",
"customerId": "id"
}
}

Response:

{
"data": {
"createCustomerCollection": {
"id": "id",
"checkNumber": "string",
"currencyCode": "string",
"paymentNumber": "string",
"referenceNumber": "string",
"status": "APPROVED",
"allocations": [
{
"id": "id",
"invoiceNumber": "string",
"paymentNumber": "string",
"createdAt": "2025-01-15T00:00:00Z",
"amount": 0,
"appliedFromAdvance": true
}
]
}
}
}

Collect a payment from a customer:

mutation CreateCustomerCollection($input: CreateCustomerCollectionInput!) {
createCustomerCollection(input: $input) {
id
paymentNumber
status
amount
}
}

Variables:

{
"input": {
"customerId": "CUSTOMER_ID",
"amount": 200,
"currency": "CURRENCY_CODE",
"collectionDate": "2025-01-15T00:00:00Z",
"collectionMethod": "BANK_TRANSFER"
}
}

Response:

{
"data": {
"createCustomerCollection": {
"id": "PAYMENT_ID",
"paymentNumber": "PAYMENT_NUMBER",
"status": "PENDING",
"amount": 200
}
}
}
createCustomerCollection(
input: CreateCustomerCollectionInput!
): Payment!

Arguments​

createCustomerCollection.input ● CreateCustomerCollectionInput! non-null input​

The customer, date, method, currency and amount, with optional exchange rate, bank account, reference, notes, allocations and idempotency key.

Type​

Payment object​

A payment made out to a vendor or a collection received from a customer, with its allocations to invoices.