API

اربط متجرك بالتوصيل مباشرة

وحدة تحكم تفاعلية لواجهة التجار البرمجية: اختر النقطة، املأ البيانات، وخذ كوداً جاهزاً بأربع لغات، وشاهد الاستجابة الموثّقة فوراً.

  • 29نقطة نهاية
  • 1Webhook
  • 200/30sحد الطلبات لكل مستخدم
  • V1.11.4آخر إصدار 2026/9/19

وحدة التحكم

كل نقاط الـAPI في مكان واحد

واجهات التاجر

01Merchant APIs

Login Endpoint

POSThttps://agg-iq.net/operation/v1/merchant/login

Content-Typemultipart/form-data

Purpose: To authenticate a merchant and receive a token.

username and password are submitted to the endpoint, merchant token is returned.
Note: all the API communication depends on the auth-token.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
usernamestringbodyمطلوبThe merchant's username.
passwordstringbodyمطلوبThe merchant's password.

الاستجابة

  • On success: Returns a token to be used for future API calls.
  • On failure: Provides an error code and message.
  • Login token resets after password change
  • Login with merchant account to get merchant token, or with merchant user account to get merchant user token.
  • Invoice APIs strictly require Merchant token and will return authentication error if merchant user token is used.

أمثلة الطلب (من التوثيق)

Query Parameters: No parameters

Request Body
"username":"username"
"Password":"password"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": {
"token": "@@d71480ycdmp9....", the login token (string)
}
}
Response body on failure
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

02Supplementary data for order creation

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:

02aSupplementary data for order creation

Cities

GEThttps://agg-iq.net/operation/v1/merchant/cities

الاستجابة

A list of cities in the format [{id: 1, city_name: 'name'}].

أمثلة الطلب (من التوثيق)

Query Parameters: No parameters

Request Body: No body

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"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)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

02bSupplementary data for order creation

Regions

GEThttps://agg-iq.net/operation/v1/merchant/regions?city_id=ID

المعاملات

الاسمالنوعالموضعالإلزامالوصف
city_idintqueryمطلوبSpecifies the city for which regions are retrieved.

الاستجابة

A list of regions within the specified city in the format [{id: 1, region_name: 'name'}].

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"city_id":"ID"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"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)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

02cSupplementary data for order creation

Package Sizes

GEThttps://agg-iq.net/operation/v1/merchant/package-sizes

الاستجابة

A list of available package sizes in the format [{id: 1,size: 'name'}].

أمثلة الطلب (من التوثيق)

Query Parameters: No parameters

Request Body: No body

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"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)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

03Merchant APIs

Create an Order

POSThttps://agg-iq.net/operation/v1/merchant/create-order?token=loginToken

Content-Typemultipart/form-data

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.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
client_namestringbodyمطلوبName of the client.
client_mobilestringbodyمطلوبThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
client_mobile2stringbodyاختياريThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
city_idintbodyمطلوبID of the client’s city (from the Cities API).
region_idintbodyمطلوبID of the client’s region (from the Regions API).
locationstringbodyمطلوبDescription of the client’s location.
type_namestringbodyمطلوبDescription of the type of goods in the order.
items_numberintbodyمطلوبNumber of items in the order.
priceintbodyمطلوبTotal price of the order, including delivery.
package_sizeintbodyمطلوبThe size of the order package (from the Package Sizes API).
merchant_notesstringbodyاختياريA general note or instruction about the order.
replacement0 or 1bodyمطلوبSpecifies if the order is a replacement.
company_order_idstringbodyاختياري*The order ID from the external company's system. This parameter allows you to track which order ID in our system corresponds to the order ID in your system.

* Note: This parameter is [Required] if a Company Order ID prefix is activated for the company. The provided Order ID must begin with the registered prefix and must include the full prefix as defined.
If you don't have a registered prefix and would like to add your own, please check this section.

tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

  • On success: A success message and the order data.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"token"
