New: Application API docs
Pick the API you are reading here — the Merchant API for your own store, the Application API for partner apps.
Everything you need to integrate with the Gini v2 Third-Party API.
The seller side of the Wholesale (B2B) API: list the orders other merchants have placed with you, inspect a single sale in full detail, and move it through its lifecycle — accept, deliver, or cancel. Every route is scoped to the calling signed merchant through its wholesaleSales relation, so an integration only ever sees and mutates its own sales. Writes run with webhook suppression, so a transition made here does not re-fire the merchant's own outbound webhook.
Returns the wholesale orders where the calling merchant is the seller, as a paginated collection, newest first. Pass an optional status to filter by lifecycle stage. List rows eager-load the buyer and the line items with their product only — item variant details are omitted here and appear on the single-order detail endpoint instead.
/api/v1.0/third-party/wholesale/orders/seller
| Field | Type | Required | Description |
|---|---|---|---|
status
|
string | Optional | Filter by lifecycle status. One of pending, accepted, delivered, cancelled. |
page
|
integer | Optional | Page number to retrieve. The page size is fixed at 15. |
{
"data": [
{
"id": 4012,
"status": "pending",
"status_label": "Pending",
"accepted_at": null,
"delivered_at": null,
"buyer_received_at": null,
"total": "300000.000",
"formatted_total": "IQD 300,000.000",
"items": [
{
"id": 9051,
"product": {
"id": 142,
"name": "Wireless Headphones",
"slug": "wireless-headphones",
"sku": "WH-2026-001",
"description": "Over-ear Bluetooth headphones",
"b2b_price": "150000.00",
"b2b_min_quantity": 2,
"quantity": 340,
"image": "https://s3.amazonaws.com/gini/products/142-1.jpg",
"images": [
"https://s3.amazonaws.com/gini/products/142-1.jpg",
"https://s3.amazonaws.com/gini/products/142-2.jpg"
]
},
"quantity": 2,
"unit_price": "150000.000",
"formatted_unit_price": "IQD 150,000.000",
"total_price": "300000.000",
"formatted_total_price": "IQD 300,000.000"
}
],
"cancelled_by": null,
"cancelled_at": null,
"created_at": "2026-07-05 14:32",
"buyer": {
"id": 88,
"business_name": "Baghdad Retail Co.",
"logo_url": "https://s3.amazonaws.com/gini/merchants/88/logo.png",
"business_phone": "+9647701234567"
}
}
],
"links": {
"first": "https://merchant.gini.iq/api/v1.0/third-party/wholesale/orders/seller?page=1",
"last": "https://merchant.gini.iq/api/v1.0/third-party/wholesale/orders/seller?page=4",
"prev": null,
"next": "https://merchant.gini.iq/api/v1.0/third-party/wholesale/orders/seller?page=2"
},
"meta": {
"current_page": 1,
"last_page": 4,
"per_page": 15,
"total": 52
}
}
Returns the full detail for a single wholesale sale owned by the calling merchant, including the line items with their product and — when the ordered line is a variant — the variant with its attribute values. The {id} path segment is the numeric wholesale order id; there is no route-model binding, so the order is looked up manually and scoped to the caller.
/api/v1.0/third-party/wholesale/orders/seller/{id}
{
"data": {
"id": 4012,
"status": "accepted",
"status_label": "Accepted",
"accepted_at": "2026-07-06 09:10",
"delivered_at": null,
"buyer_received_at": null,
"total": "300000.000",
"formatted_total": "IQD 300,000.000",
"items": [
{
"id": 9051,
"product": {
"id": 142,
"name": "Wireless Headphones",
"slug": "wireless-headphones",
"sku": "WH-2026-001",
"description": "Over-ear Bluetooth headphones",
"b2b_price": "150000.00",
"b2b_min_quantity": 2,
"quantity": 338,
"image": "https://s3.amazonaws.com/gini/products/142-1.jpg",
"images": [
"https://s3.amazonaws.com/gini/products/142-1.jpg",
"https://s3.amazonaws.com/gini/products/142-2.jpg"
]
},
"variant": {
"id": 1167,
"sku": "WH-2026-001-BLK",
"b2b_price": "155000.00",
"quantity": 118,
"attributes": [
{
"id": 44,
"product_variant_id": 1167,
"product_attribute_id": 3,
"value": "Black",
"name": "Color"
}
]
},
"quantity": 2,
"unit_price": "150000.000",
"formatted_unit_price": "IQD 150,000.000",
"total_price": "300000.000",
"formatted_total_price": "IQD 300,000.000"
}
],
"cancelled_by": null,
"cancelled_at": null,
"created_at": "2026-07-05 14:32",
"buyer": {
"id": 88,
"business_name": "Baghdad Retail Co.",
"logo_url": "https://s3.amazonaws.com/gini/merchants/88/logo.png",
"business_phone": "+9647701234567"
}
}
}
Accepts a pending order the caller is selling. Stock is decremented at acceptance (not at placement), the variant/product row is locked to prevent over-selling, and the buyer is notified. Takes no request body.
/api/v1.0/third-party/wholesale/orders/seller/{id}/accept
{
"data": null
}
Marks an accepted order as delivered and notifies the buyer. The buyer separately confirms physical receipt later through their own flow (which sets buyer_received_at) — that is not part of this call. Takes no request body.
/api/v1.0/third-party/wholesale/orders/seller/{id}/deliver
{
"data": null
}
Cancels a pending order from the seller side and notifies the buyer. Sellers may only cancel while the order is still pending — once accepted, stock has been committed and only the buyer can cancel. Takes no request body.
/api/v1.0/third-party/wholesale/orders/seller/{id}/cancel
{
"data": null
}
Every merchant that has ever ordered from your wholesale catalogue, with their lifetime figures. Read-only and derived from your orders — there is no buyers record to create or edit.
/api/v1.0/third-party/wholesale/buyers
| Field | Type | Required | Description |
|---|---|---|---|
search
|
string | Optional | Match the buyer business name. |
sort
|
string | Optional | spend (default), orders, recent or name. name sorts ascending; the rest descending. |
per_page
|
integer | Optional | Results per page, 1–100. Defaults to 15. |
{
"data": [
{
"buyer_id": 812,
"business_name": "Baghdad Wholesale Co",
"business_phone": "+9647701234567",
"state_label": "Baghdad",
"orders_count": 14,
"delivered_count": 11,
"lifetime_spend": 4250000,
"last_order_at": "2026-09-02 11:30:00"
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 1
}
}