Sale from an external system
The basic path is described in first sale.
Receipt discount
Section titled “Receipt discount”curl -X POST 'https://api-admin.billz.ai/v2/order-manual-discount/SALE_ID' \ -H 'Authorization: Bearer TOKEN' \ -H 'Content-Type: application/json' \ -H 'Billz-Response-Channel: HTTP' \ -d '{ "discount_unit": "PERCENTAGE", "discount_value": 10 }'discount_unit accepts PERCENTAGE or CURRENCY. The optional product_id field
applies the discount to a single line item; without it, the discount applies to the whole cart.
The current receipt after changing the contents or discounts is returned by the synchronous
POST /v1/recalculate-order-bill/:order_id.
Payment with several methods
Section titled “Payment with several methods”{ "payments": [ { "company_payment_type_id": "CASH_ID", "paid_amount": 100000 }, { "company_payment_type_id": "CARD_ID", "paid_amount": 900000 } ]}To redeem the customer’s bonus points, fill in the with_cashback field.
Gift cards
Section titled “Gift cards”- Find the card:
GET /v1/gift-card/search— synchronous - Add to the sale:
PUT /v1/order-gift-card/:id— asynchronous - Remove:
POST /v1/order-gift-card-remove/:id— asynchronous - Pay with the gift card:
POST /v2/order-payment/:order_id
Hold and resume
Section titled “Hold and resume”A held receipt is a way to reserve products in a sale.
- Hold:
POST /v2/order/create_postpone(asynchronous) — the body containsorder_id,timeand an optionalcomment; thetimefield is required and has a strict format (2024-07-16 06:47:30) - Resume:
POST /v2/order/return-postpone(asynchronous) - Change a line item quantity:
POST /v2/order-product/:order_id, thesold_measurement_valuefield; the value0removes the line item together with the manual discount assigned to it
Lists and details
Section titled “Lists and details”| Task | Method |
|---|---|
| Sales for a period | reports GET /v1/general-report-table and GET /v1/transaction-report-table — see sales export |
| Details of one sale | GET /v2/order/:id |
| List of drafts and held sales | GET /v2/order-notes |
Headers
Section titled “Headers”The methods that change the receipt contents, the customer and discounts are asynchronous. They require
Billz-Response-Channel: HTTP, otherwise only a correlation_id is returned.
The payment POST /v2/order-payment/:order_id and the recalculation POST /v1/recalculate-order-bill/:order_id
are synchronous — they do not need the header.