Request Body
"client_name":"name",
"client_mobile":"+964700000000",
"client_mobile2":"+964700000000",
"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,
"company_order_id":"123"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"client_name":"محمد" (the name of the client),
"client_mobile":"+9647704723599" (client phone number),
"client_mobile2":"+9647704723599"(client second phone number),
"city_id":"5" (the city id of the client),
"region_id":"2" (the region id of the client),
"merchant_mobile":"07704723599" (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 (set if order price exceeds 1'000'000 IQD),
"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 16:30:10" (set automatically by the system),
"merchant_notes":"عدم فتح القطعة" (set by the merchant),
"qr_id": 38799216 (the QR id of this order, thi will be the main identifier of the order),
"pickup_id": "1" (the pickup drier assigned to this order),
"pickup_created_at": "2024-08-10 04:30:10pm" (set automatically by the system),
"id": 38799216 (set automatically by the system),
"company_order_id":"123", (The order ID from the company's system.),
"qr_link": "https://agg-iq.net/operation/merchant/print-single-tcpdf?id=orderQr&token=merchantToken" (the receipt PDF link)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

04Merchant APIs

Edit an Order

POSThttps://agg-iq.net/operation/v1/merchant/edit-order?token=loginToken

Content-Typemultipart/form-data

In scenarios where the order info needs to be updated and the order is still at the merchant possession, this endpoint provides the ability to do so:

المعاملات

الاسمالنوعالموضعالإلزامالوصف
qr_idstringbodyمطلوبOrder number
client_namestringbodyمطلوبName of the client.
client_mobilestringbodyمطلوبThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
client_mobile2stringbodyاختياريThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
city_idintbodyمطلوبID of the client’s city (from the Cities API).
region_idintbodyمطلوبID of the client’s region (from the Regions API).
locationstringbodyمطلوبDescription of the client’s location.
type_namestringbodyمطلوبDescription of the type of goods in the order.
items_numberintbodyمطلوبNumber of items in the order.
priceintbodyمطلوبTotal price of the order, including delivery.
package_sizeintbodyمطلوبThe size of the order package (from the Package Sizes API).
merchant_notesstringbodyاختياريA general note or instruction about the order.
replacement0 or 1bodyمطلوبSpecifies if the order is a replacement.
company_order_idstringbodyاختياري*The order ID from the external company's system. This parameter allows you to track which order ID in our system corresponds to the order ID in your system.

* Note: This parameter is [Required] if a Company Order ID prefix is activated for the company. The provided Order ID must begin with the registered prefix and must include the full prefix as defined.
If you don't have a registered prefix and would like to add your own, please check this section.

tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

  • On success: A success message.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"token"
Request Body
"qr_id":"6942069",
"client_name":"name",
"client_mobile":"+964700000000",
"client_mobile2":"+964700000000",
"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,
"company_order_id":"123"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "",
"msg": "ok", // Success message
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

05Merchant APIs

Delete an Order

POSThttps://agg-iq.net/operation/v1/merchant/delete-orders?token=loginToken

Content-Typemultipart/form-data

In scenarios where the order needs to be deleted and the order is still in the merchant's possession, this endpoint provides the ability to do so.
Note: Order status must be equal to 1 (new order) to be deleted.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
qr_idstringbodyمطلوبOrder number
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

  • On success: A success message.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"token"
Request Body
"qr_id":"6942069"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "",
"msg": "ok", // Success message
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

06Merchant APIs

Retrieve Orders

GEThttps://agg-iq.net/operation/v1/merchant/merchant-orders?token=loginToken

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). Use Retrieve Active Orders for a lighter list that excludes old completed or returned orders.

Alternatively you can retrieve orders by their ids using this API.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

A list of orders related to the merchant.

أمثلة الطلب (من التوثيق)

Request Body: no body

Query Parameters
"token":"token"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"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)
"send_to_store": (0 OR 1 OR 2),
This flag is relevant when status_id = 23 (Returning to Returned Warehouse). It indicates the current stage of the return process:
0 – The order is still in the city warehouse.
1 – The order is in transit to the Baghdad warehouse.
2 – The order has been received at the Baghdad warehouse.
This flag is primarily used in the Resolve Returned Order API.
"deliver_done":(0 OR 1), (if 1 then the order has been delivered)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"old_price":"18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"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)
"company_order_id": "123", (The order ID from the company's system.),
"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.)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

07Merchant APIs

Retrieve Active Orders

GEThttps://agg-iq.net/operation/v1/merchant/current-active-merchant-orders?token=loginToken

Returns the merchant's currently relevant orders. Unlike merchant-orders in Retrieve Orders, which returns the full order history, this endpoint excludes stale final-state orders — delivered orders and orders returned to the merchant — that have not been updated in the last month.

All in-progress orders are always included, and recently completed or returned orders (updated within the last month) are also included.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

A filtered list of the merchant's active and recently updated orders.

أمثلة الطلب (من التوثيق)

Request Body: no body

Query Parameters
"token":"token"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"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)
"send_to_store": (0 OR 1 OR 2),
"deliver_done":(0 OR 1), (if 1 then the order has been delivered)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"old_price":"18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"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)
"company_order_id": "123", (The order ID from the company's system.),
"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.)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

08Merchant APIs

Get Order Statuses

GEThttps://agg-iq.net/operation/v1/merchant/statuses?token=loginToken

This API provides a list of order statuses, each associated with a unique status ID and a descriptive status text.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

A list of order statuses in the format [{id: 1, status: 'status text'}].

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"token"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"id": "1",
"تم الاستلام من قبل المندوب" :"status"
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

09Merchant APIs

Retrieve Specific Orders by IDs (batch)

POSThttps://agg-iq.net/operation/v1/merchant/get-orders-by-ids-bulk?token=loginToken

Content-Typemultipart/form-data

Retrieve Specific Orders by IDs (batch)
Unlike the "Retrieve Orders" endpoint with returned all the orders, this endpoint allows you to inquire about a specific id(s) by specifying them into a comma-separated string of order IDs to retrieved.
The maximum number of ids to be retrieved is 25.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
idsstringbodyمطلوب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.
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

Details of the selected orders.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"token"
Request Body
"ids":"11,23,75,29" (string of comma separated values, max 25 ids)

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"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)
"send_to_store": (0 OR 1 OR 2),
This flag is relevant when status_id = 23 (Returning to Returned Warehouse). It indicates the current stage of the return process:
0 – The order is still in the city warehouse.
1 – The order is in transit to the Baghdad warehouse.
2 – The order has been received at the Baghdad warehouse.
This flag is primarily used in the Resolve Returned Order API.
"deliver_done":(0 OR 1), (if 1 then the order has been delivered)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"old_price":"18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"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)
"company_order_id": "123", (The order ID from the company's system.),
"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.)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

10Merchant APIs

Retrieve Order Story

GEThttps://agg-iq.net/operation/v1/merchant/order-story?token=loginToken&qr_id=103

Returns the chronological snapshots of a single merchant order from the order log. Each item in the list is a saved copy of the order at a given point in time (oldest first).

Unlike Retrieve Orders, which returns the current state of many orders, this endpoint is for one order identified by qr_id. Archived orders are included. If the order has no log entries, an empty list is returned.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبThe merchant login token.
qr_idnumberqueryمطلوبThe order ID to retrieve the story for. The order must belong to the authenticated merchant.

الاستجابة

A chronological list of order-log snapshots for the requested order.

أمثلة الطلب (من التوثيق)

Request Body: no body

Query Parameters
"token":"token"
"qr_id":"103"

أمثلة الاستجابة (من التوثيق)

  • Same order fields as Retrieve Orders. updated_at is the time of that snapshot, not the current order update time.
Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "تم", // Success message
"data": [
{
"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 at this snapshot)
"send_to_store": (0 OR 1 OR 2),
"deliver_done":(0 OR 1), (if 1 then the order has been delivered)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order at this snapshot)
"price":"20000", (the order price including delivery fee)
"old_price":"18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"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 date and time of this snapshot)
"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)
"company_order_id": "123", (The order ID from the company's system.),
"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.)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

11Merchant APIs

Get Orders With Issues

GEThttps://agg-iq.net/operation/v1/merchant/orders-with-issue?token=merchant-token

In some cases, orders may encounter issues during delivery. These orders are handled by our team, but you can retrieve a list of them using this API. If you prefer to resolve the issues yourself, you can use the Resolve Order API.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

Returns all orders that have a reported issue.

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"merchant-token"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"client_name": "cutomer name",
"client_mobile": "+9647700000000",
"items_number": "2",
"created_at": "2025-12-30 23:59:59",
"city_name": "بغداد",
"region_name": "شارع فلسطين",
"status": "مغلق",
"package_size": "متوسط",
"status_id": "35",
"price": "15000",
"old_price": "18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"location": "location discription",
"issue_notes": "لا يوجد",
"deliver_done": "0",
"merchant_notes": "merhcant note",
"client_mobile2": "+9647700000000",
"updated_at": "2025-12-30 23:59:59",
"city_id": "1",
"region_id": "1",
"replacement": "1",
"type_name": "ملابس",
"id": "102",
"company_order_id": "AGG_12345",
"has_merchant_fin_record": "0",
"deliver_confirmed_fin": "0",
"delivery_price": "6750",
"merchant_invoice_id": "-1"
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

12Merchant APIs

Resolve Order

GEThttps://agg-iq.net/operation/v1/merchant/resolve-order?token=merchant-token&order-id=123&client-mobile=+9647700000000&note=merchant-note

Your merchants can now resolve order issues using the following API.
This API allows them to provide an order ID and the new customer phone number, and it will reset the order status to 'On its way to the client'.

Note: The issue can only be resolved once the order is with the delivery driver. If the order is returned to the warehouse, it cannot be resolved.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.
order-id-queryغير محددمن مثال الرابط
client-mobile-queryغير محددمن مثال الرابط
note-queryغير محددمن مثال الرابط

الاستجابة

  • On success: A success message.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"merchant-login-token"
"order-id":123
"client-mobile":"+9647700000000"
"note":"merchant-note"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

13Merchant APIs

Request returned orders

POSThttps://agg-iq.net/operation/v1/merchant/request-returned-orders?token=merchant-token

Content-Typemultipart/form-data

المعاملات

الاسمالنوعالموضعالإلزامالوصف
idsstringbodyمطلوبA comma-separated list of order IDs. A maximum of 25 IDs is allowed. If more than 25 are provided, an error will be returned.
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

A JSON object containing the IDs of successfully retrieved orders and those that failed.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"token"
Request Body
"ids":"11,33,55,77" (string of comma separated values, max 25 ids)

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": {
"succeededOrders": [
"11,55"
],
"filedOrders": [
"33,77"
],
}
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

14Merchant APIs

Resend Order

POSThttps://agg-iq.net/operation/v1/merchant/resend-order-to-client?token=merchant-token

Content-Typemultipart/form-data

Instead of returning the order to the original merchant, you can use this API to resend the order to a new or the same client. This endpoint functions similarly to the Edit Order API, with the key difference being that it only supports orders currently in specific statuses. Allowed Status IDs:

  • 12 – In province warehouse
  • 13 – In Baghdad warehouse
  • 15 – Returned to merchant
  • 44 – Sent to sorting center for resending

Ensure the order is in one of the above statuses before attempting to use this API.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
qr_idstringbodyمطلوبOrder number
client_namestringbodyمطلوبName of the client.
client_mobilestringbodyمطلوبThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
client_mobile2stringbodyاختياريThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
city_idintbodyمطلوبID of the client’s city (from the Cities API).
region_idintbodyمطلوبID of the client’s region (from the Regions API).
locationstringbodyمطلوبDescription of the client’s location.
type_namestringbodyمطلوبDescription of the type of goods in the order.
items_numberintbodyمطلوبNumber of items in the order.
priceintbodyمطلوبTotal price of the order, including delivery.
package_sizeintbodyمطلوبThe size of the order package (from the Package Sizes API).
merchant_notesstringbodyاختياريA general note or instruction about the order.
replacement0 or 1bodyمطلوبSpecifies if the order is a replacement.
company_order_idstringbodyاختياري*The order ID from the external company's system. This parameter allows you to track which order ID in our system corresponds to the order ID in your system.

* Note: This parameter is [Required] if a Company Order ID prefix is activated for the company. The provided Order ID must begin with the registered prefix and must include the full prefix as defined.
If you don't have a registered prefix and would like to add your own, please check this section.

tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

  • On success: A success message.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"merchant-token"
Request Body
"qr_id":"6942069",
"client_name":"name",
"client_mobile":"+964700000000",
"client_mobile2":"+964700000000",
"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,
"company_order_id":"123"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "",
"msg": "ok", // Success message
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

15Manage Invoices

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.

OR receive an invoice using the following APIs.

OR create new invoice using the following APIs.

15aManage Invoices

Get Merchant Invoices

GEThttps://agg-iq.net/operation/v1/merchant/get-merchant-invoices?token=loginToken

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

Returns all invoices related to the merchant.

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"token"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"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)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

15bManage Invoices

Create Merchant Invoices

POSThttps://agg-iq.net/operation/v1/merchant/request-new-invoice?token=loginToken

Content-Typemultipart/form-data

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.
accounting_by_rep-bodyغير محددمن مثال الطلب

الاستجابة

Creates a new invoice for the merchant with the cuutently deliverd orders.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"token"
Request Body
"accounting_by_rep": 0 OR 1 // send merchant invoice by pickup driver (1) or receive the merchant invoice in person (0)

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

15cManage Invoices

Get Orders for an Invoice

GEThttps://agg-iq.net/operation/v1/merchant/get-merchant-invoice-orders?token=loginToken&invoice_id=invoiceID

المعاملات

الاسمالنوعالموضعالإلزامالوصف
invoice_idstringqueryغير محددThe ID of the invoice.
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

Returns all orders associated with a particular invoice.

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"token"
"invoice_id":"ID"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"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)
"old_price":"18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"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)
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

