Send your sales to the mall system
If your shop runs its own POS or ERP, it can send each sale and the amounts it received straight to the mall system. Each order is recorded on your shop's External System register and counts in the mall's dashboards and daily sales, the same as sales rung up on a mall register.
Getting started
- Ask the mall administration for an API key for your shop. It starts with
qmp_and is shown to them only once, so store it as a secret in your system. - Call
GET /meto check the key and see your shop, currency and payment method codes. - After every sale is completed in your system, send it with
POST /orders. - At the end of each day, compare
GET /summarywith your own totals.
https://<mall-system-address>/api/v1/tenantAll requests and responses are JSON over HTTPS. Amounts are in your shop's currency, with up to two decimals.
Authentication
Send your key on every request, in the Authorization header:
Authorization: Bearer qmp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
A key belongs to a single shop. It can only send and read that shop's orders. If the key leaks, ask the mall to replace it; the old key stops working at once.
Sending an order
curl -X POST BASE/orders \
-H "Authorization: Bearer $QMP_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_ref": "INV-100231",
"ordered_at": "2026-12-03T14:05:00+02:00",
"lines": [
{ "sku": "UB22-42", "name": "Ultraboost 22", "qty": 1, "unit_price": 4200 },
{ "name": "Sport socks", "qty": 2, "unit_price": 150, "discount_percent": 10 }
],
"total": 4470,
"payments": [
{ "method": "card", "amount": 4000 },
{ "method": "cash", "amount": 500 }
],
"customer": { "name": "Mona Adel", "phone": "+201000000000" }
}'
The answer is 201 Created with the order as recorded. Here the customer paid 500 in cash for 470,
so change_given is 30 and only 470 is recorded as cash:
{
"id": 18866,
"external_ref": "INV-100231",
"number": "Adidas Porto Marina · External System - 000001",
"receipt_ref": "260-75-000001",
"status": "paid",
"ordered_at": "2026-12-03T12:05:00Z",
"currency": "EGP",
"total": 4470.0,
"paid": 4470.0,
"change_given": 30.0,
"payments": [ { "method": "card", "name": "Visa", "amount": 4000.0 },
{ "method": "cash", "name": "Cash (tenant system)", "amount": 470.0 } ],
"lines": [ ... ],
"duplicate": false
}
If you only have totals, leave out lines and send total, plus an optional description:
{ "external_ref": "Z-2026-12-03-17", "total": 300, "payments": [ { "method": "instapay", "amount": 300 } ] }
Order fields
| Field | Required | What it is |
|---|---|---|
external_ref | Yes | The order's reference in your system, unique per shop. Up to 64 letters, digits and . _ : -. It is how duplicates are spotted, so never reuse it for a different sale. |
ordered_at | No | When the sale happened, in ISO 8601. Send it with an offset (+02:00 or Z). If you leave out the offset, the time is read in your key's timezone. If you leave out the field, the time the order is received is used. It cannot be in the future or more than a year ago. |
lines | No* | The items sold. *Send either lines or total. |
lines[].sku | No | Your product code or barcode. If the mall system has a product with the same internal reference or barcode, the line is linked to that product. |
lines[].name | If no known sku | The item's name as it should appear on reports. |
lines[].qty | No | Quantity, above 0. Defaults to 1. |
lines[].unit_price | Yes | Price of one unit, including tax, before the line discount. |
lines[].discount_percent | No | 0 to 100. |
total | No* | The amount the customer owes, including tax. If you also send lines, it must equal their sum, within 0.01. |
payments | Yes | How the customer paid. See Payments. You can leave it out only for an order totalling 0. |
customer | No | name, phone, email. The customer is matched by phone, then by email, or added if new. |
currency | No | If you send it, it must be your shop's currency (for example EGP). |
note | No | Up to 1,000 characters, kept as an internal note on the order. |
Amounts are recorded exactly as you send them, including tax. The mall system does not recalculate prices or taxes on orders from your system.
Payments
Each payment has a method and an amount above 0. GET /payment-methods lists the
methods your shop can use. These are the usual ones:
| method | Recorded as |
|---|---|
cash | Cash your shop took in its own till |
card | Visa or other card |
instapay | Instapay transfer |
You can also send the method's exact name, as listed. The payments must add up to at least the total. Only cash can be overpaid: the difference is treated as change given back to the customer.
Sending many orders
To catch up after being offline, wrap up to 100 orders in {"orders": [ ... ]} and send them to the same
POST /orders. Each order is checked and saved on its own, so one bad order does not block the rest.
The answer is always 200, with a result for each order:
{
"summary": { "created": 98, "duplicate": 1, "error": 1 },
"results": [
{ "index": 0, "external_ref": "INV-100232", "result": "created", "order": { ... } },
{ "index": 1, "external_ref": "INV-100233", "result": "error",
"error": { "code": "payment_short", "message": "Payments add up to 150.00 but the order total is 200.00." } }
]
}
Refunds
To refund a whole order, call POST /orders/{external_ref}/refund. You can send an empty body, or any of these fields:
{ "external_ref": "RET-5512", "reason": "Wrong size", "refunded_at": "2026-12-04T11:00:00+02:00",
"payments": [ { "method": "cash", "amount": 4470 } ] }
If you leave out payments, the money is returned the same way it was paid. If you leave out
external_ref, the refund is given the original reference plus -R. An order can be refunded once.
The refund is recorded as a separate order with a negative total. Partial refunds are not supported yet.
Retries and duplicates
If a call times out, send the same order again with the same external_ref. If it was already recorded, you get
200 and "duplicate": true back, and nothing is recorded twice. If the reference was already used for a
different total, you get 409 external_ref_conflict. For 409 conflict, 500 or a network error, wait a few seconds and retry.
For any 4xx other than 409, fix the order before sending it again.
Reconciliation
GET /summary?date=2026-12-03 gives one day's totals in your key's timezone. Leave out date to get today's:
{ "date": "2026-12-03", "currency": "EGP", "orders": 212, "refunds": 3,
"sales_total": 184250.0, "refunds_total": -6120.0, "net_total": 178130.0,
"by_payment_method": { "card": 120400.0, "cash": 51230.0, "instapay": 6500.0 } }
To list what was recorded, call GET /orders?from=2026-12-03&to=2026-12-03&limit=200&offset=0. Newest orders come first.
from and to take a date or a date and time, and count gives the total number of matches.
All endpoints
| Path | What it does | |
|---|---|---|
| GET | /me | Your shop, mall, currency, timezone and payment methods |
| GET | /payment-methods | The payment method codes you can send |
| POST | /orders | Record one order, or up to 100 in {"orders": [...]} |
| GET | /orders | List the orders you sent (from, to, limit up to 200, offset) |
| GET | /orders/{external_ref} | One order, as recorded |
| POST | /orders/{external_ref}/refund | Refund the whole order |
| GET | /summary | One day's totals, for reconciliation |
Errors
Errors come back with an HTTP status and a body like this:
{ "error": { "code": "invalid_field", "message": "lines[0].unit_price is required.", "details": { "field": "lines[0].unit_price" } } }
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_json, invalid_body | The body is not valid JSON, or not an object |
| 401 | unauthorized | The key is missing, wrong or revoked |
| 403 | tenant_inactive | Your shop is archived in the mall system |
| 404 | not_found | There is no order with that external_ref for your shop |
| 409 | external_ref_conflict | The reference was already used for a different sale |
| 409 | already_refunded, is_refund, external_ref_taken | The refund cannot be done as asked |
| 409 | conflict | Another request changed the same data at the same time. Retry. |
| 413 | too_large | The body is over 2 MB |
| 415 | unsupported_media_type | The body was not sent as application/json |
| 422 | invalid_field | A field is missing or wrong. details.field says which one. |
| 422 | total_mismatch, payment_short, overpaid | The amounts don't add up |
| 422 | unknown_payment_method | The method isn't set up for your shop. details.available lists the ones that are. |
| 500 | server_error | Our error. Nothing was recorded, so retry later. |
Limits
- Up to 100 orders per call, 500 lines per order, 20 payments per order and 2 MB per request.
- Orders can be up to a year old, so you can load past sales.
- Every call is logged for the mall administration, with its reference, status and any error, so problems can be traced on both sides.