GGlamBug Partner APIglambug.in ↗

Orders

Submitting an order

Reference products by sku, not id. We compute the price server-side from the current rate — you can't (and don't need to) send a price.

Mutation
mutation {
  partnerSubmitOrder(input: {
    items: [
      { sku: "GB-080-534", qty: 2 }
    ]
    partnerReference: "order-48213"   # your own id for this order — see below
    notes: "Ship together if possible"
    shippingAddress: "{\"line1\":\"...\",\"city\":\"Hyderabad\",\"pincode\":\"500048\"}"
  }) {
    id
    orderNumber
    status
    isTest
    grandTotal
    amountDue
    items {
      sku
      qty
      weightAtOrder
      priceAtOrder
      lineTotal
    }
  }
}
Response
{
  "data": {
    "partnerSubmitOrder": {
      "id": "cmu5brc6n0002bcskplvjkh5n",
      "orderNumber": "GB-3801",
      "status": "PENDING",
      "isTest": false,
      "grandTotal": 2816,
      "amountDue": 2816,
      "items": [
        { "sku": "GB-080-534", "qty": 2, "weightAtOrder": 3.2, "priceAtOrder": 440, "lineTotal": 2816 }
      ]
    }
  }
}

priceAtOrder is a per-gram rate, not a per-unit price — it pairs with weightAtOrder (lineTotal = qty × weightAtOrder × priceAtOrder, e.g. 2 × 3.2 × 440 = 2816above). You generally don't need to compute this yourself: lineTotal is already the ready-to-use amount for that line — it matches qty × pprice from the product's catalogue listing (see Products).

Who the parcel is from

The sender printed on the parcel and its label is set by us from your account, not by your request. If your account is set up as white label, parcels show your own business name and phone number from your partner profile. Otherwise they show ours. Any sender details you include in shippingAddress are ignored.

A white-label account that has no phone number on its profile can't submit orders yet. The request is refused with PARTNER_PHONE_MISSING and nothing is created. Ask your GlamBug contact to add the number, then resend.

Idempotency

partnerReferenceis your own identifier for the order — pick something unique per order on your side (your own order id works well). If a request times out or you're not sure it went through, resend it with the same partnerReference: you'll get back the original order, not a duplicate.

What happens after submission

The order lands as PENDING— stock isn't committed and fulfillment hasn't started yet. Our team reviews and accepts it before it moves forward. Poll myOrders or myOrderStats below to see status changes.

Validation

Every item is checked server-side before an order is created:

  • The sku must exist and be active.
  • Requested qty must not exceed current stock.
  • Your account's wallet balance must cover the order's total — see below.
Response — out of stock
{
  "errors": [
    {
      "message": "GB-190-012: requested 999, only 1 in stock",
      "extensions": { "code": "BAD_USER_INPUT" }
    }
  ],
  "data": null
}

Wallet balance

There's no separate checkout or payment step — orders are funded from your account's wallet balance. A submission is rejected up front if your balance doesn't cover the order's grandTotal, and nothing is created. Reach out to your contact to top up before retrying.

Balance is checked net of your other orders still sitting in PENDING(not yet reviewed) — so if you submit several orders in a row before any of them are accepted, each one is checked against what's actually left after the others, not the same unspent total.

Response — insufficient balance
{
  "errors": [
    {
      "message": "Insufficient wallet balance: this order totals ₹2816.00, available balance is ₹1200.00 (₹5000.00 wallet balance minus ₹3800.00 across your other pending orders)",
      "extensions": { "code": "INSUFFICIENT_BALANCE" }
    }
  ],
  "data": null
}

Your order history

Query
query {
  myOrders(limit: 20, offset: 0) {
    id
    orderNumber
    status
    grandTotal
    amountDue
    amountPaid
    createdAt
  }
  myOrderStats {
    total
    pending
    completed
    paid
  }
}

Both only ever return orders submitted with your API key's account — there's no way to see another partner's orders.

Order status values

StatusMeaning
PENDINGSubmitted, awaiting our review.
ACCEPTEDReviewed and accepted — moving into fulfillment.
REJECTEDNot accepted — reach out to your contact for why.
PAIDPayment received.
PROCESSEDReady to ship or in transit.
DISPATCHEDShipped, awaiting delivery confirmation.
COMPLETEDDelivered.
CANCELLEDCancelled.

For amount due/paid on an order see Payments, for tracking see Shipments, and for a GST invoice see Invoices.