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.
Manage the wholesale orders you place as a buyer — list your purchases, place a new order from your wholesale cart, fetch one order in full detail, confirm you received a delivery, and cancel an order that has not been fulfilled yet. Every route is scoped to the calling signed merchant through their wholesalePurchases relation, so an integration only ever sees and mutates its own orders. All endpoints are HMAC-signed, and writes made through this API do not re-trigger the merchant's own outbound webhook.
Returns the wholesale orders you have placed, as a paginated collection ordered newest-first. The optional status filter narrows by lifecycle state, plus a synthetic pending_receipt value for delivered orders you have not confirmed as received yet. List rows carry the seller and the order items (with their product), but omit each item's variant and attributes — those appear on the single-order detail endpoint instead.
/api/v1.0/third-party/wholesale/orders/buyer
| Field | Type | Required | Description |
|---|---|---|---|
status
|
string | Optional | Filter by order status. One of the wholesale statuses pending, accepted, delivered, cancelled, or the synthetic value pending_receipt (delivered orders whose buyer_received_at is still null). |
{
"data": [
{
"id": 4187,
"status": "delivered",
"status_label": "Delivered",
"accepted_at": "2026-06-21 10:42",
"delivered_at": "2026-06-23 14:05",
"buyer_received_at": null,
"total": "225000.000",
"formatted_total": "IQD 225,000",
"items": [
{
"id": 9012,
"product": {
"id": 142,
"name": "Wireless Headphones",
"slug": "wireless-headphones",
"sku": "WH-2026-001",
"description": "Over-ear bluetooth headphones",
"b2b_price": "45000.00",
"b2b_min_quantity": 5,
"quantity": 320,
"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": 5,
"unit_price": "45000.000",
"formatted_unit_price": "IQD 45,000",
"total_price": "225000.000",
"formatted_total_price": "IQD 225,000"
}
],
"cancelled_by": null,
"cancelled_at": null,
"created_at": "2026-06-20 09:15",
"seller": {
"id": 77,
"business_name": "Baghdad Wholesale Co",
"logo_url": "https://s3.amazonaws.com/gini/logos/77.png",
"business_phone": "+9647701234567"
}
}
],
"links": {
"first": "https://merchant.gini.iq/api/v1.0/third-party/wholesale/orders/buyer?page=1",
"last": "https://merchant.gini.iq/api/v1.0/third-party/wholesale/orders/buyer?page=3",
"prev": null,
"next": "https://merchant.gini.iq/api/v1.0/third-party/wholesale/orders/buyer?page=2"
},
"meta": {
"current_page": 1,
"last_page": 3,
"per_page": 15,
"total": 34
}
}
Turns your current wholesale cart into a single Pending order to the cart's seller. Each line's wholesale price and quantity are snapshotted at placement, the wholesale cart is cleared, and the seller is notified. Takes no request body — the cart is the input. Returns the created order in full detail.
/api/v1.0/third-party/wholesale/orders/buyer
{
"data": {
"id": 4192,
"status": "pending",
"status_label": "Pending",
"accepted_at": null,
"delivered_at": null,
"buyer_received_at": null,
"total": "225000.000",
"formatted_total": "IQD 225,000",
"items": [
{
"id": 9031,
"product": {
"id": 142,
"name": "Wireless Headphones",
"slug": "wireless-headphones",
"sku": "WH-2026-001",
"description": "Over-ear bluetooth headphones",
"b2b_price": "45000.00",
"b2b_min_quantity": 5,
"quantity": 320,
"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-RED",
"b2b_price": "45000.00",
"quantity": 80,
"attributes": [
{
"id": 55,
"product_variant_id": 1167,
"product_attribute_id": 3,
"value": "Red",
"name": "Color"
}
]
},
"quantity": 5,
"unit_price": "45000.000",
"formatted_unit_price": "IQD 45,000",
"total_price": "225000.000",
"formatted_total_price": "IQD 225,000"
}
],
"cancelled_by": null,
"cancelled_at": null,
"created_at": "2026-07-06 12:03",
"seller": {
"id": 77,
"business_name": "Baghdad Wholesale Co",
"logo_url": "https://s3.amazonaws.com/gini/logos/77.png",
"business_phone": "+9647701234567"
}
}
}
Returns the full detail for one wholesale order you placed, including its line items with the product, the ordered variant and the variant's attributes, plus the seller. The {id} path segment is the numeric order id — there is no route-model binding, the order is looked up manually and scoped to your purchases.
/api/v1.0/third-party/wholesale/orders/buyer/{id}
{
"data": {
"id": 4187,
"status": "delivered",
"status_label": "Delivered",
"accepted_at": "2026-06-21 10:42",
"delivered_at": "2026-06-23 14:05",
"buyer_received_at": null,
"total": "225000.000",
"formatted_total": "IQD 225,000",
"items": [
{
"id": 9012,
"product": {
"id": 142,
"name": "Wireless Headphones",
"slug": "wireless-headphones",
"sku": "WH-2026-001",
"description": "Over-ear bluetooth headphones",
"b2b_price": "45000.00",
"b2b_min_quantity": 5,
"quantity": 320,
"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-RED",
"b2b_price": "45000.00",
"quantity": 80,
"attributes": [
{
"id": 55,
"product_variant_id": 1167,
"product_attribute_id": 3,
"value": "Red",
"name": "Color"
}
]
},
"quantity": 5,
"unit_price": "45000.000",
"formatted_unit_price": "IQD 45,000",
"total_price": "225000.000",
"formatted_total_price": "IQD 225,000"
}
],
"cancelled_by": null,
"cancelled_at": null,
"created_at": "2026-06-20 09:15",
"seller": {
"id": 77,
"business_name": "Baghdad Wholesale Co",
"logo_url": "https://s3.amazonaws.com/gini/logos/77.png",
"business_phone": "+9647701234567"
}
}
}
Marks a delivered order as physically received by you. This stamps buyer_received_at and notifies the seller; the order status stays delivered, since received is a sub-state of delivery rather than a separate status. On success it returns a plain confirmation rather than the order.
/api/v1.0/third-party/wholesale/orders/buyer/{id}/confirm-received
{
"data": null
}
Cancels one of your wholesale orders. As the buyer you may cancel an order that is still pending or has been accepted; cancelling an accepted order restores the reserved stock to the seller. The order moves to cancelled and the seller is notified. Returns a plain confirmation rather than the order.
/api/v1.0/third-party/wholesale/orders/buyer/{id}/cancel
{
"data": null
}