On this page
arWriteoff
mutation · in the family Refunds and payment corrections
What it does
Write off part of a customer’s house-account balance — money you are giving up on.
WRITE OFF bad debt: ONE writeoff AREntry (REQUIRED reason) + the same conditioned decrement/frontier machinery; ≤ the balance else CONFLICT/INSUFFICIENT_AR_BALANCE. Descriptor-gated to the management templates (the voidInvoice class — v17). Requires the unrestricted capability.
What happens
Posts a write-off entry with a required reason.
Careful
This is real money surrendered, permanently recorded.
Who may call it
Capability area: Refunds and payment corrections — Refunds, corrective notes and voiding invoices.
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:arWriteoff
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | ArWriteoffInput ArWriteoffInput! | yes | No further notes. |
Returns
OrgCustomer OrgCustomer! — An OrgCustomer — the per-org selling ENABLEMENT of a group CorporateCustomer, the sell-side mirror of the OrgVendor: an ACTIVE OrgCustomer IS the B2B selling enablement (no B2B terms without one). Parent = the ORGANIZATION (not the family root); the selection IS the (org × corporateCustomer) edge — ≤1 live per pair via the UNIQ pair marker minted IN the create transaction. Terms payload: accountNumber · canned paymentTerms (the registry SHARED with the OrgVendor; NO free-text twin — a born construct starts canned-only) · creditLimit/orderMinimum house Money on the sell-side currency rule (NO local currency field — every money field matches the org's defaultCurrency at set, create AND edit; the OrgVendor's local purchasingCurrency is deliberately NOT mirrored; ENFORCEMENT is credit / minimums) · the customerPriceGroupId carrier (in-tenant + ACTIVE at set — the member-carrier class; the order-time B2B precedence law is; the CPG doom RI gains this SECOND carrier class) · billToContactId/shipToContactId (non-doomed + a LIVE ContactAssignment on THIS customer's host — sell-side counterparty addresses need host-membership integrity, the disclosed OrgVendor divergence). Deactivate FREE (selling paused); doom structurally unblocked EXCEPT live holder ExemptionCertificates. The priceListId carrier is LIVE. MOQ/case enforcement is.
Example request
mutation ExampleArWriteoff($input: ArWriteoffInput!) {
arWriteoff(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
corporateCustomerId
accountNumber
paymentTerms
customerPriceGroupId
priceListId
billToContactId
shipToContactId
code
arBalanceMinor
arCurrency
}
}
Variables:
{
"input": {
"orgCustomerId": "01900000-0000-7000-8000-ba56ff800000",
"amountMinor": 1,
"reason": "Correcting a miscount."
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"arWriteoff": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "EC-EXMP-0000-000F",
"type": "OrgCustomer",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"corporateCustomerId": "01900000-0000-7000-8000-e09097190000",
"accountNumber": "<account number>",
"paymentTerms": "<payment terms>",
"customerPriceGroupId": "01900000-0000-7000-8000-dfbf5aa40000",
"priceListId": "01900000-0000-7000-8000-7844e9fb0000",
"billToContactId": "01900000-0000-7000-8000-cd1d9f9e0000",
"shipToContactId": "01900000-0000-7000-8000-abe45fdf0000",
"code": "BJ-001",
"arBalanceMinor": 1,
"arCurrency": "<ar currency>"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. (VALIDATION)