propose_write
finance

Push one Z-report (the day close of one till): staged for the cash book and proposed as that day's settlement. Books not

Changed on

The day close of one till: turnover per sales-tax rate (the rate as a percentage, the amount gross of tax, after refunds), tenders (cash, card with its provider, voucher; signed, so a cash refund is negative), and the day's refunds and voids. Amounts are decimal strings in the currency's precision. Answers 201 with id and status (new or replaced), or 200 with status: unchanged when the same close is already held, so a retry needs no key. A close for a day already counted is refused (fin.pos_day_counted), as is a day in a closed or filed period, before the store's settle-from day, or of a Shopify point-of-sale till, whose sales arrive as Shopify orders (fin.pos_till_via_shopify): 409 close_conflict with reason. An Idempotency-Key header (or idempotency_key) is optional; when sent, a retry with the same key and close answers the first result without running again, and the same key over another close is 409 idempotency_conflict. 403 while the cash book is switched off. Nothing is booked: the day is proposed as a settlement a person approves in Books.

post/api/v1/finance/pos-day-closes

Request

  • Base URL
    https://app.magistry.io
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopesfinance:write

Headers

Idempotency-Key, string

Optional; honoured when sent. A unique string you choose for this request; send the SAME key when retrying and the first answer is returned instead of writing twice (idempotent-replayed: true). The same key with other arguments is 409 idempotency_conflict. If the header and idempotency_key are both sent they must be equal.

Request body

object required
entity_id, string uuid required

The entity, one of those this app was granted (GET /api/v1/finance/entities lists them). In a GET query string entity is accepted too.

till_id, string uuid required

The till (its id in Books, under Settlements, Cash book).

business_date, string date required

The day this Z-report closes.

currency, string required

ISO 4217.

report_no, string

The Z-report's own number.

turnover, object[] required

Turnover per sales-tax rate, gross of tax, after refunds.

tenders, object[] required

What was paid with: their sum equals the turnover's.

refunds_amount, string

The day's refunds, gross, as a positive amount.

refunds_count, integer

How many refunds.

voids_count, integer

How many voided sales.

idempotency_key, string

Same as the Idempotency-Key header; give one of the two.

Response

Result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision