Create Exchange Order API
The Exchange API is used when a customer wants to swap items. It handles the complexity of creating a new delivery while simultaneously initiating a return for the old items.
POST
https://api-fulfillment.bosta.co/api/v1/orders/exchangeCreate an exchange order. You must specify which items are being returned and which new items are being sent.
REQUEST BODY
{
"referenceOrderId": "bi2gKAXt6v3DoXO_1UPDEysY5D",
"returnItems": [
{
"orderItemId": "AA-1",
"skuCode": "AA-1",
"quantity": 1
}
],
"items": [
{
"skuCode": "AA-2",
"quantity": 1,
"price": 200
}
],
"shipment": {
"codAmount":"100",
"note":"deliver am",
"allowToOpenPackage":false
},
"customer": {
"firstName": "karim",
"lastName": "ahmed",
"mobile": "01234567890"
},
"shippingAddress": {
"firstLine": "new cairo elmarag",
"cityName": "Cairo",
"cityId": "FceDyHXwpSYYF9zGW",
"districtId": "Zd9YG_OW46x",
"buildingNumber": "1",
"floor": "2",
"apartment": "3",
"isWorkAddress": false
}
}
Responses
201Exchange order created successfully
Key Differences
- returnItems: Array of items the customer is giving back.
- items: Array of new items the customer will receive.
- allowToOpenPackage: A specific flag for exchanges to let the customer inspect the new item before handing over the return.
- referenceOrderId: Links this exchange to the original purchase for history and inventory tracking.