Customer account entries

Receivables book entries: sale on account, payment, return, write-off, offset, withholding and reversal. Append-only.

Loading the search index…

Customer account entries

Objects

CustomerAccountEntry

  • idintegerrequired

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

  • customer_account_idintegerrequired

    Customer account ID (/v1/customer-accounts). Changes only on a customer merge, when the entry moves to the remaining customer account.

  • kindstringrequired

    Entry kind: charge is a sale on account; opening_balance is a debt from the previous books; opening_credit is an overpayment from the previous books; payment is a debt payment; return is a return of goods sold on account; write_off is a bad debt write-off; offset is an offset against the customer as a supplier; withholding is tax withheld by a customer acting as a withholding agent on payment; reversal reverses the entry reverses_entry_id.

    Values:
    chargeopening_balanceopening_creditpaymentreturnwrite_offoffsetwithholdingreversal
  • amountintegerrequired

    Signed amount in minor currency units: positive means the debt grew, negative means it went down.

  • currencystringrequired

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

    Values:
    ARSUSDBRLCLPCOPMXNPENRUB
  • legal_entity_idinteger or nullrequired

    ID of the store legal entity (/v1/legal-entities) the debt is owed to: a payment closes debts of its own legal entity only. null if no legal entity is set.

  • due_onstring (date) or nullrequired

    Due date of the charge, YYYY-MM-DD in the store time zone: the debt is overdue from the next day. null for entries that reduce the debt.

  • occurred_atstring (date-time)required

    When the operation happened. A debt from the previous books is backdated, so operations are ordered by this field, not by entry order.

  • order_idinteger or nullrequired

    Order ID (/v1/orders): the sale on account or the debt payment order with account_payment_amount; null if there is no order.

  • payment_idinteger or nullrequired

    Payment ID (/v1/payments) with the on_account method of a sale on account; null for other entries. The money of a debt payment is the payment of its order order_id.

  • refund_idinteger or nullrequired

    ID of the refund (/v1/refunds) that returned goods sold on account; null for other entries.

  • reverses_entry_idinteger or nullrequired

    ID of the entry this reversal cancels; null for a regular entry.

  • settlement_offset_idinteger or nullrequired

    Offset ID (/v1/settlement-offsets) for an entry of kind offset; null otherwise. The reversal of an offset points to the entry (reverses_entry_id).

  • tax_withholding_idinteger or nullrequired

    ID of the certificate in the withholding register (/v1/tax-withholdings, scope fiscal:read) on an entry of kind withholding; null on other entries and once the certificate is removed from the register — a reversal removes the certificate the payment created.

  • notestring or nullrequired

    Staff note: the reason for a write-off, a carried-over debt or a reversal; null if there is none.

  • created_atstring (date-time)required

    When the entry was written to the book.

Endpoints

Customer account entries: sales on account, payments, returns, write-offs, offsets, withholdings and reversals

get/customer-account-entries

Scope: finance: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})$
  • customer_account_idinteger

    Only entries of this customer account.

    Minimum:
    1
  • payment_idinteger

    Only entries of this payment.

    Minimum:
    1
  • order_idinteger

    Only records of this order.

    Minimum:
    1

Responses

200Success

application/json

  • dataarray of CustomerAccountEntryrequired

    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/customer-account-entries" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Example response · 200
{
  "data": [
    {
      "id": 0,
      "customer_account_id": 0,
      "kind": "charge",
      "amount": 0,
      "currency": "ARS",
      "legal_entity_id": 0,
      "due_on": "2026-01-15",
      "occurred_at": "2026-01-15T12:00:00Z",
      "order_id": 0,
      "payment_id": 0,
      "refund_id": 0,
      "reverses_entry_id": 0,
      "settlement_offset_id": 0,
      "tax_withholding_id": 0,
      "note": "string",
      "created_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"
}

Customer account entry

get/customer-account-entries/{customer_account_entry}

Scope: finance:read

Parameters

Path

  • customer_account_entryintegerrequired

    Customer account entry ID.

Responses

200Success

application/json

Returns CustomerAccountEntry

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/customer-account-entries/{customer_account_entry}" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Example response · 200
{
  "id": 0,
  "customer_account_id": 0,
  "kind": "charge",
  "amount": 0,
  "currency": "ARS",
  "legal_entity_id": 0,
  "due_on": "2026-01-15",
  "occurred_at": "2026-01-15T12:00:00Z",
  "order_id": 0,
  "payment_id": 0,
  "refund_id": 0,
  "reverses_entry_id": 0,
  "settlement_offset_id": 0,
  "tax_withholding_id": 0,
  "note": "string",
  "created_at": "2026-01-15T12:00:00Z"
}