Create and submit an AR adjustment

Creates an adjustment, its lines and its billing schedules and submits them, all in one call and one transaction. If any part of it fails, nothing at all is saved - not a draft, not a header.

Only five things are required: adjustmentType, creditType, reasonCode, adjustmentDate, and something to adjust.

Two ways to say what to adjust:

  • lines - the caller already knows the invoiced lines and names them, by invoice number and invoice line number, or by order number and order line number.
  • lineSelection - the caller sends the same search criteria the screen searches with, and every line the search returns is adjusted. On the screen a user ticks the rows; through the API there is nobody to tick.

Amounts: send any two of quantity, unitPrice and totalAmount and the third is worked out. The same rule applies to the rebill amount on a Credit and Rebill. fullCredit: "Y" sends none of them and credits what the invoiced line still has left.

Derived values: on an Against Invoice adjustment the customer, the site, the currency and the business unit come from the invoice and are not asked for. On-Account has no invoice behind it, so those four are sent.

Lookup values may be sent either as the meaning a user reads on the screen (Credit Memo) or as the code stored behind it (CM).

Refusals name every problem in one answer and write nothing.

Reading the answer: every response carries statusCode in the body, and that is the status to act on. The service returns it as the HTTP status too, but the gateway in front of these APIs currently answers 200 for refusals and leaves the real code in the body - the same behaviour raised for another endpoint in CS-41997. Read statusCode from the body and you are correct either way.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

An adjustment to create and submit. Send either lines or lineSelection - one of the two is required.

string
length ≤ 240

The caller's own reference for this adjustment. Optional. When it is sent, a second call carrying the same reference is refused as a duplicate rather than creating a second adjustment, and the adjustment can be fetched back by it.

string
required

Credit Memo, Debit Memo or Credit and Rebill. The meaning or the code behind it.

string
required

Against Invoice or On-Account. The meaning or the code behind it.

string
required

Adjustment reason, resolved against the tenant's configured reasons

date
required

Adjustment date. Format: yyyy-MM-dd

lines
array of objects

The lines to adjust, when the caller already knows them. Mutually exclusive with lineSelection.

lines
lineSelection
object

Search criteria instead of lines. The same search the Adjustment screen runs, in any combination; every invoiced line it returns is adjusted, each for the amount given here. Belongs to an Against Invoice adjustment - an On-Account line is typed out instead.

string

Credit method. Defaults to LIFO when omitted, as the screen preselects it.

date

GL date. Must be on or after adjustmentDate.

string
length ≤ 240

Header comments

string

Bill-to customer. Required on an On-Account adjustment whose lines name no order; on Against Invoice it comes from the invoice.

string

Bill-to site. Same rule as billToCustomer.

string

Currency name. Same rule as billToCustomer.

string

Business unit, by name or by id. Same rule as billToCustomer.

customAttributes
array of objects

Header attributes. Names carry the Hdr prefix.

customAttributes
Headers
string
required

JWT access token

Responses

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json