The Get Orders Statuses API now returns all possible order statuses.
The Get Orders Statuses API now returns all possible order statuses.
Renamed the "Create Order" API to "Order Creation".
Note : The functionality of the API remains unchanged.
| # | Workflow | Purpose | Endpoints (in order) | Notes |
|---|---|---|---|---|
| 1 | Authentication | Obtain a token that authorizes every other call. | Login | Run once per session. The token resets after a password change. Invoice APIs require a merchant token (not a merchant-user token). |
| 2 | Reference data (setup) | Fetch the lookup values needed to create an order: cities, regions and package sizes. | Cities → Regions (city_id) → Package Sizes | Regions depends on a city_id returned by Cities. These values change rarely and can be cached on the client side. |
| 3 | Order creation | Submit a new delivery order and receive its QR identifier and receipt link. | (Reference data) → Order Creation | Requires city_id, region_id and package_size from workflow 2. Returns qr_id (your main identifier) and qr_link (printable receipt). |
| 4 | Order modification | Update an order that is still in the merchant's possession. | Edit an Order | Only valid before the order has been picked up by a driver. Requires the qr_id from workflow 3. |
| 5 | Order tracking | List your orders, or look up specific ones, and interpret their status. | Retrieve Orders or Retrieve Specific Orders by IDs + Get Order Statuses | Get Order Statuses provides the mapping from status_id to human-readable status text. The batch endpoint accepts up to 25 IDs per call. |
| 6 | Finance / invoices | Review the invoices generated for your delivered orders, inspect their contents, and confirm receipt. | Get Merchant Invoices → Get Orders for an Invoice (invoice_id) → Receive an Invoice (invoice_id) | All Invoice endpoints require a merchant token; a merchant-user token will return an authentication error. |
┌─────────────┐
│ Login │ (1) Authentication
└──────┬──────┘
│ token
┌───────────────┼─────────────────────────────┐
▼ ▼ ▼
┌─────────────┐ ┌──────────────┐ ┌────────────────┐
│ Cities │ │ Package Sizes│ │ Get Merchant │
└──────┬──────┘ └──────┬───────┘ │ Invoices │ (6)
│ city_id │ └────────┬───────┘
▼ │ │ invoice_id
┌─────────────┐ │ ┌────────────────┐
│ Regions │ │ │ Get Invoice │
└──────┬──────┘ │ │ Orders │
│ │ └────────┬───────┘
└──────┬────────┘ │
▼ (2) Reference data ▼
┌─────────────┐ ┌────────────────┐
│Order Creation│ (3) │ Receive Invoice│
└──────┬──────┘ └────────────────┘
│ qr_id
┌──────┴──────────────┐
▼ ▼
┌─────────────┐ ┌──────────────────┐
│ Edit Order │ (4) │ Retrieve Orders │ (5)
└─────────────┘ │ / by IDs + │
│ Get Statuses │
└──────────────────┘
Submit your username and password to authenticate and receive an auth token for all subsequent API requests.
Log in with a merchant account to get a merchant token (required for financial APIs),
or with a merchant user account to get a merchant user token (not valid for financial APIs — use the merchant token instead).
Note: all API communication depends on this auth token.
POST
multipart/form-data
To authenticate a merchant and receive a token.
"username":"username"
"password":"password"
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": {
"token": "@@d71480ycdmp9....", the login token (string)
}
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
To create an order in our API, couple of parameters have to be specified (region-id, city-id, package-size).
Each of these values has its own API as shown below:
Several endpoints are used to get necessary data before creating an order :
Returns a list of cities by name and ID.
GET
N/A
Response : A list of cities in the format [{id: 1, city_name: 'name'}].
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"id": "1", the id of the city (string)
"city_name": "name" the text of the city (string)
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
Returns the list of regions by name and id for a given city-id.
GET
N/A
Parameter : city_id (int) [Required] : Specifies the city for which regions are retrieved.
Response : A list of regions within the specified city in the format [{id: 1, region_name: 'name'}].
"city_id":"ID"
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"id": "1", the id of the region (string)
"region_name": "name" the text of the region (string)
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
Returns a list of supported sizes by name and ID.
GET
N/A
Response : A list of available package sizes in the format [{id: 1 ,size: 'name'}].
{
"status": true,
"errNum": "S000", // On success "S000" will be returned "msg": "ok", // Success message
"data": [
{
"id": "1", the id of the package size (string)
"size": "name" the text of the package size (string)
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
After preparing all the order info (city-id, region-id, package-size, customer-phone, price, client-name, location description etc.) you can proceed and submit your order-creation info to the API.
POST
multipart/form-data
"token":"token"
"client_name":"name",
"client_mobile":"+9647000000000",
"client_mobile2":"+9647000000000",
"city_id":ID,
"region_id":ID,
"location":"text",
"type_name":"text",
"items_number":number,
"price":number,
"package_size":ID,
"merchant_notes":"text",
"replacement":0 or 1
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"client_name":"client name" (the name of the client),
"client_mobile":"+9647700000000" (client phone number),
"client_mobile2":"+9647700000000"(client second phone number),
"city_id":"5" (the city id of the client),
"region_id":"2" (the region id of the client),
"merchant_mobile":"07700000000" (set from merchant info),
"items_number":"1" (number of items in the order),
"price":"25000" (price of the order including delivery fee),
"package_size":"1" (the size of the order),
"cash_fee":0 (extra fee in IQD applied when total order price exceeds 1,000,000 IQD; otherwise 0)
"location":"market" (client delivery location description),
"merchant_id":"5" (set from merchant info),
"current_city":"1" (set automatically by the system),
"merchant_city":"1" (set from merchant info),
"company_price":4000 (the delivery fee of this order),
"city_fees":0 (set automatically by the system),
"merchant_price":21000 (the order price without delivery fee),
"type_name":"ملابس" (orders goods type),
"merchant_created_at":"2024-08-10 23:59:59" (set automatically by the system),
"merchant_notes":"عدم فتح القطعة" (set by the merchant),
"qr_id": 38799216 (the QR id of this order, this will be the main identifier of the order),
"pickup_id": "1" (the pickup driver assigned to this order),
"pickup_created_at": "2024-08-10 04:30:10" (set automatically by the system),
"id": ID (set automatically by the system),
"qr_link": "https://alwaseet-iq.net/merchant/print-single-tcpdf?id=ID&token=token" (the receipt PDF link)
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
In scenarios where the order info needs to be updated and the order is still at the merchant possession (status_id = 1), this endpoint provides the ability to do so:
POST
multipart/form-data
"token":"token"
"qr_id":"6942069",
"client_name":"name",
"client_mobile":"+9647000000000",
"client_mobile2":"+9647000000000",
"city_id":ID,
"region_id":ID,
"location":"text",
"type_name":"text",
"items_number":number,
"price":number,
"package_size":ID,
"merchant_notes":"text",
"replacement":0 or 1
{
"status": true,
"errNum": "S000",
"msg": "ok", // Success message
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
Now with your order being alive in our system. You might want to inquire about order details/status.
To do so, the APIs below have been provided (basically returns a list of order(s) with their status).
Alternatively you can retrieve orders by their ids using this API (Retrieve Specific Orders by IDs).
GET
N/A
A list of orders related to the merchant.
"token":"token"
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"client_name":"client name", (name of the client)
"client_mobile":"+9647700000000", (client mobile number)
"items_number":"1", (number of items in this order)
"created_at":"2023-08-13 22:12:18", (the date and time of when the order was created)
"city_name":"بغداد", (city name of client)
"region_name":"شارع فلسطین", (region name of the client)
"status_id":"2", (the status id of the order)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"location":"market", (the description of the client location)
"issue_notes":"لا یوجد", (a note written by the delivery driver when there is an issue with the order)
"merchant_notes":"لا یوجد", (a note written by the merchant)
"client_mobile2":"+9647700000000", (client second mobile number)
"updated_at":"2024-06-22 11:28:53", (the last date and time the order data was updated)
"city_id":"13", (client city number)
"region_id":"1043", (client region number)
"replacement":"0", (indicate if the order is a replacement or not, 1 for replacement 0 for not)
"type_name":"ملابس", (order goodes type)
"id":"103", (order id)
"has_merchant_fin_record": 0 OR 1, (indicates whether the merchant has requested accounting for the invoice this order is included in, 1 if the merchant has requsted accounting.)
"deliver_confirmed_fin":0 OR 1, (if 1 then the order has been delivered, and the company has received payment from the delivery driver. At this stage, the merchant is eligible to request accounting for this order.)
"delivery_price":"9000", (the delivery fee of this order)
"package_size":"عادي", (the order size)
"merchant_invoice_id":"-1" (the merchant invoice number, if the value is "-1" then this order is not included in a merchant invoice and the merchant can not request accounting for this order.)
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
This API provides a list of order statuses, each associated with a unique status ID and a descriptive status text.
GET
N/A
Response : A list of order statuses in the format [{id: 1, status: 'status text'}].
"token":"token"
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"id": "2",
"status": "تم الاستلام من قبل المندوب"
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
This endpoint allows you to retrieve specific orders by providing a comma-separated list of order IDs.
Unlike the "Retrieve Orders" endpoint, which returns all orders,
this batch retrieval is limited to a maximum of 25 order IDs per request.
POST
multipart/form-data
(string)
A comma-separated string of order IDs to retrieve. A maximum of 25 IDs is allowed—any additional IDs beyond this limit will be discarded.
Details of the selected orders.
"token":"token"
"ids":"11,23,75,29" (string of comma separated values, max 25 ids)
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"client_name":"client name", (name of the client)
"client_mobile":"+9647700000000", (client mobile number)
"items_number":"1", (number of items in this order)
"created_at":"2023-08-13 22:12:18", (the date and time of when the order was created)
"city_name":"بغداد", (city name of client)
"region_name":"شارع فلسطین", (region name of the client)
"status_id":"2", (the status id of the order)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"location":"market", (the description of the client location)
"issue_notes":"لا یوجد", (a note written by the delivery driver when there is an issue with the order)
"merchant_notes":"لا یوجد", (a note written by the merchant)
"client_mobile2":"+9647700000000", (client second mobile number)
"updated_at":"2024-06-22 11:28:53", (the last date and time the order data was updated)
"city_id":"13", (client city number)
"region_id":"1043", (client region number)
"replacement":"0", (indicate if the order is a replacement or not, 1 for replacement 0 for not)
"type_name":"ملابس", (order goodes type)
"id":"103", (order id)
"has_merchant_fin_record": 0 OR 1, (indicates whether the merchant has requested accounting for the invoice this order is included in, 1 if the merchant has requsted accounting.)
"deliver_confirmed_fin":0 OR 1, (if 1 then the order has been delivered, and the company has received payment from the delivery driver. At this stage, the merchant is eligible to request accounting for this order.)
"delivery_price":"9000", (the delivery fee of this order)
"package_size":"عادي", (the order size)
"merchant_invoice_id":"-1" (the merchant invoice number, if the value is "-1" then this order is not included in a merchant invoice and the merchant can not request accounting for this order.)
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
Several APIs are available for managing merchant invoices:
Authentication Requirements for Invoice APIs
To use the Invoice APIs, only the Merchant token is accepted for authentication. If a Merchant user token is used instead, an authentication error will be returned. Please ensure that the correct token is used to avoid authentication issues.
To inquire about invoices, you can use the get merchant invoices API and retrieve invoices. Then get invoice orders from the following APIs.
GET
N/A
Returns all invoices related to the merchant.
"token":"token"
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"id": "3", (invoice id)
"merchant_price": "170000", (total price to be received from this invoice)
"delivered_orders_count": "7", (number of delivered orders for this invoice)
"replacement_delivered_orders_count": "0", (number of replacement delivered orders)
"status": "تم الاستلام من قبل التاجر", (invoice status text)
"merchant_id": "5", (merchant id)
"updated_at": "2023-12-20 17:01:46" (last date and time the invoice was updated)
}
]
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
GET
N/A
Returns all orders associated with a particular invoice.
"token":"token"
"invoice_id":"ID"
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data":{
"invoice" : [
{
"id": "3", (invoice id)
"merchant_price": "170000", (total price to be received from this invoice)
"delivered_orders_count": "7", (number of delivered orders for this invoice)
"replacement_delivered_orders_count": "0", (number of replacement delivered orders)
"status": "تم الاستلام من قبل التاجر", (invoice status text)
"merchant_id": "5", (merchant id)
"updated_at": "2023-12-20 17:01:46" (last date and time the invoice was updated)
}
]
"orders" : [
{
"client_name":"محمد", (name of the client)
"client_mobile":"+9647704723599", (client mobile number)
"items_number":"1", (number of items in this order)
"created_at":"2023-08-13 22:12:18", (the date and time of when the order was created)
"city_name":"بغداد", (city name of client)
"region_name":"شارع فلسطین", (region name of the client)
"status_id":"2", (the status id of the order)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"location":"market", (the description of the client location)
"issue_notes":"لا یوجد", (a note written by the delivery driver when there is an issue with the order)
"merchant_notes":"لا یوجد", (a note written by the merchant)
"client_mobile2":"07", (client second mobile number)
"updated_at":"2024-06-22 11:28:53", (the last date and time the order data was updated)
"city_id":"13", (client city number)
"region_id":"1043", (client region number)
"replacement":"0", (indicate if the order is a replacement or not, 1 for replacement 0 for not)
"type_name":"ملابس", (order goodes type)
"id":"103", (order id)
"delivery_price":"9000", (the delivery fee of this order)
"package_size":"عادي", (the order size)
"merchant_invoice_id":"8" (the merchant invoice number)
}
]
}
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
When the invoice is sent to the merchant he has to confirm the receipt by scanning the invoice's QR-code via the merchant-app.
Alternatively, the invoice can be confirmed (received) by the API below.
GET
N/A
Marks the invoice as received.
"token":"token"
"invoice_id":"ID"
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
}
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}
In case of an error, the API will return a response with the following structure :
{
"status": false,
"errNum": "999", // Error code
"msg": "error message" // Error message
}
A successful response typically looks like this :
{
"status": true,
"errNum": "S000", // Success code
"msg": "ok", // Success message
"data": [ ... ] // Relevant data
}