Skip to main content

Release Order for Dispatch

Release a scheduled order for courier dispatch.

POST /integrations/yango/orders/:externalRef/release

Request

Path Parameters

ParameterTypeRequiredDescription
externalRefstringYesYour unique order reference

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

Use Cases

  • Release future-dated orders for immediate dispatch
  • Manually trigger dispatch for scheduled orders
  • Override automatic scheduled dispatch

Examples

cURL

curl -X POST "https://api.courimax.com/api/integrations/yango/orders/YANGO-ORDER-123/release" \
-H "X-API-Key: cmx_your_api_key"

JavaScript (Fetch)

const response = await fetch(
'https://api.courimax.com/api/integrations/yango/orders/YANGO-ORDER-123/release',
{
method: 'POST',
headers: {
'X-API-Key': 'cmx_your_api_key'
}
}
);

const result = await response.json();
console.log(result);

Python (Requests)

import requests

response = requests.post(
'https://api.courimax.com/api/integrations/yango/orders/YANGO-ORDER-123/release',
headers={
'X-API-Key': 'cmx_your_api_key'
}
)

result = response.json()
print(result)

Response

Success (200 OK)

{
"released": true,
"orderId": "order-uuid",
"status": "dispatching"
}

Response Fields

FieldTypeDescription
releasedbooleanWhether the order was successfully released
orderIdstringCourimax order ID
statusstringNew order status (typically dispatching)

Error Responses

401 Unauthorized - Missing or invalid API key

{
"statusCode": 401,
"message": "Missing X-API-Key header",
"error": "Unauthorized"
}

404 Not Found - Order not found

{
"statusCode": 404,
"message": "Order not found",
"error": "Not Found"
}

409 Conflict - Order cannot be released

{
"statusCode": 409,
"message": "Order is already dispatched",
"error": "Conflict"
}

Scheduled Dispatch

Orders with future delivery windows are automatically scheduled for dispatch. The system calculates the optimal dispatch time based on:

  • Delivery window start time
  • Estimated pickup duration
  • Buffer time for driver assignment

Use this endpoint to override the scheduled dispatch and release immediately.

Webhook Notifications

When an order is released, webhook notifications are sent:

  • order.dispatching - Order released for dispatch
  • order.assigned - Driver assigned (after dispatch)

Next Steps