15dManage Invoices

Receive an Invoice

GEThttps://agg-iq.net/operation/v1/merchant/receive-merchant-invoice?token=loginToken&invoice_id=invoiceID
  • 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.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
invoice_idstringqueryغير محددThe ID of the invoice.
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

Marks the invoice as received.

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"token"
"invoice_id":"ID"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

16Merchant APIs

Resolve Returned Order

POSThttps://agg-iq.net/operation/v1/merchant/resolve-order-in-return-store?token=Merchant-Token

Content-Typemultipart/form-data

This API allows the merchant to resend a returning order with a new customer phone number. The order status must be Send to Returns Warehouse (status ID = 23) AND the send_to_store = 0 to be eligible for resending. Only the customer phone number can be changed — the destination address must remain the same.

Note: For more information on the send_to_store value, refer to the Response Sample section in the Retrieve Specific Orders by IDs (Batch) or Retrieve Orders APIs, or the Request Samples section in the Order Status Update Webhook.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.
qr_id-bodyغير محددمن مثال الطلب
client_mobile-bodyغير محددمن مثال الطلب
client_mobile2-bodyغير محددمن مثال الطلب

الاستجابة

  • On success: A success message.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters: No parameters

Request Body
"qr_id":123
"client_mobile":"+9647700000000"
"client_mobile2":"+9647700000000"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

