Refund Bill (Server-Derived)

Creates a refund of a bill from a line selection — the client sends only which parent lines, quantities, batch/serial picks and refund tenders; all money, tax and sign derivation is done server-side from the parent bill. Gated by the company's server-side refunds feature flag (rejected with error code REFUND_NOT_AVAILABLE when off) and not deployed in the docs sandbox, so this operation is documented from code. Requires p/r-bill on the parent bill's location and p/c-bill on the register session's location; register_session_id must be an open register session. Apps without an open POS session can instead create a refund with POST /sales/bills (type: refund, is_cloud_settle: true).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
integer
required

Parent bill id to refund.

Body Params
string
required

Idempotency key, 8-64 chars of [A-Za-z0-9_-], e.g. rfd_

integer
required

An OPEN register session id of the company.

lines
array
required

Refund selection: each item is {bill_line_id (required), quantity (required, positive, in the parent line's sale unit — the server signs), batches: [{batch_id, quantity}], serials: [string]}.

lines*
payments
array
required

Refund tenders: [{method, amount (positive — the server signs), ref, transfer_receipt_id}]. Key must be present; may be an empty array when the whole refund goes to customer credit.

payments*
string | null
Headers
string
required

The merchant install this request acts on (install.store_id from the app.installed webhook).

Responses

400

Server-side refunds not enabled for the company (REFUND_NOT_AVAILABLE), closed register session, or an invalid selection.

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json