Skip to main content

adjustCustomerCredit

Requires permission customers:customer:update.

Adjust a customer's credit. type is INCREASE_LIMIT, DECREASE_LIMIT, ADJUST_BALANCE or PAYMENT_RECEIVED; any other type is refused. A reason is required and the change is audited. Needs the customers update permission (the same grant that edits the credit limit on the customer form).

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 AdjustCustomerCredit($amount: Float!, $customerId: String!, $reason: String!, $type: String!) {
adjustCustomerCredit(
amount: $amount
customerId: $customerId
reason: $reason
type: $type
) {
id
code
registrationNumber
name
customerTierName
displayName
addresses {
id
postalCode
contactName
type
createdAt
addressLine1
}
}
}

Variables:

{
"amount": 0,
"customerId": "string",
"reason": "string",
"type": "string"
}

Response:

{
"data": {
"adjustCustomerCredit": {
"id": "id",
"code": "string",
"registrationNumber": "string",
"name": "string",
"customerTierName": "string",
"displayName": "string",
"addresses": [
{
"id": "id",
"postalCode": "string",
"contactName": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"addressLine1": "string"
}
]
}
}
}
adjustCustomerCredit(
amount: Float!
customerId: String!
notes: String
reason: String!
reference: String
type: String!
): Customer!

Arguments​

adjustCustomerCredit.amount ● Float! non-null scalar​

The amount of the adjustment.

adjustCustomerCredit.customerId ● String! non-null scalar​

The ID of the customer.

adjustCustomerCredit.notes ● String scalar​

Optional notes about the adjustment.

adjustCustomerCredit.reason ● String! non-null scalar​

Why the credit is being adjusted. Required.

adjustCustomerCredit.reference ● String scalar​

Optional reference for the adjustment.

adjustCustomerCredit.type ● String! non-null scalar​

INCREASE_LIMIT, DECREASE_LIMIT, ADJUST_BALANCE or PAYMENT_RECEIVED.

Type​

Customer object​

A customer: a partner with the customer role.