17Merchant APIs

Response Handling

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
}

واجهات الشركات (Aggre)

While the previous endpoints were designed to handle the orders on the merchant level, this set of API endpoints is designed to provided merchant(s) management i.e., to enable the aggregator to handle his merchant(s).

01Aggre APIs

Login Endpoint

POSThttps://agg-iq.net/operation/v1/aggre/login

Content-Typemultipart/form-data

Purpose: To authenticate the comapny account and receive a token.

All aggre APIs requier an authentication token to be included in the request parameters,
username and password are submitted to the endpoint, aggregator token is returned.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
usernamestringbodyمطلوبThe company's account username.
passwordstringbodyمطلوبThe company's account password.

الاستجابة

  • On success: Returns a token to be used for future API calls.
  • On failure: Provides an error code and message.
  • Login token expires after 15 days.
  • Login credentials for the company are the same for the company dashboard (https://agg-iq.net/operation/city_office).

أمثلة الطلب (من التوثيق)

Query Parameters: No parameters

Request Body
"username":"username"
"Password":"password"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": {
"token": "aggre-token", // the login token (string)
"user-data": { // company information
"name": "company name",
"username": "company username",
"mobile": "company mobile"
}
}
}
Response body on failure
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

02Aggre APIs

Get Merchants

GEThttps://agg-iq.net/operation/v1/aggre/get-merchants?token=aggreLoginToken

