Cart.Cancel

Cancels this integration's saved cart.

Pass the integration Bearer token in the HTTP header. See API authentication.

Input parameters

Name Data type Required Description
id string Instead of external_id Local cart ID; nonempty string, up to 100 characters
external_id string Instead of id External identifier from Cart.Add; nonempty string, up to 100 characters

Provide exactly one of id or external_id. External identifiers are resolved only within the current integration. Both or neither returns 701003. A missing or foreign cart returns 701001.

Request example

Authorization: Bearer <integration-token>
Content-Type: application/json;charset=utf-8
{
    "jsonrpc": "2.0",
    "method": "Cart.Cancel",
    "params": {
        "id": "0123456789abcdef0123456789abcdef"
    },
    "id": 2
}
{
    "jsonrpc": "2.0",
    "method": "Cart.Cancel",
    "params": {
        "external_id": "ORDER-2026-001"
    },
    "id": 2
}

Output parameters

Name Data type Description
cart_id string Local cart ID returned by Cart.Add
status string Cart state: open, process, finished or canceled
receipt_id string or null Completed receipt ID; null until completion
created_at string Creation time, register local time, YYYY-MM-DD HH:mm:ss
updated_at string Update time, register local time, YYYY-MM-DD HH:mm:ss
total int64 Cart net total after discounts, in tiyin
items array Cart positions
items[].item_id int64 Local product ID for Cart.Add
items[].name string Product name
items[].barcode string Barcode; empty if absent
items[].icps string ICPS code
items[].price int64 Unit price in tiyin
items[].quantity int64 Quantity in thousandths; 1000 means one unit
items[].discount int64 Discount for the entire position, in tiyin
items[].amount int64 Net amount after discount, in tiyin
items[].vat_value int64 VAT in hundredths of a percent; -1 means no VAT
items[].package_code string or null Package code; null if absent
items[].label string Unit marking code; empty if absent

Result has the same fields as Cart.Get, with status canceled. Positions are preserved. Repeated cancellation succeeds with canceled. Additions are no longer allowed; create a new cart to continue. This method does not cancel any payment or fiscal receipt.

Only open carts can be canceled through this API; process and finished return 703102. In process, the cashier can annul the unpaid receipt in the sales window.

Response example

{
    "jsonrpc": "2.0",
    "result": {
        "cart_id": "0123456789abcdef0123456789abcdef",
        "status": "canceled",
        "receipt_id": null,
        "created_at": "2026-11-12 10:00:00",
        "updated_at": "2026-11-12 10:05:00",
        "total": 10000,
        "items": [
            {
                "item_id": 101,
                "name": "Тестовый товар",
                "barcode": "4780000000000",
                "icps": "00000000000000000",
                "price": 10000,
                "quantity": 1000,
                "discount": 0,
                "amount": 10000,
                "vat_value": 0,
                "package_code": null,
                "label": ""
            }
        ]
    },
    "ok": true,
    "id": 2
}

Errors: common errors; 701003 for missing, invalid or ambiguous id/external_id; 701001 for missing/foreign cart.