Skip to content

Sale

Prints a sale receipt.

POSThttps://localhost:26496/service·command: Sale

Like every command, this one goes to the same address. The command name is in the body, not in the URL.

Request

json
{
  "id": "1",
  "method": "send",
  "data": {
    "command": "Sale",
    "payload": {
      "saleType": "Sale",
      "amount": 12500,
      "discountAmount": 0,
      "totalAmount": 12500,
      "shouldPrintReceipt": true,
      "products": [
        {
          "id": "p_1001",
          "name": "Espresso",
          "barcode": null,
          "units": "шт",
          "price": 12500,
          "vat": 0.12,
          "amount": 1,
          "isDecimalUnits": false,
          "labels": [],
          "psid": "10112001001000000",
          "packageCode": 1512472,
          "unitCode": null,
          "discountAmount": 0,
          "commissionTIN": null,
          "commissionPINFL": null
        }
      ],
      "payments": [{ "paymentType": "Cash", "amount": 12500 }]
    }
  }
}

Response

json
{ "id": "1", "success": true, "data": { "saleId": 142 } }

Save saleId. You need it to refund this receipt later, and there is no way to look it up afterwards.

payload

FieldTypeDescription
saleTypestring"Sale"
amountintegerTotal before discount, in tiyin
discountAmountintegerDiscount on the whole receipt, in tiyin. 0 if none.
totalAmountintegeramount − discountAmount
productsarrayReceipt lines, see below
paymentsarrayPayments, see below
shouldPrintReceiptbooleantrue — print on paper

products

FieldTypeDescription
idstringAny unique line id
namestringName printed on the receipt
barcodenullSend null
unitsstring"шт"
priceintegerPrice of one unit, in tiyin
vatnumber0.12 for 12%. Not 12.
amountnumberQuantity
isDecimalUnitsbooleantrue for goods sold by weight
labelsarrayMarking codes, one per unit. [] if the product is not marked.
psidstringIKPU, exactly 17 digits, as a string
packageCodeintegerPackage code, a number
unitCodenullSend null
discountAmountintegerDiscount on one unit, in tiyin. 0 if none.
commissionTINnullSend null
commissionPINFLnullSend null

payments

FieldTypeDescription
paymentTypestring"Cash", "Card" or "Cashless"
amountintegerAmount in tiyin

Several payments make a split payment:

json
"payments": [
  { "paymentType": "Card", "amount": 40000 },
  { "paymentType": "Cash", "amount": 5000 }
]

The sums must match

The device rejects the receipt if they do not:

amount      = sum of (price × amount) of all products
totalAmount = amount − discountAmount
payments    ≥ totalAmount

Example: 12500 × 2 + 22500 × 1 = 47500amount: 47500, with a 2500 discount → totalAmount: 45000, payments must add up to 45000.

Rules

psid and packageCode are required on every line. Without them the receipt is rejected.

Tobacco and alcohol cannot be sold for cash. If any payment is Cash, no product may have a psid starting with 02401, 02402, 02403 (tobacco) or 0220302208 (alcohol). Even one tiyin of cash blocks the receipt — use Card or Cashless.

Marked goods need codes. For products that require marking, labels must have one code per unit:

json
{ "name": "Cigarettes", "amount": 2, "labels": ["<code 1>", "<code 2>"] }

Timeout

Sale can take up to 6 minutes, because the device may be talking to the tax service. Set your client timeout to at least 400 seconds.

If it times out, do not send it again — the receipt may already be printed. Send PrintLastReceipt and check first.

ARCA Proxy API