With this API you can get all merchant(s) that belongs to your company.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

Returns all merchants

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"token"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "ok", // Success message
"data": [
{
"id": "123",
"username": "merchant username",
"token": "merchant token",
"mobile": "merchant mobile",
"name": "merchant name",
"city_id": "merchant city id"
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

03Aggre APIs

Add Merchant

POSThttps://agg-iq.net/operation/v1/aggre/add-merchant?token=aggreLoginToken

Content-Typemultipart/form-data

In situations where you need to add a new merchant to our system, you can use this API.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
namestringbodyمطلوبName of the merchant.
page_namestringbodyمطلوبName of the merchant business.
usernamestringbodyمطلوبUsername of the merchant.
passwordstringbodyمطلوبPassword of the merchant.
mobilestringbodyمطلوبMobile number of the merchant. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
mobile2stringbodyاختياريSecond mobile number of the merchant. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
cityintbodyمطلوبID of the Merchant’s city (from the Cities API).
regionintbodyمطلوبID of the Merchant’s region (from the Regions API).
locationstringbodyمطلوبDescription of the merchant’s location.
goods_typestringbodyمطلوبType of goods of the merchant.
birthdaystringbodyاختياريMerchant date of birth.
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

  • On success: A success message and created merchant token.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"aggre-token"
Request Body
"name":"Merchant"
"username":"merchant244"
"password":"12345678"
"mobile":"+96477xxxxxxxx"
"city":"1"
"region":"1"
"location":"قرب زيونة"
"goods_type":"ملابس"
"page_name":"Merchant Businees"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "Done Successfully.", // Success message
"data": {
"merchant_id": 123 // the created merchant ID (int)
"token": "merchantToken" // the created merchant token (string)
}
}
Response body on error
{
"status": false,
"errNum": 1, // Error code
"msg": "error message" // Error message
}

04Aggre APIs

Create Multiple Orders

POSThttps://agg-iq.net/operation/v1/aggre/create-bulk-orders?token=aggreLoginToken

Content-Typemultipart/form-data

In certain situations, you may need to quickly create multiple orders for different merchants.
With this API, you can send a JSON array string containing the orders data, and you'll receive a response that provides success and error messages for each individual order.

You will need the data from the Supplementary Data for Order Creation API(s) to create the orders.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
datastringbodyمطلوبPlease provide a JSON string with the order data. Note that each request can include a maximum of 30 orders, so make sure not to exceed this limit.
With the current limits, you can create up to 900 orders every 30 seconds — this is based on a rate limit of 30 requests per 30 seconds, with each request allowing up to 30 orders.
The order data should contain the following keys and values.
data[].client_namestringdata[ ]مطلوبName of the client.
data[].client_mobilestringdata[ ]مطلوبThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
data[].client_mobile2stringdata[ ]مطلوبThe client’s mobile number. Must be in this format “+9647000000000“, iraq country code followed by 10 numbers
data[].city_idintdata[ ]مطلوبID of the client’s city (from the Cities API).
data[].region_idintdata[ ]مطلوبID of the client’s region (from the Regions API).
data[].locationstringdata[ ]مطلوبDescription of the client’s location.
data[].type_namestringdata[ ]مطلوبDescription of the type of goods in the order.
data[].items_numberintdata[ ]مطلوبNumber of items in the order.
data[].priceintdata[ ]مطلوبTotal price of the order, including delivery.
data[].package_sizeintdata[ ]مطلوبThe size of the order package (from the Package Sizes API).
data[].merchant_notesstringdata[ ]مطلوبA general note or instruction about the order.
data[].replacement0 or 1data[ ]مطلوبSpecifies if the order is a replacement.
data[].merchant_idintdata[ ]مطلوبMerchant ID associated with this order.
data[].company_order_idstringdata[ ]اختياري*The order ID from the external company's system. This parameter allows you to track which order ID in our system corresponds to the order ID in your system.

* Note: This parameter is [Required] if a Company Order ID prefix is activated for the company. The provided Order ID must begin with the registered prefix and must include the full prefix as defined.
If you don't have a registered prefix and would like to add your own, please check this section.

data[].metadatastringdata[ ]اختياريThe metadata includes any information that helps you identify the order more easily.
It is not part of the order creation data, but it will be returned in the response as the same string.
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

  • On success: There will be two arrays: one containing all the successfully created orders and the other with the failed orders.
    Each failed order will include a "failed" variable that holds the error message explaining the failure.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"aggre-token"
Request Body
"data":"[ // JSON array
{
"client_name":"name",
"client_mobile":"+964700000000",
"client_mobile2":"+964700000000",
"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,
"merchant_id":ID,
"company_order_id":ID,
"metadata":"text",
}
]"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000", // On success "S000" will be returned
"msg": "Done Successfully.", // Success message
"data": {
"succeed": [], // an array with all the successfuly created orders
"failed": [] // an array with all the filed orders with an error message for each order
}
}
Response body on error
{
"status": false,
"errNum": 1, // Error code
"msg": "error message" // Error message
}

