Offset lines
What exactly was offset: an order or the customer account debt and a supplier bill, with the settlements the offset created.
Offset lines
Objects
SettlementOffsetLine
idintegerrequiredID of the record, unique among records of its kind in the store.
settlement_offset_idintegerrequiredOffset ID (/v1/settlement-offsets).
sidestringrequiredreceivable — the customer's debt to the store (an order or the customer account debt); payable — the store's debt to the supplier (a bill).
- Values:
receivablepayable
positionintegerrequiredSort position: lower comes first.
amountintegerrequiredAmount set off.
currencystringrequiredCurrency of the amounts, an ISO 4217 code: the currency of the store.
- Values:
ARSUSDBRLCLPCOPMXNPENRUB
order_idinteger or nullrequiredID of the order whose debt was set off (/v1/orders); null on other lines.
customer_account_entry_idinteger or nullrequiredID of the customer account entry of kind offset by which the offset reduced the customer's debt (/v1/customer-account-entries); null on other lines. Voiding writes its reversal.
payment_idinteger or nullrequiredID of the order payment created by the offset (/v1/payments); null on other lines and after voiding.
supplier_bill_idinteger or nullrequiredSupplier bill ID (/v1/supplier-bills); null on customer lines. If a delivery debt was replaced by an invoice — the invoice.
supplier_bill_payment_idinteger or nullrequiredID of the bill payment created by the offset (/v1/supplier-bill-payments); null on customer lines and after voiding.
created_atstring (date-time)requiredWhen the record was created.
updated_atstring (date-time)requiredWhen the record last changed.
Endpoints
Offset lines: customer debts and supplier bills that were offset
get/settlement-offset-lines
Scope: procurement:read
Parameters
Query
limitintegerPage size: up to 250 records; 50 by default.
- Minimum:
- 1
- Maximum:
- 250
cursorstringOpaque cursor: next_cursor of the previous page, or sync_cursor of the last page saved by the previous sync. The list goes in commit order, so the sync cursor later returns only what changed after it.
- Max length:
- 4096
updated_sincestring (date-time)Only records changed after this moment, ISO 8601 with a time zone. A filter for the first sync; continue with the cursor.
- Pattern:
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,6})?(Z|[+-]\d{2}:\d{2})$
settlement_offset_idintegerOnly lines of this offset.
- Minimum:
- 1
order_idintegerOnly lines that settled this order's debt.
- Minimum:
- 1
Responses
200Success
application/json
Records of the page.
deletedarray of objectrequiredRecords erased from the database since the cursor, as tombstones: only with include_deleted=true in the continuation by the sync cursor.
Fields · 2
idintegerrequiredID of the erased record.
deleted_atstring (date-time)requiredWhen the record was erased.
next_cursorstring or nullrequiredCursor of the next page; null on the last page.
has_morebooleanrequiredtrue when there is a next page.
sync_cursorstring or nullrequiredOn the last page — the cursor to continue from later: it returns only what changed after this page. null on other pages.
401The token is missing, invalid, expired or revoked
Headers
WWW-AuthenticatestringrequiredAuthentication scheme (RFC 6750).
- Example:
Bearer
application/problem+json
Returns Problem
403The plan, the IP address or the token scopes do not allow the request
Headers
WWW-AuthenticatestringAuthentication scheme (RFC 6750).
- Example:
Bearer error="insufficient_scope", scope="locations:read"
application/problem+json
Returns ForbiddenProblem
410The sync cursor is older than the deletion retention period or was issued before the database was restored
application/problem+json
Returns Problem
422A parameter is invalid or unknown
application/problem+json
Returns ValidationProblem
429The rate limit is exhausted
Headers
Retry-AfterintegerrequiredSeconds to wait before retrying.
- Minimum:
- 0
application/problem+json
Returns RateLimitProblem
503The store is temporarily unavailable
Headers
Retry-AfterintegerSeconds to wait before retrying.
- Minimum:
- 0
application/problem+json
Returns Problem
Errors of this endpoint
Common errors such as token, access, input validation and rate limit can come from any endpoint; they are listed in the catalog: Errors
curl "https://api.saleya.app/v1/settlement-offset-lines" \
-H "Authorization: Bearer $SALEYA_API_TOKEN"{
"data": [
{
"id": 0,
"settlement_offset_id": 0,
"side": "receivable",
"position": 0,
"amount": 0,
"currency": "ARS",
"order_id": 0,
"customer_account_entry_id": 0,
"payment_id": 0,
"supplier_bill_id": 0,
"supplier_bill_payment_id": 0,
"created_at": "2026-01-15T12:00:00Z",
"updated_at": "2026-01-15T12:00:00Z"
}
],
"deleted": [
{
"id": 0,
"deleted_at": "2026-01-15T12:00:00Z"
}
],
"next_cursor": "string",
"has_more": true,
"sync_cursor": "string"
}Offset line
get/settlement-offset-lines/{settlement_offset_line}
Scope: procurement:read
Parameters
Path
settlement_offset_lineintegerrequiredOffset line ID.
Responses
200Success
application/json
Returns SettlementOffsetLine
401The token is missing, invalid, expired or revoked
Headers
WWW-AuthenticatestringrequiredAuthentication scheme (RFC 6750).
- Example:
Bearer
application/problem+json
Returns Problem
403The plan, the IP address or the token scopes do not allow the request
Headers
WWW-AuthenticatestringAuthentication scheme (RFC 6750).
- Example:
Bearer error="insufficient_scope", scope="locations:read"
application/problem+json
Returns ForbiddenProblem
404The object does not exist or is not available to the app
application/problem+json
Returns Problem
422A parameter is invalid or unknown
application/problem+json
Returns ValidationProblem
429The rate limit is exhausted
Headers
Retry-AfterintegerrequiredSeconds to wait before retrying.
- Minimum:
- 0
application/problem+json
Returns RateLimitProblem
503The store is temporarily unavailable
Headers
Retry-AfterintegerSeconds to wait before retrying.
- Minimum:
- 0
application/problem+json
Returns Problem
Common errors such as token, access, input validation and rate limit can come from any endpoint; they are listed in the catalog: Errors
curl "https://api.saleya.app/v1/settlement-offset-lines/{settlement_offset_line}" \
-H "Authorization: Bearer $SALEYA_API_TOKEN"{
"id": 0,
"settlement_offset_id": 0,
"side": "receivable",
"position": 0,
"amount": 0,
"currency": "ARS",
"order_id": 0,
"customer_account_entry_id": 0,
"payment_id": 0,
"supplier_bill_id": 0,
"supplier_bill_payment_id": 0,
"created_at": "2026-01-15T12:00:00Z",
"updated_at": "2026-01-15T12:00:00Z"
}