Skip to main content

Create Order API

This endpoint allows you to create a new fulfillment order in the Bosta fulfillment system. You can specify the customer details, shipping address, and the products to be fulfilled.

POSThttps://api-fulfillment.bosta.co/api/v1/orders

REQUEST BODY

{
"orderAlias": "sec_order",
"uniqueOrderReference": "STORE-ORD-100245", // your own unique ID for this order, used as the idempotency key
"items": [
{
"skuCode": "product-1",
"quantity": 1,
"price": 100
}
],
"shippingAddress": {
"firstLine": "102 street mohamed abd el shafy, alexandria",
"cityName": "Alexandria",
"cityId": "Jrb6X6ucjiYgMP4T7",
"districtId": "zoJP71_5Ca1"
},
"shipment": {
"codAmount":"100",
"note":"deliver note",
"allowToOpenPackage":false
},
"customer": {
"firstName": "ahmed",
"mobile": "01028687408"
},
"externalPlatform": {
"platform": "custom_api", // it will be static
"webhookUrl": "http://your-system.com/webhook" // implement this api to receive status updates
},
"type": "FORWARD"
}

🔄 WEBHOOK CALLBACK (POST)

Bosta will send this data to your webhookUrl when the order status changes:

{
"id": "order.id",
"status": "status_string",
"type": "order.type",
"trackingNumber": "tracking_number",
"orderAlias": "your_alias",
"reason": "failure_reason"
}

Responses

201Order created successfully
 {
"success": true,
"message": "Order created successfully",
"data": {
"order": {
"id": "B12345"
}
}
}
400Validation error in request body
 {
"success": false,
"message": "Invalid data provided",
"errors": []
}
500Internal server error
 {
"success": false,
"message": "Something went wrong"
}

Idempotency with uniqueOrderReference​

  • uniqueOrderReference (string): A unique identifier for the order generated by your system (for example, your store's order number or a UUID). It acts as the idempotency key for order creation.

Network timeouts and retries can cause the same create request to be sent more than once. Bosta uses uniqueOrderReference to recognize repeated requests for the same order, so retrying a request with the same reference will not create a duplicate order.

How to use it:

  • Generate the reference once per order on your side and store it with the order.
  • Always send the same uniqueOrderReference when retrying a request for that order (for example, after a timeout or a 5xx response).
  • Never reuse a uniqueOrderReference for a different order — every new order must have a new reference.
  • Use a value that is meaningful to you (e.g. STORE-ORD-100245) so you can easily match Bosta orders back to orders in your system.
tip

orderAlias is a human-readable label for the order, while uniqueOrderReference is the key Bosta uses to prevent duplicate orders. Your system's internal order ID is usually the best choice for uniqueOrderReference.