Create Order
Create a new delivery order in Courimax.
POST /integrations/yango/ordersRequest
Headers
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | Your API key |
Content-Type | Yes | application/json |
Idempotency-Key | No | Unique key for idempotent requests |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pickupAddress | string | Yes | Pickup address |
pickupLat | number | No* | Pickup latitude |
pickupLng | number | No* | Pickup longitude |
dropoffAddress | string | Yes | Dropoff address |
dropoffLat | number | No* | Dropoff latitude |
dropoffLng | number | No* | Dropoff longitude |
recipientName | string | Yes | Recipient name |
recipientPhone | string | Yes | Recipient phone number |
packageSize | string | No** | small, medium, or large |
externalRef | string | Yes | Your unique order reference |
weightKg | number | No** | Package weight in kilograms |
temperatureClass | string | No | Ambient, Chilled, or Frozen |
deliveryMethod | string | No | motorcycle, car, or refrigerated |
deliveryZone | string | No | Delivery zone name |
geocodeOnIngest | boolean | No | Auto-geocode addresses if coordinates missing |
notes | string | No | Additional notes |
deliveryWindowStart | string | No | ISO 8601 delivery window start |
deliveryWindowEnd | string | No | ISO 8601 delivery window end |
codAmount | number | No | Cash on delivery amount |
expectedBarcode | string | No | Expected package barcode |
serviceType | string | No | standard, return, click_collect, locker, round |
*Coordinates required unless geocodeOnIngest is true
**Either packageSize or weightKg is required
Examples
cURL
curl -X POST "https://api.courimax.com/api/integrations/yango/orders" \
-H "X-API-Key: cmx_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-request-id-123" \
-d '{
"pickupAddress": "Rothschild Blvd 1, Tel Aviv",
"pickupLat": 32.0639,
"pickupLng": 34.7742,
"dropoffAddress": "Dizengoff Center, Tel Aviv",
"dropoffLat": 32.0753,
"dropoffLng": 34.7749,
"recipientName": "Jane Doe",
"recipientPhone": "+972501234567",
"packageSize": "small",
"externalRef": "YANGO-ORDER-123",
"notes": "Handle with care",
"deliveryWindowStart": "2026-08-20T10:00:00Z",
"deliveryWindowEnd": "2026-08-20T14:00:00Z"
}'
JavaScript (Fetch)
const response = await fetch('https://api.courimax.com/api/integrations/yango/orders', {
method: 'POST',
headers: {
'X-API-Key': 'cmx_your_api_key',
'Content-Type': 'application/json',
'Idempotency-Key': 'unique-request-id-123'
},
body: JSON.stringify({
pickupAddress: 'Rothschild Blvd 1, Tel Aviv',
pickupLat: 32.0639,
pickupLng: 34.7742,
dropoffAddress: 'Dizengoff Center, Tel Aviv',
dropoffLat: 32.0753,
dropoffLng: 34.7749,
recipientName: 'Jane Doe',
recipientPhone: '+972501234567',
packageSize: 'small',
externalRef: 'YANGO-ORDER-123',
notes: 'Handle with care',
deliveryWindowStart: '2026-08-20T10:00:00Z',
deliveryWindowEnd: '2026-08-20T14:00:00Z'
})
});
const order = await response.json();
console.log(order);
Python (Requests)
import requests
response = requests.post(
'https://api.courimax.com/api/integrations/yango/orders',
headers={
'X-API-Key': 'cmx_your_api_key',
'Content-Type': 'application/json',
'Idempotency-Key': 'unique-request-id-123'
},
json={
'pickupAddress': 'Rothschild Blvd 1, Tel Aviv',
'pickupLat': 32.0639,
'pickupLng': 34.7742,
'dropoffAddress': 'Dizengoff Center, Tel Aviv',
'dropoffLat': 32.0753,
'dropoffLng': 34.7749,
'recipientName': 'Jane Doe',
'recipientPhone': '+972501234567',
'packageSize': 'small',
'externalRef': 'YANGO-ORDER-123',
'notes': 'Handle with care',
'deliveryWindowStart': '2026-08-20T10:00:00Z',
'deliveryWindowEnd': '2026-08-20T14:00:00Z'
}
)
order = response.json()
print(order)
Response
Success (201 Created)
{
"id": "order-uuid",
"status": "pending",
"pickupAddress": "Rothschild Blvd 1, Tel Aviv",
"pickupLat": 32.0639,
"pickupLng": 34.7742,
"dropoffAddress": "Dizengoff Center, Tel Aviv",
"dropoffLat": 32.0753,
"dropoffLng": 34.7749,
"recipientName": "Jane Doe",
"recipientPhone": "+972501234567",
"packageSize": "small",
"externalRef": "YANGO-ORDER-123",
"notes": "temp=Ambient; weightKg=5; zone=TLV-CENTER; Handle with care",
"deliveryWindowStart": "2026-08-20T10:00:00.000Z",
"deliveryWindowEnd": "2026-08-20T14:00:00.000Z",
"trackingToken": "tracking-token-abc",
"createdAt": "2026-08-19T10:00:00.000Z",
"updatedAt": "2026-08-19T10:00:00.000Z"
}
Error Responses
400 Bad Request - Validation error
{
"statusCode": 400,
"message": [
"externalRef (partner order ID) is required",
"dropoffLat/dropoffLng required unless geocodeOnIngest is true"
],
"error": "Bad Request"
}
401 Unauthorized - Missing or invalid API key
{
"statusCode": 401,
"message": "Missing X-API-Key header",
"error": "Unauthorized"
}
409 Conflict - Duplicate external reference
{
"statusCode": 409,
"message": "Order with externalRef YANGO-ORDER-123 already exists",
"error": "Conflict"
}
Idempotency
Include an Idempotency-Key header to safely retry requests without creating duplicate orders. If a request with the same idempotency key was already processed, the original response is returned.
Webhook Notifications
When an order is created, a webhook notification is sent to your configured webhook URL with the event order.created.
Next Steps
- Get Order - Retrieve order details
- Release Order - Release for dispatch
- Webhooks - Set up webhooks