- Callback Events
- Order Update Resolutions
Callback Events
Order Update Resolutions
Webhook event sent when asynchronous order update requests are resolved
Order Update Resolution events notify you of the success or failure of asynchronous order update requests. When you submit an order update (e.g., changing shipping address or line items), this event confirms whether the update was applied.
Order updates can only be processed before the order reaches certain fulfillment stages. Updates may fail if the order is already packed or shipped.
​Event Payload
{
"callback_url": "https://client.com/api/orderUpdateResolution",
"message_type": "orderUpdateResolution",
"message_id": "0896116f-e54b-4756-9d3e-1b0c4a25d821",
"data": [
{
"id": "0b744e29-b668-4486-85dd-82528b5da0dd",
"customer_order_id": "12345",
"status": "success",
"reason": null,
"created_at": "2018-08-05T17:32:28Z",
"updated_at": "2018-08-05T17:32:28Z"
}
]
}
​Payload Fields
Your registered webhook endpoint URL
Always orderUpdateResolution for this event type
Unique identifier for this event. Use for idempotency checks.
Array of update resolution records. Each record contains:
​Resolution Status Values
Success
Order update was applied successfully
Failure
Order update could not be applied (reason provided)
​Common Failure Reasons
| Reason | Description | Action |
|---|---|---|
Order already packed | Order is past the packing stage | Cannot update - consider canceling and reordering |
Order already shipped | Order has been shipped | Cannot update - handle via RMA process |
Invalid shipping address | New address is undeliverable | Verify and resubmit with valid address |
SKU not found | Updated SKU doesn’t exist | Verify SKU identifier and resubmit |
Insufficient inventory | Updated items not available | Reduce quantity or wait for inventory |
​Example Payloads
​Successful Update
{
"message_type": "orderUpdateResolution",
"message_id": "abc123",
"data": [
{
"id": "0b744e29-b668-4486-85dd-82528b5da0dd",
"customer_order_id": "12345",
"status": "success",
"reason": null,
"created_at": "2018-08-05T17:32:28Z",
"updated_at": "2018-08-05T17:32:30Z"
}
]
}
​Failed Update
{
"message_type": "orderUpdateResolution",
"message_id": "def456",
"data": [
{
"id": "1c855f30-c779-5597-96ee-93639c6eb0ee",
"customer_order_id": "67890",
"status": "failure",
"reason": "Order already packed",
"created_at": "2018-08-05T17:45:10Z",
"updated_at": "2018-08-05T17:45:12Z"
}
]
}
​Implementation Example
@app.route('/api/orderUpdateResolution', methods=['POST'])
def handle_order_update_resolution():
try:
payload = request.get_json()
message_id = payload['message_id']
# Check if already processed
if is_message_processed(message_id):
return 'OK', 200
# Process each resolution
for resolution in payload['data']:
order_id = resolution['customer_order_id']
status = resolution['status']
reason = resolution.get('reason')
if status == 'success':
# Mark update as successful
mark_order_update_success(order_id)
# Notify customer if needed
notify_customer_order_updated(order_id)
logger.info(f"Order {order_id} updated successfully")
else: # failure
# Log failure
log_order_update_failure(order_id, reason)
# Alert operations team
alert_ops_team(order_id, reason)
# May need to take corrective action
if reason == "Order already packed":
# Consider canceling and reordering
initiate_order_cancel(order_id)
elif reason == "Invalid shipping address":
# Request customer to provide valid address
request_address_correction(order_id)
logger.error(f"Order {order_id} update failed: {reason}")
mark_message_processed(message_id)
return 'OK', 200
except Exception as e:
logger.error(f"Update resolution webhook error: {e}")
return 'Error', 500
app.post('/api/orderUpdateResolution', async (req, res) => {
try {
const payload = req.body;
const messageId = payload.message_id;
// Check if already processed
if (await isMessageProcessed(messageId)) {
return res.status(200).send('OK');
}
// Process each resolution
for (const resolution of payload.data) {
const orderId = resolution.customer_order_id;
const status = resolution.status;
const reason = resolution.reason;
if (status === 'success') {
// Mark update as successful
await markOrderUpdateSuccess(orderId);
// Notify customer if needed
await notifyCustomerOrderUpdated(orderId);
console.log(`Order ${orderId} updated successfully`);
} else {
// Log failure
await logOrderUpdateFailure(orderId, reason);
// Alert operations team
await alertOpsTeam(orderId, reason);
// Take corrective action based on reason
if (reason === 'Order already packed') {
await initiateOrderCancel(orderId);
} else if (reason === 'Invalid shipping address') {
await requestAddressCorrection(orderId);
}
console.error(`Order ${orderId} update failed: ${reason}`);
}
}
await markMessageProcessed(messageId);
res.status(200).send('OK');
} catch (error) {
console.error('Update resolution webhook error:', error);
res.status(500).send('Error');
}
});
​Update Request Flow
- Submit Update - Call
PUT /orders/{id}with updated fields - Receive Acknowledgment - API returns 202 Accepted
- Wait for Resolution - MasonHub processes the update asynchronously
- Receive Event - Get
orderUpdateResolutionwebhook with success/failure
sequenceDiagram
participant Client
participant MasonHub API
participant Warehouse
participant Webhook
Client->>MasonHub API: PUT /orders/12345
MasonHub API-->>Client: 202 Accepted
MasonHub API->>Warehouse: Process update request
Warehouse->>MasonHub API: Update applied/failed
MasonHub API->>Webhook: orderUpdateResolution event
Webhook-->>MasonHub API: 200 OK
​Use Cases
Update Confirmation
Confirm order updates were applied successfully
Failure Handling
Implement fallback logic for failed updates
Customer Communication
Notify customers of successful address or item changes
Operations Alerts
Alert teams when updates fail for manual intervention
​Best Practices
Track Update Requests
Store update request IDs to correlate with resolutions
Handle Failures Gracefully
Implement fallback logic for each failure reason
Update Early
Submit updates as soon as possible - before packing stage
Validate Before Submitting
Validate addresses and SKUs client-side to reduce failures
Order updates have time-sensitive windows. Submit updates immediately after the customer makes changes to maximize success rate.
​Response Requirements
Your webhook endpoint must:
- Respond within 30 seconds - Return HTTP 200 to acknowledge receipt
- Handle both statuses - Implement logic for success and failure cases
- Correlate requests - Match resolutions to original update requests
- Take corrective action - Implement fallback logic for failures
​Related Events
- Order Events - Order status changes and shipments
- Order Cancel Resolutions - Cancel request confirmations