Skip to content

Receipts

Endpoints for listing and creating receipts documents.


GET /receipts

List receipts with optional filtering, searching, and pagination.

Request

GET /api/{account}/v4.0.0/receipts/
Authorization: Bearer <xa-token>

Parameters

Name In Type Required Description
nonce query integer (int64) No Client-generated unique sequential number
filterDate query string No Filter by date or interval. Format: YYYY-MM-DD or YYYY-MM-DD:YYYY-MM-DD
searchString query string No Search by document number. Example: searchString=123456
searchColumn query string No Column to search instead of document number
searchOperator query string No Comparison operator: lt, lte, gt, gte, ne; from 7.2.03 also contains
skip query integer No Number of records to skip (pagination)
limit query integer No Max records to return. Max: 1000, default: 50

Responses

200 — Success

Returns an array of customerDocument objects (empty array if none found).

Each line that settles a document has item_type D: description is the settled document (series, number, date), unit_of_measurement its series, qty the settled document's open balance before this payment (the document's total for a first full payment) and unit_price the amount paid. From 7.2.03, taxable_amount on these lines is the amount paid; before, it showed qty × unit_price.

Receipt PDF

GET /api/{account}/v4.0.0/receipts/{id}/?nonce={nonce}&print=1
GET /api/{account}/v4.0.0/receipts/?nonce={nonce}&id={id}&print=1

Both return 200 with Content-Type: application/pdf.

400 — Invalid input parameters


POST /receipts

Create a new receipt document.

Settling invoices

Before 7.2.03, POST /receipts cannot settle an invoice; issue those receipts in Gestix. From 7.2.03, a receipt settles invoices as described in Settling invoices.

Request

POST /api/{account}/v4.0.0/receipts?nonce={nonce}
Authorization: Bearer <xa-token>
Content-Type: application/json

Parameters

Name In Type Required Description
nonce query integer (int64) Yes Client-generated unique sequential number
print query integer No Pass 1 to receive the created document as a PDF. Default: 0

Request Body

A customerDocument object. Required fields: document_set, seq_number, date, currency, total_amount.

Settling invoices

From 7.2.03. Send one D line per settled invoice (or debit memo) of the receipt's customer:

Field Value
item_type "D"
item_code The invoice's series, for example "FAT"
description The invoice's number, for example "332"
unit_price The amount paid
{
  "document_set": "RCB",
  "currency": "EUR",
  "payment_type": "5",
  "customer": {"vat_id": "500156050"},
  "items": [
    {"item_type": "D", "item_code": "FAT", "description": "332", "unit_price": 5000.00},
    {"item_type": "D", "item_code": "FAT", "description": "340", "unit_price": 300.00}
  ]
}
  • An amount below the invoice's open balance is a partial payment; a later receipt can pay the rest.
  • Several lines settle several invoices in one receipt.
  • Shortcut: "related_document": "FAT 332" with no items settles that invoice for its full open balance.
  • Afterwards the invoice's amount_paid is updated, and the invoice is closed when fully paid.
  • Refused with 400, nothing stored: invoice not found, cancelled, already paid, or of another customer; amount missing, 0 or less, or above the open balance (lines of the same receipt included); related_document together with items.

Responses

202 — Document accepted

The document is created. The response has no ID or number. Before 7.2.03 the body is empty; from 7.2.03 it is {"status":202,"error":false,"message":"Gestix document accepted"}. To get the ID and number, search by your reference.

400 — Invalid input

Nothing is stored. See Error Handling for how to read the reason.

409 — Duplicate entry

Returned when a document with the same identifier already exists. Nothing is stored. See Error Handling for how to read the reason.


See Also