Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.clopos.com/llms.txt

Use this file to discover all available pages before exploring further.

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

POST https://integrations.clopos.com/open-api/v2/receipts/{id}/close
This endpoint requires authentication. Include your JWT in the x-token header. See Authentication for how to obtain a token and Errors for error responses.

Path Parameters

ParameterTypeDescription
idnumberUnique identifier of the receipt to close.

Request Body

FieldTypeRequiredDescription
payment_methodsarrayYesList of payment methods with amounts. See Payment method.
closed_atstringNoClosing timestamp (YYYY-MM-DD HH:mm:ss). Defaults to current time if omitted.

payment_methods[]

FieldTypeRequiredDescription
idnumberYesPayment method ID.
namestringYesPayment method name (e.g., “Cash”, “Card”).
amountnumberYesAmount paid using this method.

Request Example

curl --location --request POST 'https://integrations.clopos.com/open-api/v2/receipts/10950/close' \
  --header 'Content-Type: application/json' \
  --header 'x-token: oauth_example_token' \
  --data '{
    "payment_methods": [
      {
        "id": 2,
        "name": "Cash",
        "amount": 8140
      }
    ],
    "closed_at": "2026-01-20 09:59:54"
  }'

Response

200 OK — Receipt Closed

{
  "success": true,
  "message": "Receipt closed",
  "data": {
    "id": 10950,
    "closed_at": "2026-01-20 09:59:54",
    "payment_methods": [
      {
        "id": 2,
        "name": "Cash",
        "amount": 8140
      }
    ]
  }
}

400 Bad Request — Validation Error

{
  "success": false,
  "error": "validation_failed",
  "message": "closed_at must be greater than created_at"
}

404 Not Found — Receipt Not Found

{
  "success": false,
  "error": "not_found",
  "message": "Receipt not found"
}

Field Reference

Response fields

FieldTypeDescription
successbooleanIndicates the result of the request.
messagestringHuman-readable status message.
data.idnumberReceipt identifier that was closed.
data.closed_atstringClosing timestamp applied to the receipt (YYYY-MM-DD HH:mm:ss).
data.payment_methodsarrayPayment methods recorded on the receipt.

payment_methods[]

FieldTypeDescription
idnumberPayment method ID.
namestringPayment method name (e.g., “Cash”, “Card”).
amountnumberAmount paid using this method.

Notes

  • The receipt must be in an open state (status: 1) to be closed through this endpoint.
  • If closed_at is omitted, the server uses the current timestamp.
  • The closed_at value must be later than the receipt’s created_at timestamp.
  • After closing, the receipt’s status changes to 2 (closed).