Prompt
How do I update order status when a label is created?
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
Usually you do this by listening for the “label created” event from your shipping provider, then updating your order record in your app/database.
Typical flow
- Create shipping label
- Receive a response/webhook containing the label/tracking info
- Map that event to your order
- Update the order status to something like:
label_createdpackedshipped(often only once the carrier has accepted the package)fulfilled
Example logic
- If a label is generated successfully:
- save tracking number
- save carrier name
- set order status to
label_created
- If you also want to mark it as shipped immediately:
- update status to
shipped - but note that this is a business decision; many systems wait until pickup/scan by the carrier
- update status to
Pseudocode
if (labelCreated) {
await db.orders.update({
where: { id: orderId },
data: {
status: "label_created",
trackingNumber: label.trackingNumber,
carrier: label.carrier,
},
});
}
If you’re using webhooks
Set up a webhook endpoint for the shipping service and handle events like:
label.createdshipment.createdtracking.updated
Then update the order in your handler.
Best practice
Use separate statuses for:
- label created
- shipped
- delivered
So your internal order state stays accurate.
If you tell me what platform you’re using (Shopify, WooCommerce, Shippo, EasyPost, custom app, etc.), I can show the exact implementation.