Offset agreements
The basis of an offset: parties, bilateral or three-party offset, contract number and date, term and the schedule of recurring offsets.
Offset agreements
Objects
SettlementAgreement
idintegerrequiredID of the record, unique among records of its kind in the store.
kindstringrequiredbilateral — bilateral offset: the supplier and the customer are the same party; tripartite — three-party offset: the customer's debt is set off against the store's debt to another party, the supplier, with the consent of all three.
- Values:
bilateraltripartite
legal_entity_idintegerrequiredStore legal entity that is a party to the agreement (/v1/legal-entities).
supplier_idintegerrequiredCreditor supplier ID (/v1/suppliers).
customer_idinteger or nullDebtor customer ID (/v1/customers); null if the customer was erased. Requires access to customers.
customer_namestringCustomer name when the agreement was created. Requires access to customers.
referencestring or nullrequiredSigned agreement number; null if not set.
signed_onstring (date) or nullrequiredSigning date, YYYY-MM-DD; null if not set.
valid_fromstringrequiredStart of the term, YYYY-MM-DD.
valid_untilstring or nullrequiredEnd of the term, YYYY-MM-DD inclusive; null — open-ended.
schedulestringrequiredRecurring offset: manual — manual only; weekly — once a week; monthly — once a month.
- Values:
manualweeklymonthly
schedule_dayinteger or nullrequiredRun day: for weekly, the ISO weekday (1 — Monday); for monthly, the day of the month 1–31 (the last day in a shorter month); null for manual.
next_run_onstring (date) or nullrequiredDate of the next recurring offset, YYYY-MM-DD in the store time zone; null — no more runs.
notestring or nullrequiredStaff note; null if there is none.
created_atstring (date-time)requiredWhen the record was created.
updated_atstring (date-time)requiredWhen the record last changed.
Endpoints
Offset agreements: parties, kind, contract details, term and schedule
get/settlement-agreements
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})$
include_deletedbooleantrue — also return deleted records: archived ones with deleted_at set, and records erased from the database as tombstones {id, deleted_at} in the continuation by the sync cursor. Turn it on for a sync.
supplier_idintegerOnly documents of this supplier.
- 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-agreements" \
-H "Authorization: Bearer $SALEYA_API_TOKEN"{
"data": [
{
"id": 0,
"kind": "bilateral",
"legal_entity_id": 0,
"supplier_id": 0,
"customer_id": 0,
"customer_name": "string",
"reference": "string",
"signed_on": "2026-01-15",
"valid_from": "string",
"valid_until": "string",
"schedule": "manual",
"schedule_day": 0,
"next_run_on": "2026-01-15",
"note": "string",
"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 agreement
get/settlement-agreements/{settlement_agreement}
Scope: procurement:read
Parameters
Path
settlement_agreementintegerrequiredOffset agreement ID.
Responses
200Success
application/json
Returns SettlementAgreement
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-agreements/{settlement_agreement}" \
-H "Authorization: Bearer $SALEYA_API_TOKEN"{
"id": 0,
"kind": "bilateral",
"legal_entity_id": 0,
"supplier_id": 0,
"customer_id": 0,
"customer_name": "string",
"reference": "string",
"signed_on": "2026-01-15",
"valid_from": "string",
"valid_until": "string",
"schedule": "manual",
"schedule_day": 0,
"next_run_on": "2026-01-15",
"note": "string",
"created_at": "2026-01-15T12:00:00Z",
"updated_at": "2026-01-15T12:00:00Z"
}