06Aggre APIs

Get Printed Orders

GEThttps://agg-iq.net/operation/v1/aggre/get-printed-orders?token=aggreLoginToken

If you need to retrieve previously created PDF files, you can do so using this API.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.

الاستجابة

A list of printed orders files

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"aggre-token"

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000",
"msg": "Done Successfully.",
"data": [
{
"fileName": "file name",
"filePath": "file path link",
"fileType": "file",
"fileSize": "file size"
},
{
"fileName": "file name",
"filePath": "file path link",
"fileType": "file",
"fileSize": "file size"
}
]
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

07Aggre APIs

Check Order Exists

GEThttps://agg-iq.net/operation/v1/aggre/check-order-exists-by-company-order-number?token=aggreLoginToken&company-order-id=1

To verify if an order is already created with the same company system order number.

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.
company-order-id-queryغير محددمن مثال الرابط

الاستجابة

  • An array contains the order(s) you are searching for in case order(s) exists.
  • An empty array in case no orders found with the provided company system order number.

أمثلة الطلب (من التوثيق)

Request Body: No body

Query Parameters
"token":"aggre-token",
"company-order-id":"1" // company system order number

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000",
"msg": "Done Successfully.",
"data": {
"order": "[{orderData}]" OR "[]"
}
}

08Aggre APIs

Receive Merchant Returned Order

POSThttps://agg-iq.net/operation/v1/aggre/receive-returned-order?token=aggreLoginToken

Content-Typemultipart/form-data

To receive a merchant's returned order, you can use this API to update the order status to "Returned To Merchant".

المعاملات

الاسمالنوعالموضعالإلزامالوصف
tokenstringqueryمطلوبمن مثال الرابطتوكن تسجيل الدخول.
merchant-token-bodyغير محددمن مثال الطلب
order-id-bodyغير محددمن مثال الطلب

الاستجابة

  • On success: A success message.
  • On failure: An error message.

أمثلة الطلب (من التوثيق)

Query Parameters
"token":"aggre-token"
Request Body
"merchant-token":"merchant-token",
"order-id":123

أمثلة الاستجابة (من التوثيق)

Response body on success
{
"status": true,
"errNum": "S000",
"msg": "Done Successfully.",
}
Response body on error
{
"status": false,
"errNum": "999", // Error code
"msg": "error message", // Error message
}

Webhooks

01Webhooks

Order Status Update

POSTThe order status update information will be sent to the API endpoint that you provided.

Content-Typeapplication/json

Purpose: To automatically send updates about order status changes to your system.

This web Hook sends updates regarding order status changes to the API endpoint you provide. The updates are triggered whenever an order transitions through different stages.

You'll need to provide the API endpoint URL where we should send the order status update data. The webhook will send a POST request with the status update data to this URL.

Key Points
  • Max Failed Attempts Limit: If an update fails 4 times, it will be marked as failed and will not be retried.
  • Request Timeout: If a request does not receive a response within 3 seconds, it will be marked as failed.
  • Authentication Token: You can provide an authentication token to be included in the request headers. Share the token and header name with our system administrator in the following format:
    "auth-key-name:token"
  • Data Retention:
    • Successful requests: Logs will be deleted 3 days after they are sent.
    • Failed requests: Logs will be deleted 21 days after they are sent.
Additional Info
  • Price Change: In some cases, the order price may change while the status remains unchanged.
    This indicates the full order is being delivered at a new price (not due to a return).
    A price change can be detected when the status is "With delivery driver" (3) and the old price is not -1.

أمثلة الطلب (من التوثيق)

Headers: If an authentication token is provided, it will be included in the request headers.

Query Parameters: No parameters

