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 signed merchant's wholesale shopping cart as a buyer — view the current cart with per-line and grand totals, add products or specific variants, change quantities, and remove lines or clear the whole cart. Every route is HMAC-signed and scoped to the calling merchant, who acts as the buyer. Wholesale carts are single-seller: all lines must belong to one seller, so switching sellers means clearing the cart first. Stock is never held at cart-time — it is only decremented when the seller later accepts the placed order.
Returns every line in the calling merchant's wholesale cart, each with its product and (optional) variant, alongside the line count and the cart grand total. Not paginated — the full cart is returned in one payload. Unit price prefers the variant's wholesale price, falling back to the product's.
/api/v1.0/third-party/wholesale/cart
{
"data": {
"items": [
{
"id": 4821,
"product": {
"id": 142,
"name": "Wireless Headphones",
"slug": "wireless-headphones",
"sku": "WH-2026-001",
"description": "Over-ear wireless headphones, wholesale carton.",
"b2b_price": "38000.00",
"b2b_min_quantity": 10,
"quantity": 500,
"client": {
"id": 57,
"business_name": "Baghdad Electronics Wholesale",
"logo_url": "https://s3.amazonaws.com/gini/merchants/logos/57.png"
},
"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": "40000.00",
"quantity": 120
},
"quantity": 12,
"unit_price": "40000.00",
"formatted_unit_price": "IQD 40,000",
"total_price": 480000,
"formatted_total_price": "IQD 480,000"
}
],
"items_count": 1,
"total": 480000,
"formatted_total": "IQD 480,000"
}
}
Adds a product, or a specific variant of it, to the wholesale cart. If the same product/variant is already in the cart the quantities are combined. On success the endpoint returns an empty data envelope rather than the added line — re-fetch the cart to read it.
/api/v1.0/third-party/wholesale/cart
| Field | Type | Required | Description |
|---|---|---|---|
product_id
|
integer | Required | Id of the product to add. Must reference an existing, wholesale-enabled, visible product. |
product_variant_id
|
integer | Optional | Id of a specific variant to add. Omit for a variantless product; when set, the variant must belong to the product and carry its own wholesale price. |
quantity
|
integer | Required | Quantity to add, at least 1. The resulting line quantity must meet the product's minimum wholesale quantity and stay within available stock. |
{
"product_id": 142,
"product_variant_id": 1167,
"quantity": 12
}
{
"data": null
}
Changes the quantity of a single cart line owned by the caller. The type field decides whether the given quantity replaces, adds to, or subtracts from the current line quantity. On success the endpoint returns the stored line quantity after the change.
/api/v1.0/third-party/wholesale/cart/{cartItem}
| Field | Type | Required | Description |
|---|---|---|---|
quantity
|
integer | Required | The quantity value applied per the type field, at least 1. |
type
|
string | Optional | How to apply quantity: set (the default) replaces the line quantity, + increments by quantity, and - decrements by quantity. One of set, +, -. |
{
"quantity": 2,
"type": "+"
}
{
"data": {
"quantity": 14
}
}
Removes a single line from the wholesale cart. The line must belong to the caller. On success the endpoint returns an empty data envelope.
/api/v1.0/third-party/wholesale/cart/{cartItem}
{
"data": null
}
Deletes every line in the calling merchant's wholesale cart in a single call. Useful for switching sellers, since the cart is single-seller. Takes no parameters.
/api/v1.0/third-party/wholesale/cart
{
"data": null
}