انتقل إلى المحتوى الرئيسي

order.updated

Fired when an existing order is updated (status change, fulfillment update, payment capture, etc.).

معلومة

The payload always contains the full order object, not just the changed fields. Compare against your local copy to detect what changed.

Event Structure

{
"event_type": "order.updated",
"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": "confirmed",
"financialStatus": "paid",
"fulfillmentStatus": "fulfilled",
"deleted": false,
"paidAt": "2025-02-24T14:30:05.000Z",
"isFastOrder": false,
"freeze": false,
"priceWithShipping": 375,
"shippingPrice": 25,
"type": "account",
"shipping": {
"carrier": "mylerz",
"barCode": "MLZ-2025-********",
"reference": "REF-0001****",
"mylerzWarehouseId": "WH-RYD-***",
"status": "delivered"
},
"currency": {
"code": "SAR",
"symbol": "ر.س",
"rate": 1
},
"createdAt": "2025-02-24T14:30:00.000Z",
"updatedAt": "2025-02-25T09:15:00.000Z"
}

Payload Fields

Same shape as order.created. Look at orderStatus, financialStatus, fulfillmentStatus, shipping.status, and updatedAt to detect what changed.

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.updated") {
console.log(`Order ${payload.handel} updated`);
console.log(`Lifecycle: ${payload.orderStatus}`);
console.log(`Financial: ${payload.financialStatus}`);
console.log(`Fulfillment: ${payload.fulfillmentStatus}`);

// Re-sync to ERP, re-compute analytics, notify warehouse, etc.
}

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