Request Body
{
"client_name":"محمد", (name of the client)
"client_mobile":"+9647712345678", (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)
"send_to_store": (0 OR 1 OR 2),
This flag is relevant when status_id = 23 (Returning to Returned Warehouse). It indicates the current stage of the return process:
0 – The order is still in the city warehouse.
1 – The order is in transit to the Baghdad warehouse.
2 – The order has been received at the Baghdad warehouse.
This flag is primarily used in the Resolve Returned Order API.
"deliver_done":(0 OR 1), (if 1 then the order has been delivered)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"old_price":"18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"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":"+9647712345678", (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)
"company_order_id": "123", (The order ID from the company's system.)
"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.)
}

أدلة

Guides

Using Company Order ID in Our System

You can now use your own company-specific order IDs within our system, subject to certain conditions. This feature enables better alignment between your internal systems and our order processing workflow. It also allows your company to use its own order manifest (order information sticker) when delivering orders.

Requirements for Order ID Prefix: To enable this feature, you must first register a unique order ID prefix that adheres to the following rules:

  1. The prefix must consist of at least three letters and be unique in our system.
  2. The prefix must not contain any special characters except for an underscore (_).
  3. The prefix must not contain any spaces.
  4. The prefix letters must be capital letters.
  5. The prefix must not contain any Numbers.
  6. The prefix must not contain any Arabic letters.

examples for the accepted format: ABC1000, ABC_1000.

How to Register Your Order ID Prefix: To register your order ID prefix:

  1. Contact our customer service team.
  2. Provide the prefix you want to use.
  3. Once approved and registered, the prefix will be associated with your account.

After Registration: Once your prefix is registered, the Company Order ID field becomes required in the order creation APIs.

  1. All submitted Company Order IDs must begin with your registered prefix.
  2. This setup ensures proper tracking and uniqueness of orders from different clients.

حالات الطلب

رحلة الطلب كما يصفها التوثيق

كل حالة هنا مذكورة صراحةً في التوثيق، مع النقاط التي تعمل عليها. الترتيب توضيحي، والقائمة الكاملة لحسابك تأتي من Get Order Statuses، وكل تغيّر يصلك فوراً عبر Webhook.

المسار الرئيسي

  1. 1طلب جديدNew orderDelete an OrderPrint Orders
  2. 2تم استلام الطلب من قبل المندوبنص الحالة كما في مثال الاستجابة
  3. 3مع مندوب التوصيلWith delivery driverResolve Order
  4. تم التسليمdeliver_done = 1Create Merchant Invoices

الإرجاع والمخازن

مراحل الحالة 23 حسب الحقل send_to_store

  1. 0ما زال في مخزن المدينة
  2. 1في الطريق إلى مخزن بغداد
  3. 2استُلم في مخزن بغداد
من أين جاءت كل حالة؟
  • 1status must be equal to 1 (new order)نص التوثيق
  • 2تم استلام الطلب من قبل المندوبمثال استجابة
  • 3"With delivery driver" (3)نص التوثيق
  • 1212 – In province warehouseنص التوثيق
  • 1313 – In Baghdad warehouseنص التوثيق
  • 1515 – Returned to merchantنص التوثيق
  • 23status_id = 23 (Returning to Returned Warehouse)نص التوثيق
  • 4444 – Sent to sorting center for resendingنص التوثيق

Webhooks

لا تسأل عن الحالة… دعها تصلك

عند كل تغيّر في حالة الطلب يرسل النظام طلب POST بصيغة JSON إلى الرابط الذي تزوّده به. هذه أهم قواعده كما في التوثيق:

  • Max Failed Attempts Limit: If an update fails 4 times, it will be marked as failed and will not be retried.
  • Request Timeout: If a request does not receive a response within 3 seconds, it will be marked as failed.
  • Authentication Token: You can provide an authentication token to be included in the request headers. Share the token and header name with our system administrator in the following format:
    "auth-key-name:token"
  • Data Retention:
    • Successful requests: Logs will be deleted 3 days after they are sent.
    • Failed requests: Logs will be deleted 21 days after they are sent.

افتحه في وحدة التحكم

POSTمثال الحمولة (من التوثيق)
{
"client_name":"محمد", (name of the client)
"client_mobile":"+9647712345678", (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)
"send_to_store": (0 OR 1 OR 2),
This flag is relevant when status_id = 23 (Returning to Returned Warehouse). It indicates the current stage of the return process:
0 – The order is still in the city warehouse.
1 – The order is in transit to the Baghdad warehouse.
2 – The order has been received at the Baghdad warehouse.
This flag is primarily used in the Resolve Returned Order API.
"deliver_done":(0 OR 1), (if 1 then the order has been delivered)
"status":"تم استلام الطلب من قبل المندوب", (the status text of the order)
"price":"20000", (the order price including delivery fee)
"old_price":"18000" OR -1, (the OLD order price including delivery fee, if it is set to -1 then the price did not change)
"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":"+9647712345678", (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)
"company_order_id": "123", (The order ID from the company's system.)
"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.)
}
مقدمة الـWebhooks في التوثيق

At our company, we understand the importance of real-time updates and seamless integration between systems. That's why we offer webhooks as a powerful feature to keep your system automatically in sync with key events in our platform.

With webhooks, you no longer need to constantly check for updates. Instead, we’ll send real-time updates directly to your system whenever specific events occur, such as changes to an order’s status. This allows your system to react immediately, whether it’s updating databases, triggering workflows, or sending notifications, all without manual intervention.

By leveraging webhooks, you can streamline your processes, reduce overhead, and ensure that your system stays up-to-date with minimal effort. In this section, we’ll walk you through how to configure and use our webhooks to receive order status updates, so you can take advantage of this feature for a more efficient and automated experience.

سجل الإصدارات

ما الجديد في الـAPI

سجل التغييرات كما نشرته الشركة المشغّلة للنظام، الأحدث أولاً.

  1. V1.11.4

    Added Retrieve Order Story API

    A new endpoint — Retrieve Order Story — returns the chronological snapshots of a single merchant order from the order log.

    Use this API when you need the full status and data history of one order, rather than the current order list returned by Retrieve Orders.

  2. V1.11.3

    Added Retrieve Active Orders API

    A new endpoint — Retrieve Active Orders — returns the merchant's currently relevant orders while excluding stale completed or returned orders that have not been updated in the last month.

    Use this API when you need an up-to-date order list without loading the full order history returned by Retrieve Orders.

  3. V1.11.2

    Added old_price field to Order APIs

    In the following APIs — Retrieve Orders, Retrieve Specific Orders by IDs (Batch), Get Orders With Issues, and Manage Invoices-Get Orders for an Invoice — a new variable has been added ("old_price") to indicate whether the price has changed.

    This field shows the OLD order price including delivery fee. If it is set to -1, then the price did not change.

  4. V1.11.1

    Added Price Change Variable in Webhook

    In the Order Status Update Webhook, a new variable has been added ("old_price") to indicate whether the price has changed.

  5. V1.11.0

    Added send to store flag in order data

    In the following APIs — Retrieve Specific Orders by IDs (Batch), Retrieve Orders, and the Order Status Update Webhook — a new variable has been introduced to indicate the state of a returning order when status_id = 23 (Returning to Returned Warehouse).

    To see how this variable is used, refer to the Response Sample section in the Retrieve Specific Orders by IDs (Batch) or Retrieve Orders APIs, or the Request Samples section in the Order Status Update Webhook.

عرض الإصدارات الأقدم (11)
  1. V1.10.0

    Added resolve returned order API

    A new API enabling merchants to resend orders once they have been returned to the designated returns warehouse.
    check the new api here

  2. V1.9.0

    Added Request returned order API

    Added new api that allows you to request returned orders on behalf of the merchant.
    check the new api here

    Added get orders with issue API

    Added a new api that allows you to get orders with issue on behalf of the merchant.
    check the new api here

    Added resend returnd order API

    Added a new api that allows you to resend a returned order to a new or the same customer.
    check the new api here

  3. V1.8.0

    Added company order ID prefix

    Added support for company-specific order ID prefixes to improve system integration and order tracking.
    check the registrations process here

  4. V1.7.0

    Added Receive Returned Order API

    Now you can receive returned orders on behalf of the merchant using the new API.
    check it out

    Added Resolve Order Issue API

    Your merchants may want to resolve order issues on their own. With this new API, you can enable them to do so.
    check it out

  5. V1.6.1

    Added "deliver_done" flag to retreive orders APIs and webhook

    We’ve added a new deliver_done flag to the following APIs and webhook 'Retrieve Orders' API, 'Retrieve Orders by IDs' API and the webhook.
    This flag enables you to filter orders by their delivery status.

    Added additional info to the webhook

    We’ve updated the webhook by adding new flags. The following flags have been introduced
    'merchant_invoice_id', 'deliver_confirmed_fin' and 'has_merchant_fin_record' flags have been added to the webhook.
    For more details, please refer to the Flags in the 'Request Sample' in the webhook section.

  6. V1.6

    Added Creating Multiple Orders API

    We’ve introduced a powerful new API that allows you to create multiple orders in a single, streamlined request.
    This update simplifies the order creation process, enhancing efficiency and saving valuable time when managing large volumes of orders.
    check it out.

  7. V1.5

    Added Webhooks

    We've added a new webhook specifically for order status updates.
    Now, you can automatically receive real-time updates whenever the status of an order changes in our system.
    check it out.

  8. V1.4

    Added Company Order Id

    In the 'Create Order', 'Edit Order', 'Retrieve All Orders', and 'Retrieve Orders by IDs' APIs,
    a 'Company Order ID' field has been added. This allows you to track which order ID in our system corresponds to the order ID in your system.

  9. V1.3

    Changed create order API name

    Renamed the "Create Order" API to "Order Creation".
    Note: The functionality of the API remains unchanged.

    Added clearer explanations for each endpoint

    - Added clearer explanations for each endpoint, providing more detailed information on their usage and expected responses.
    - Clarified the authentication requirements for the Invoice API to ensure proper integration.

    Added Delete Order API

    With this API, you can delete specific orders.

  10. V1.2

    Added Print order and get printed orders APIs

    This new APIs allows you to print orders and retrieve the printed orders as a PDF file.

  11. V1.1

    Edit an Order

    With this API, you can edit specific information about an order, such as the customer's name, phone number, and address.

    Speed improvement

    Over all endpoint optimization and lower latency

عن هذا التوثيق

المحتوى التقني منقول بنصه من توثيق نظام التشغيل الذي تعمل عليه الشركة، ومنظَّم هنا ليسهل استخدامه. عند أي اختلاف يُعتمد المصدر الأصلي.

agg-iq.net/apiDoc · V1.11.4 · 2026/9/19

Welcome to our API Documentation!

We’re thrilled to have you here. Our API is designed to provide seamless integration and powerful functionality to help you achieve your goals. Whether you’re building a new application, integrating an existing one, or just exploring what our API can do, you’ll find everything you need right here.

To ensure fair usage and optimal performance of our API, we have implemented a rate limit of 200 requests per 30 seconds for each user. This limit is enforced across all endpoints.

تحتاج حساب تاجر للبدء

بيانات الدخول (التوكن) تأتي من حساب التاجر. اطلب حسابك، ولأي مساعدة في الربط تواصل معنا.

جاهز ترسل أول شحنة؟

تاجراً كنت أو فرداً، تواصل معنا ونوصل شحنتك إلى بغداد وجميع المحافظات.