Skip to content

Invoice Settlement

The invoice settlement resource.

Base/invoiceSettlement
GET/invoiceSettlement

List invoice settlements

Retrieve a paginated list of invoice settlements. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GET/invoiceSettlement
curl --request GET \
  --url '<your-host>/invoiceSettlement?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "appliedAmount": 0,
    "discountAmount": 10,
    "writeOffAmount": 0,
    "sourceExchangeRate": 0,
    "targetExchangeRate": 0,
    "fxGainLossAmount": 0,
    "appliedDate": "2026-01-01"
  }
]
GET/invoiceSettlement

Retrieve a invoice settlement

Fetch a single invoice settlement by filtering on `id`.

Query parameters

idstring

Match on the invoice settlement's `id`, e.g. `eq.{id}`.

GET/invoiceSettlement
curl --request GET \
  --url '<your-host>/invoiceSettlement?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "appliedAmount": 0,
  "discountAmount": 10,
  "writeOffAmount": 0,
  "sourceExchangeRate": 0,
  "targetExchangeRate": 0,
  "fxGainLossAmount": 0,
  "appliedDate": "2026-01-01"
}
POST/invoiceSettlement

Create a invoice settlement

Create a new invoice settlement.

Body parameters

paymentIdstring

References payment.id

memoIdstring

References memo.id

targetSalesInvoiceIdstring

References salesInvoice.id

targetPurchaseInvoiceIdstring

References purchaseInvoice.id

targetMemoIdstring

References memo.id

appliedAmountnumberrequired

Target-document principal relieved in company base currency.

discountAmountnumberrequired

Target-document discount relief in company base currency.

writeOffAmountnumberrequired

Target-document write-off relief in company base currency.

sourceExchangeRatenumberrequired
targetExchangeRatenumberrequired
fxGainLossAmountnumberrequired

Server-calculated posting snapshot in company base currency: positive gain, negative loss.

appliedDatedaterequired
companyIdstringrequired

References company.id

appliedViaPaymentIdstring

References payment.id

sourcePaymentIdstring

Prior posted payment supplying on-account credit; paymentId remains the applying/void owner. NULL means current payment cash.

sourceAmountnumber

Principal consumed in the funding source document currency, stored independently of target-base appliedAmount.

POST/invoiceSettlement
curl --request POST \
  --url <your-host>/invoiceSettlement \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"appliedAmount":0,"discountAmount":10,"writeOffAmount":0,"sourceExchangeRate":0,"targetExchangeRate":0,"fxGainLossAmount":0,"appliedDate":"2026-01-01","companyId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "appliedAmount": 0,
  "discountAmount": 10,
  "writeOffAmount": 0,
  "sourceExchangeRate": 0,
  "targetExchangeRate": 0,
  "fxGainLossAmount": 0,
  "appliedDate": "2026-01-01"
}
PATCH/invoiceSettlement

Update a invoice settlement

Update an existing invoice settlement, matched on `id`.

Body parameters

paymentIdstring

References payment.id

memoIdstring

References memo.id

targetSalesInvoiceIdstring

References salesInvoice.id

targetPurchaseInvoiceIdstring

References purchaseInvoice.id

targetMemoIdstring

References memo.id

appliedAmountnumberrequired

Target-document principal relieved in company base currency.

discountAmountnumberrequired

Target-document discount relief in company base currency.

writeOffAmountnumberrequired

Target-document write-off relief in company base currency.

sourceExchangeRatenumberrequired
targetExchangeRatenumberrequired
fxGainLossAmountnumberrequired

Server-calculated posting snapshot in company base currency: positive gain, negative loss.

appliedDatedaterequired
companyIdstringrequired

References company.id

appliedViaPaymentIdstring

References payment.id

sourcePaymentIdstring

Prior posted payment supplying on-account credit; paymentId remains the applying/void owner. NULL means current payment cash.

sourceAmountnumber

Principal consumed in the funding source document currency, stored independently of target-base appliedAmount.

PATCH/invoiceSettlement
curl --request PATCH \
  --url '<your-host>/invoiceSettlement?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"paymentId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "appliedAmount": 0,
  "discountAmount": 10,
  "writeOffAmount": 0,
  "sourceExchangeRate": 0,
  "targetExchangeRate": 0,
  "fxGainLossAmount": 0,
  "appliedDate": "2026-01-01"
}
DELETE/invoiceSettlement

Delete a invoice settlement

Delete a invoice settlement, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the invoice settlement to delete, e.g. `eq.{id}`.

DELETE/invoiceSettlement
curl --request DELETE \
  --url '<your-host>/invoiceSettlement?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content