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:
- GraphQL
- cURL
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
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation AdjustCustomerCredit($amount: Float!, $customerId: String!, $reason: String!, $type: String!) {\n adjustCustomerCredit(\n amount: $amount\n customerId: $customerId\n reason: $reason\n type: $type\n ) {\n id\n code\n registrationNumber\n name\n customerTierName\n displayName\n addresses {\n id\n postalCode\n contactName\n type\n createdAt\n addressLine1\n }\n }\n}",
"variables": {
"amount": 0,
"customerId": "string",
"reason": "string",
"type": "string"
}
}
EOF
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.