Adjustments

An adjustment is a transaction that applies a credit or debit in order to modify the amount owed by a customer.

List adjustments

get/objects/accounts-receivable/adjustment

Returns a collection with a key, ID, and link for each adjustment. This operation is mostly for use in testing; use query to find objects that meet certain criteria and to specify properties that are returned.

Permissions and other requirements
SubscriptionAccounts Receivable
User ypeBusiness, Employee, Project Manager, and Warehouse users
PermissionsList, View Adjustments
SecurityOAuth2
Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "259",
      • "id": "259",
      • "href": "/objects/accounts-receivable/adjustment/259"
      },
    • {
      • "key": "295",
      • "id": "295",
      • "href": "/objects/accounts-receivable/adjustment/295"
      },
    • {
      • "key": "296",
      • "id": "296",
      • "href": "/objects/accounts-receivable/adjustment/296"
      }
    ],
  • "ia::meta": {
    • "totalCount": 3,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}

Create an adjustment

post/objects/accounts-receivable/adjustment

Creates a new adjustment.

Permissions and other requirements
SubscriptionAccounts Receivable
User ypeBusiness
PermissionsList, View, and Add Adjustments
SecurityOAuth2
Request
Request Body schema: application/json
createdDate
required
string <date>

Date the adjustment was created.

Example: "2021-01-23"
adjustmentNumber
string

Number that can be used to track the AR adjustment.

Example: "ADJ001"
object

Associated contacts for the AR adjustment.

object

Customer contact to invoice for this sale.

key
string

System-assigned key for the contact.

Example: "916"
id
string

Name of the contact.

Example: "Power Aerospace Materials (C1)"
object

Customer contact for shipping.

key
string

System-assigned key for the contact.

Example: "312"
id
string

Name of the ship-to contact.

Example: "Power Aerospace Materials(C1)"
description
string

Description of the AR adjustment.

Example: "Computer Hardware & Software Expenses 03/01/20 - 08/31/21 Subscription charges."
documentNumber
string

Invoice number selected as a reference for the adjustment.

Example: "INV-1602"
object

For multi-currency companies, the base currency for the adjustment.

currency
string

Base currency

Example: "USD"
totalDue
string <decimal-precision-2>

Total amount due.

Example: "251464.01"
paidDate
string <date>

Payment date

Example: "2022-11-01"
object

For multi-currency companies, the transaction currency for the adjustment.

Example: "USD"
currency
required
string

Transaction currency

Example: "INR"
object

Exchange rate details used to calculate the base amount.

date
string <date>

Exchange rate date for this transaction. Can be the current date, the date the transaction was issued, or the date the transaction will be paid.

Example: "2021-01-23"
rate
string

Exchange rate used to calculate the base amount from the transaction amount.

Example: "1.0789"
typeId
string

Exchange rate type used to calculate the base amount from the transaction amount.

Example: "1"
object

The customer who is the target of the AR adjustment.

Example: "1"
id
required
string

ID of the customer.

Example: "Customer_01"
key
string

System-assigned key for the customer.

Example: "16"
name
string

Name of the customer.

Example: "Logic Solutions"
glPostingDate
string <date>

GL posting date.

Example: "2023-03-24"
object

Supporting document for the adjustment.

key
string

System-assigned key for the supporting document.

Example: "1"
id
string

ID for the supporting document.

Example: "Sales01"
Array of objects

Line items of the AR adjustment.

Array
memo
string

Memo to describe the line item.

Example: "50 USD credit"
object

Transaction currency for the line item.

Example: "100"
object

Exchange rate details used to calculate the base amount.

object

Label for the AR account.

object

Header level details for the AR adjustment's line entries.

object
object
Example: "2995"
Responses
201

Created

400

Bad Request

