Purpose
Close an existing receipt by updating its payment methods and setting the closing timestamp. This endpoint is used to finalize a receipt that was previously created but not yet closed.HTTP Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | number | Unique identifier of the receipt to close. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
payment_methods | array | Yes | List of payment methods with amounts. See Payment method. |
closed_at | string | No | Closing timestamp (YYYY-MM-DD HH:mm:ss). Defaults to current time if omitted. |
payment_methods[]
| Field | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Payment method ID. |
name | string | Yes | Payment method name (e.g., “Cash”, “Card”). |
amount | number | Yes | Amount paid using this method. |
Request Example
Response
200 OK — Receipt Closed
400 Bad Request — Validation Error
404 Not Found — Receipt Not Found
Field Reference
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the result of the request. |
message | string | Human-readable status message. |
data.id | number | Receipt identifier that was closed. |
data.closed_at | string | Closing timestamp applied to the receipt (YYYY-MM-DD HH:mm:ss). |
data.payment_methods | array | Payment methods recorded on the receipt. |
payment_methods[]
| Field | Type | Description |
|---|---|---|
id | number | Payment method ID. |
name | string | Payment method name (e.g., “Cash”, “Card”). |
amount | number | Amount paid using this method. |
Notes
- The receipt must be in an open state (
status: 1) to be closed through this endpoint. - If
closed_atis omitted, the server uses the current timestamp. - The
closed_atvalue must be later than the receipt’screated_attimestamp. - After closing, the receipt’s
statuschanges to2(closed).