Offsets

An offset document: what a customer owes the store against what the store owes a supplier. A voided offset stays with status voided.

Loading the search index…

Offsets

Objects

SettlementOffset

  • idintegerrequired

    ID of the record, unique among records of its kind in the store.

  • numberstringrequired

    Offset document number.

  • statusstringrequired

    posted — posted; voided — voided: settlements created by the offset are removed and the debts are open again.

    Values:
    postedvoided
  • kindstringrequired

    bilateral — bilateral offset; tripartite — three-party offset under agreement agreement_id.

    Values:
    bilateraltripartite
  • legal_entity_idintegerrequired

    Store legal entity that posted the offset (/v1/legal-entities).

  • supplier_idintegerrequired

    Supplier ID (/v1/suppliers).

  • agreement_idinteger or nullrequired

    Offset agreement ID (/v1/settlement-agreements); null for a bilateral offset without an agreement.

  • customer_idinteger or null

    Customer ID (/v1/customers); null if the customer was erased. Requires access to customers.

  • customer_namestring

    Customer name when the offset was posted. Requires access to customers.

  • occurred_onstring (date)required

    Offset date, YYYY-MM-DD in the store time zone.

  • totalintegerrequired

    Offset amount: that much is set off against both the customer's debts and the supplier's bills.

  • currencystringrequired

    Currency of the amounts, an ISO 4217 code: the currency of the store.

    Values:
    ARSUSDBRLCLPCOPMXNPENRUB
  • notestring or nullrequired

    Staff note; null if there is none.

  • posted_atstring (date-time)required

    When the offset was posted.

  • voided_atstring (date-time) or nullrequired

    When the offset was voided; null for a posted one.

  • created_atstring (date-time)required

    When the record was created.

  • updated_atstring (date-time)required

    When the record last changed.

Endpoints

Offsets: mutual debts of a customer and a supplier settled by an offset document

get/settlement-offsets

Scope: procurement:read

Parameters

Query

  • limitinteger

    Page size: up to 250 records; 50 by default.

    Minimum:
    1
    Maximum:
    250
  • cursorstring

    Opaque 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})$
  • supplier_idinteger

    Only documents of this supplier.

    Minimum:
    1
  • agreement_idinteger

    Only offsets under this agreement.

    Minimum:
    1

Responses

200Success

application/json

  • dataarray of SettlementOffsetrequired

    Records of the page.

  • deletedarray of objectrequired

    Records erased from the database since the cursor, as tombstones: only with include_deleted=true in the continuation by the sync cursor.

    Fields · 2
    • idintegerrequired

      ID of the erased record.

    • deleted_atstring (date-time)required

      When the record was erased.

  • next_cursorstring or nullrequired

    Cursor of the next page; null on the last page.

  • has_morebooleanrequired

    true when there is a next page.

  • sync_cursorstring or nullrequired

    On 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-Authenticatestringrequired

    Authentication 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-Authenticatestring

    Authentication 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-Afterintegerrequired

    Seconds to wait before retrying.

    Minimum:
    0

application/problem+json

Returns RateLimitProblem

503The store is temporarily unavailable

Headers

  • Retry-Afterinteger

    Seconds 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

Example request
curl "https://api.saleya.app/v1/settlement-offsets" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Example response · 200
{
  "data": [
    {
      "id": 0,
      "number": "string",
      "status": "posted",
      "kind": "bilateral",
      "legal_entity_id": 0,
      "supplier_id": 0,
      "agreement_id": 0,
      "customer_id": 0,
      "customer_name": "string",
      "occurred_on": "2026-01-15",
      "total": 0,
      "currency": "ARS",
      "note": "string",
      "posted_at": "2026-01-15T12:00:00Z",
      "voided_at": "2026-01-15T12:00:00Z",
      "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

get/settlement-offsets/{settlement_offset}

Scope: procurement:read

Parameters

Path

  • settlement_offsetintegerrequired

    Offset ID.

Responses

200Success

application/json

Returns SettlementOffset

401The token is missing, invalid, expired or revoked

Headers

  • WWW-Authenticatestringrequired

    Authentication 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-Authenticatestring

    Authentication 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-Afterintegerrequired

    Seconds to wait before retrying.

    Minimum:
    0

application/problem+json

Returns RateLimitProblem

503The store is temporarily unavailable

Headers

  • Retry-Afterinteger

    Seconds 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

Example request
curl "https://api.saleya.app/v1/settlement-offsets/{settlement_offset}" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Example response · 200
{
  "id": 0,
  "number": "string",
  "status": "posted",
  "kind": "bilateral",
  "legal_entity_id": 0,
  "supplier_id": 0,
  "agreement_id": 0,
  "customer_id": 0,
  "customer_name": "string",
  "occurred_on": "2026-01-15",
  "total": 0,
  "currency": "ARS",
  "note": "string",
  "posted_at": "2026-01-15T12:00:00Z",
  "voided_at": "2026-01-15T12:00:00Z",
  "created_at": "2026-01-15T12:00:00Z",
  "updated_at": "2026-01-15T12:00:00Z"
}