Request samples
application/json
{
  • "customer": {
    • "id": "C-00005"
    },
  • "createdDate": "2023-06-28",
  • "description": "Lyon USD Adj",
  • "baseCurrency": {
    • "paidDate": "2022-11-15",
    • "currency": "USD"
    },
  • "txnCurrency": {
    • "currency": "USD"
    },
  • "lines": [
    • {
      • "txnCurrency": {
        },
      • "glAccount": {
        },
      • "dimensions": {
        }
      }
    ]
}
Response samples
application/json
{
  • "ia::result": {
    • "id": "270",
    • "key": "270",
    • "href": "/objects/accounts-receivable/adjustment/270"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Get an adjustment

get/objects/accounts-receivable/adjustment/{key}

Returns detailed information for a specified adjustment.

Permissions and other requirements
SubscriptionAccounts Receivable
User ypeBusiness, Employee, Project Manager, and Warehouse users
PermissionsList, View Adjustments
SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned unique key for the adjustment.

Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": {
    • "id": "7",
    • "key": "7",
    • "txnType": "ra",
    • "adjustmentNumber": null,
    • "state": "posted",
    • "customer": {
      • "id": "C-00003",
      • "key": "14",
      • "name": "Lyon Worldwide",
      • "totalDue": "1344041.29",
      • "href": "/objects/accounts-receivable/customer/14"
      },
    • "documentNumber": "SI-00183",
    • "description": null,
    • "createdDate": "2023-12-18",
    • "audit": {
      • "createdDateTime": "2023-12-18T00:00:00Z",
      • "modifiedDateTime": "2023-02-08T11:16:19Z",
      • "createdBy": null,
      • "modifiedBy": null
      },
    • "glPostingDate": "2023-12-18",
    • "attachment": {
      • "id": null,
      • "key": null
      },
    • "baseCurrency": {
      • "paidDate": null,
      • "currency": "USD",
      • "totalSelected": "0",
      • "totalPaid": "0",
      • "totalAmountEntered": "295.00",
      • "totalDue": "295.00"
      },
    • "txnCurrency": {
      • "currency": "USD",
      • "totalEntered": "295.00",
      • "totalSelected": "0",
      • "totalPaid": "0",
      • "totalDue": "295.00"
      },
    • "exchangeRate": {
      • "date": null,
      • "typeId": null,
      • "rate": null
      },
    • "contacts": {
      • "billTo": {
        },
      • "shipTo": {
        },
      • "moduleKey": "4.AR",
      • "lines": [
        ],
      • "memo": null,
      • "exchangeRate": {
        },
      • "lineNumber": "1",
      • "adjustmentType": null,
      • "isTax": false,
      • "audit": {
        },
      • "href": "/objects/accounts-receivable/adjustment-line/115"
      },
    • "href": "/objects/accounts-receivable/adjustment/7"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Update an adjustment

patch/objects/accounts-receivable/adjustment/{key}

Updates an existing adjustment by setting field values. Any fields not provided remain unchanged.

Permissions and other requirements
SubscriptionAccounts Receivable
User ypeBusiness
PermissionsList, View, Edit Adjustments
SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned unique key for the adjustment.

Request Body schema: application/json
adjustmentNumber
string

Number that can be used to track the AR adjustment.

Example: "ADJ001"
object

Associated contacts for the AR adjustment.

object

Customer contact to invoice for this sale.

key
string

System-assigned key for the contact.

Example: "916"
id
string

Name of the contact.

Example: "Power Aerospace Materials (C1)"
object

Customer contact for shipping.

key
string

System-assigned key for the contact.

Example: "312"
id
string

Name of the ship-to contact.

Example: "Power Aerospace Materials(C1)"
description
string

Description of the AR adjustment.

Example: "Computer Hardware & Software Expenses 03/01/20 - 08/31/21 Subscription charges."
documentNumber
string

Invoice number selected as a reference for the adjustment.

Example: "INV-1602"
object

For multi-currency companies, the base currency for the adjustment.

currency
string

Base currency

Example: "USD"
totalDue
string <decimal-precision-2>

Total amount due.

Example: "251464.01"
paidDate
string <date>

Payment date

Example: "2022-11-01"
object

For multi-currency companies, the transaction currency for the adjustment.

currency
string

Transaction currency

Example: "INR"
object

Exchange rate details used to calculate the base amount.

date
string <date>

Exchange rate date for this transaction. Can be the current date, the date the transaction was issued, or the date the transaction will be paid.

Example: "2021-01-23"
rate
string

Exchange rate used to calculate the base amount from the transaction amount.

Example: "1.0789"
typeId
string

Exchange rate type used to calculate the base amount from the transaction amount.

Example: "1"
object

The customer who is the target of the AR adjustment.

key
string

System-assigned key for the customer.

Example: "16"
id
string

ID of the customer.

Example: "Customer_01"
name
string

Name of the customer.

Example: "Logic Solutions"
createdDate
string <date>

Date the adjustment was created.

Example: "2021-01-23"
glPostingDate
string <date>

GL posting date.

Example: "2023-03-24"
object

Supporting document for the adjustment.

key
string

System-assigned key for the supporting document.

Example: "1"
id
string

ID for the supporting document.

Example: "Sales01"
Array of objects

Line items of the AR adjustment.

Array
memo
string

Memo to describe the line item.

Example: "50 USD credit"
object

Transaction currency for the line item.

object

Exchange rate details used to calculate the base amount.

object

Label for the AR account.

object

Header level details for the AR adjustment's line entries.

object
object
Responses
200

OK

400

Bad Request

Request samples
application/json
{
  • "description": "May 2023 Refund"
}
Response samples
application/json
{
  • "ia::result": {
    • "id": "16855",
    • "key": "16855",
    • "href": "/objects/accounts-receivable/adjustment/16855"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Delete an adjustment

delete/objects/accounts-receivable/adjustment/{key}

Deletes an adjustment. An adjustment can be deleted if it has not yet been applied to an invoice.

Permissions and other requirements
SubscriptionAccounts Receivable
User ypeBusiness, Employee, Project Manager, and Warehouse users
PermissionsList, View, Delete Adjustments
SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned unique key for the adjustment.

Responses
204

No Content

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::error": {
    • "code": "invalidRequest",
    • "message": "Malformed URL",
    • "supportId": "sQrM9%7EYdh5oDEWVb80mrn9xuHjoAAAABBQ",
    • "details": [
      • {
        }
      ]
    }
}

Query adjustments

post/services/core/query

Queries an object for filtered data.

SecurityOAuth2
Request
Request Body schema: application/json
object
string

Object type to query, in the form <application-name>/<object name>. For custom objects use platform-apps/nsp::<object-name>.

Example: "accounts-receivable/adjustment"
fields
Array of strings

List of fields to include in the response. Can be any combination of these:

  • The name of a field in the object that you are querying, such as id.

  • The name of a field in a related object, using the form relatedObjectName.fieldName, such as vendor.id.

  • The result of an aggregate function run against the values in the returned objects. Use the form function:fieldName, such as min:startDate to return the earliest starting date. Valid function names are:

    • count
    • avg
    • sum
    • min
    • max
  • The result of an aggregate function run against the values in related objects, using the form function:relatedObjectName.fieldName, such as max:vendor.creditLimit. The same functions are supported as for object fields.

Example: ["key","id","max:vendor.creditLimit"]
Array of equal (object) or not equal (object) or less than (object) or (less than or equal (object)) or greater than (object) or (greater than or equal (object)) or in (object) or not in (object) or between (object) or not between (object) or contains (object) or does not contain (object) or starts with (object) or does not start with (object) or ends with (object) or does not end with (object)

Filter conditions to select the objects to return based on their field values. You use operators and conditions to build your filter, such as {"$eq":{"status":"active"}} to select objects in which status is equal to "active".

Example: [{"$eq":{"status":"active"}},{"$gt":{"totalDue":"1000"}},{"$contains":{"name":"Acme"}}]
Array
Any of:

Field value must be equal to this specified value.

For date fields, you can use these macro values that are relative to the current date or the asOfDate in filterParameters, if set:

  • today
  • currentWeek
  • currentMonth
  • currentQuarter
  • currentYear
  • yesterday
  • lastWeek
  • priorMonth
  • priorQuarter
  • priorYear

These are most useful for queries that you want to save and use repeatedly, such as for views or reports. Just change the asOfDate each time to retrieve the same data set for different time periods.

For example, {"eq":{"postingDate":"priorYear"}}.

object

The field name and value to be compared with object values.

Example: {"status":"active"}
filterExpression
string
Default: "and"

Logical operators to apply when there are multiple filter conditions. The conditions in the filters array are implicitly numbered starting at 1. Supports and, or, and grouping with parentheses.

Shortcuts:

  • and by itself means that all conditions must be true.
  • or by itself means that at least one condition must be true.
Example: "(1 and 2) or 3"
object

Pre-defined filter options.

asOfDate
string <date>

The "as of" date to use with any relative date comparisons in filters. For example, if asOfDate is set to "2022-04-01" then priorMonth will be "03".

The current date is used if asOfDate is not set.

Example: "2022-04-01"
includeHierarchyFields
boolean
Default: false

Set to true to include hierarchical structure information with each object in the response.

Example: false
caseSensitiveComparison
boolean
Default: true

Queries are case-sensitive by default. Set to false to ignore case in a query.

Example: true
includePrivate
boolean
Default: false

By default, in a multi-entity company, queries from the top-level entity do not access data in private entities. Set includePrivate to true if you want to query data in private entities.

Example: false
Array of objects

Set the order of the results by specifying field names to sort by and whether they should be in ascending or descending order.

Example: [{"totalDue":"asc"},{"lastPaymentMadeDate":"desc"}]
Array
property name*
additional property
string
Enum: "asc" "desc"
start
integer

First record of the result set to include in the response.

Example: 1
size
integer

Number of records to include in the response.

Example: 100
Responses
200

OK

400

Bad Request

Request samples
application/json
{
  • "object": "accounts-receivable/adjustment",
  • "filters": [
    • {
      • "$eq": {
        }
      }
    ],
  • "fields": [
    • "key",
    • "id",
    • "customer.id",
    • "baseCurrency.currency",
    • "baseCurrency.totalDue",
    • "createdDate",
    • "href"
    ],
  • "orderBy": [
    • {
      • "id": "asc"
      }
    ]
}
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "2",
      • "id": "2",
      • "customer.id": "C-00003",
      • "baseCurrency.currency": "USD",
      • "baseCurrency.totalDue": "-31433.92",
      • "createdDate": "2022-12-18",
      • "href": "/objects/accounts-receivable/adjustment/2"
      },
    • {
      • "key": "7",
      • "id": "7",
      • "customer.id": "C-00003",
      • "baseCurrency.currency": "USD",
      • "baseCurrency.totalDue": "-6810.68",
      • "createdDate": "2022-1-28",
      • "href": "/objects/accounts-receivable/adjustment/7"
      },
    • {
      • "key": "61",
      • "id": "61",
      • "customer.id": "C-00022",
      • "baseCurrency.currency": "USD",
      • "baseCurrency.totalDue": "-16000",
      • "createdDate": "2023-06-11",
      • "href": "/objects/accounts-receivable/adjustment/61"
      },
    • {
      • "key": "63",
      • "id": "63",
      • "customer.id": "C-00023",
      • "baseCurrency.currency": "USD",
      • "baseCurrency.totalDue": "-79233",
      • "createdDate": "2023-06-14",
      • "href": "/objects/accounts-receivable/adjustment/63"
      },
    • {
      • "key": "90",
      • "id": "90",
      • "customer.id": "C-00013",
      • "baseCurrency.currency": "USD",
      • "baseCurrency.totalDue": "-1666.68",
      • "createdDate": "2023-09-08",
      • "href": "/objects/accounts-receivable/adjustment/90"
      },
    • {
      • "key": "91",
      • "id": "91",
      • "customer.id": "C-00023",
      • "baseCurrency.currency": "USD",
      • "baseCurrency.totalDue": "-52822",
      • "createdDate": "2023-11-08",
      • "href": "/objects/accounts-receivable/adjustment/91"
      },
    • {
      • "key": "92",
      • "id": "92",
      • "customer.id": "C-00003",
      • "baseCurrency.currency": "USD",
      • "baseCurrency.totalDue": "-32307.7",
      • "createdDate": "2010-09-08",
      • "href": "/objects/accounts-receivable/adjustment/92"
      }
    ],
  • "ia::meta": {
    • "totalCount": 7,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}