Cart.Get

Returns this integration's cart contents and status by local or external identifier.

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

Input parameters

Name Data type Required Description
id string One of two cart_id returned by Cart.Add; up to 100 characters
external_id string One of two external_id of a successful Cart.Add request; up to 100 characters

Supply exactly one nonempty identifier. Use the external_id supplied when creating the cart through Cart.Add. Other integrations' identifiers are inaccessible.

For local ID use "params":{"id":"0123456789abcdef0123456789abcdef"}.

Request example

Authorization: Bearer <integration-token>
Content-Type: application/json;charset=utf-8
{
    "jsonrpc": "2.0",
    "method": "Cart.Get",
    "params": {
        "external_id": "ORDER-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 fields: cart_id, status, receipt_id, created_at, updated_at (register local time, YYYY-MM-DD HH:mm:ss), total, items. Money is in tiyin; quantity is in thousandths. Each item contains item_id, name, barcode, icps, price, quantity, discount, amount, vat_value, package_code, label.

States: open awaits checkout and permits cancellation; process means cashier checkout is underway; finished means the fiscal receipt is complete; canceled means canceled. receipt_id is null until completion, then identifies the receipt. Read it using Receipt.Get with "params":{"id":"<receipt_id>"}. Payment errors do not finish the cart.

Response example

{
    "jsonrpc": "2.0",
    "result": {
        "cart_id": "0123456789abcdef0123456789abcdef",
        "status": "finished",
        "receipt_id": "fedcba9876543210fedcba9876543210",
        "created_at": "2026-11-13 10:00:00",
        "updated_at": "2026-11-13 10:05:00",
        "total": 10000,
        "items": [
            {
                "item_id": 101,
                "name": "Test product",
                "barcode": "4780000000000",
                "icps": "00000000000000000",
                "price": 10000,
                "quantity": 1000,
                "discount": 0,
                "amount": 10000,
                "vat_value": 0,
                "package_code": null,
                "label": ""
            }
        ]
    },
    "ok": true,
    "id": 2
}

Repeated calls do not create payments or receipts. Errors: common errors; 701003 for invalid/ambiguous identifiers; 701001 for missing/foreign carts.