Skip to main content

order.created

Fired when a new order is placed in the store.

Event Structure

{
"event_type": "order.created",
"payload": { ... }
}

Payload

{
"_id": "6764a1b2c3d4************",
"qid": "qid://qumra/Order/01JDXM************",
"app": "6720ff8e4a21************",
"account": "674b3c11d9a0************",
"market": "671a88f3bc45************",
"marketSnapshot": {
"name": "Saudi Arabia",
"code": "sa",
"currency": "SAR",
"countries": ["SA"]
},
"totalPrice": 350,
"totalPriceWithTax": 398.75,
"handel": "#1042",
"tax": "67205c8ab1c2************",
"taxAmount": 48.75,
"totalCompareAtPrice": 400,
"shippingAddress": "6764a0ff77e1************",
"paymentMethod": "67210def44a9************",
"manualPayment": null,
"paymentType": "gateway",
"channel": "STORE",
"salesLead": null,
"items": [
"6764a1b2c3d5************",
"6764a1b2c3d6************"
],
"status": "6764a1b2c3d7************",
"orderStatus": "pending",
"financialStatus": "paid",
"fulfillmentStatus": "unfulfilled",
"deleted": false,
"paidAt": "2025-02-24T14:30:05.000Z",
"isFastOrder": false,
"freeze": true,
"priceWithShipping": 375,
"shippingPrice": 25,
"type": "account",
"shipping": {
"carrier": "mylerz",
"barCode": "MLZ-2025-********",
"reference": "REF-0001****",
"mylerzWarehouseId": "WH-RYD-***",
"status": "pending"
},
"currency": {
"code": "SAR",
"symbol": "ر.س",
"rate": 1
},
"createdAt": "2025-02-24T14:30:00.000Z",
"updatedAt": "2025-02-24T14:30:00.000Z"
}

Payload Fields

FieldTypeDescription
_idstringMongoDB ObjectId of the order
qidstringQumra QID (qid://qumra/Order/<ULID>)
appstringStore ID that owns the order
accountstring | nullCustomer account ID (null for guest/lead orders)
marketstring | nullMarket ID
marketSnapshotobjectFrozen copy of the market at order time (currency, countries, etc.)
totalPricenumberOrder subtotal (before tax and shipping)
totalPriceWithTaxnumberOrder total including tax
handelstringHuman-readable order number (e.g. #1042)
taxstring | nullTax record ID
taxAmountnumberTotal tax amount
totalCompareAtPricenumberSum of compare-at prices (for showing savings)
shippingAddressstringShipping address ID
paymentMethodstring | nullPayment method ID (gateway)
manualPaymentstring | nullManual payment ID (bank transfer, etc.)
paymentTypestringOne of gateway, manual, cash
channelstringOrder channel: STORE or POS
salesLeadstring | nullSales lead ID if created from a lead
itemsstring[]Array of order item IDs
statusstringOrder status record ID
orderStatusstringLifecycle status (pending, confirmed, cancelled, ...)
financialStatusstringPayment status (unpaid, paid, refunded, ...)
fulfillmentStatusstringFulfillment status (unfulfilled, partial, fulfilled)
deletedbooleanSoft-delete flag
paidAtstring | nullISO 8601 timestamp when payment was captured
isFastOrderbooleanWhether this was a fast-checkout order
freezebooleanWhether the order is frozen (post-creation hold)
priceWithShippingnumberTotal including shipping (before tax)
shippingPricenumberShipping cost
typestringOrder origin type: lead, account, or guest
shippingobject | nullShipping/carrier metadata
shipping.carrierstringCarrier name (e.g. mylerz, aramex)
shipping.barCodestringShipment bar code
shipping.referencestringCarrier reference number
shipping.mylerzWarehouseIdstringMylerz warehouse ID (when carrier is Mylerz)
shipping.statusstringCarrier-side status
currencyobjectCurrency snapshot (code, symbol, rate)
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp
info

Line items are referenced by ID in the items array. To fetch their full data (product, variant, quantity, price), call the orders API with the order ID.

Example Handler

app/routes/webhooks.orders.tsx
import { authenticate } from "~/qumra.server";

export async function action({ request }: { request: Request }) {
const { payload, topic, storeId } =
await authenticate.admin(request);

if (topic === "order.created") {
console.log(`New order ${payload.handel} (${payload._id})`);
console.log(`Total: ${payload.totalPriceWithTax} ${payload.currency?.code}`);
console.log(`Items: ${payload.items.length}`);

// Send confirmation email, sync to ERP, update analytics, etc.
}

return Response.json({ success: true });
}