Tenant Integration API · v1

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

  1. 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.
  2. Call GET /me to check the key and see your shop, currency and payment method codes.
  3. After every sale is completed in your system, send it with POST /orders.
  4. At the end of each day, compare GET /summary with your own totals.
Base addresshttps://<mall-system-address>/api/v1/tenant

All 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

FieldRequiredWhat it is
external_refYesThe 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_atNoWhen 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.
linesNo*The items sold. *Send either lines or total.
lines[].skuNoYour 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[].nameIf no known skuThe item's name as it should appear on reports.
lines[].qtyNoQuantity, above 0. Defaults to 1.
lines[].unit_priceYesPrice of one unit, including tax, before the line discount.
lines[].discount_percentNo0 to 100.
totalNo*The amount the customer owes, including tax. If you also send lines, it must equal their sum, within 0.01.
paymentsYesHow the customer paid. See Payments. You can leave it out only for an order totalling 0.
customerNoname, phone, email. The customer is matched by phone, then by email, or added if new.
currencyNoIf you send it, it must be your shop's currency (for example EGP).
noteNoUp 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:

methodRecorded as
cashCash your shop took in its own till
cardVisa or other card
instapayInstapay 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

PathWhat it does
GET/meYour shop, mall, currency, timezone and payment methods
GET/payment-methodsThe payment method codes you can send
POST/ordersRecord one order, or up to 100 in {"orders": [...]}
GET/ordersList the orders you sent (from, to, limit up to 200, offset)
GET/orders/{external_ref}One order, as recorded
POST/orders/{external_ref}/refundRefund the whole order
GET/summaryOne 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" } } }
StatuscodeMeaning
400invalid_json, invalid_bodyThe body is not valid JSON, or not an object
401unauthorizedThe key is missing, wrong or revoked
403tenant_inactiveYour shop is archived in the mall system
404not_foundThere is no order with that external_ref for your shop
409external_ref_conflictThe reference was already used for a different sale
409already_refunded, is_refund, external_ref_takenThe refund cannot be done as asked
409conflictAnother request changed the same data at the same time. Retry.
413too_largeThe body is over 2 MB
415unsupported_media_typeThe body was not sent as application/json
422invalid_fieldA field is missing or wrong. details.field says which one.
422total_mismatch, payment_short, overpaidThe amounts don't add up
422unknown_payment_methodThe method isn't set up for your shop. details.available lists the ones that are.
500server_errorOur error. Nothing was recorded, so retry later.

Limits