About this endpoint
What it does
Creates a shipment with Aramex, Bosta or the demo carrier and returns its tracking number. Send the shipper, the recipient and the parcel.
Request Body
| Parameter | Type | Description |
|---|---|---|
| carrier | ENUM | Required. Carrier to use. Allowed values: aramex, bosta, demo. demo answers without calling a carrier. |
| service | ENUM | Service level. Allowed values: domestic, express. |
| shipper | Object | Required. Shipper details. Includes contact, address, and optional account_number. |
| shipper.contact | Object | Required. Shipper contact details. Includes name, phone, and optional email, phone2, company. |
| shipper.contact.name | String | Required. Contact name. Length 1 to 150. |
| shipper.contact.email | String | Email address. Length 1 to 200. |
| shipper.contact.phone | String | Required. Phone number. Length 1 to 30. |
| shipper.contact.phone2 | String | Secondary phone number. Length 1 to 30. |
| shipper.contact.company | String | Company name. Length 1 to 150. |
| shipper.address | Object | Required. Shipper address details. Includes line1, city, country, and optional additional address fields. |
| shipper.address.city | String | Required. City. Length 1 to 100. |
| shipper.address.floor | String | Floor. Length 1 to 20. |
| shipper.address.line1 | String | Required. Address line 1. Length 1 to 300. |
| shipper.address.line2 | String | Address line 2. Length 1 to 300. |
| shipper.address.city_id | String | City identifier. Length 1 to 60. |
| shipper.address.country | String | Required. Country code in ISO 3166-1 alpha-2 format. Pattern: ^[A-Z]{2}$. |
| shipper.address.zone_id | String | Zone identifier. Length 1 to 60. |
| shipper.address.building | String | Building. Length 1 to 40. |
| shipper.address.district | String | District. Length 1 to 100. |
| shipper.address.postcode | String | Postcode. Length 1 to 20. |
| shipper.address.apartment | String | Apartment. Length 1 to 20. |
| shipper.address.district_id | String | District identifier. Length 1 to 60. |
| shipper.account_number | String | Shipper account number. Length 1 to 40. |
| recipient | Object | Required. Recipient details. Includes contact, address, and optional account_number. |
| recipient.contact | Object | Required. Recipient contact details. Includes name, phone, and optional email, phone2, company. |
| recipient.contact.name | String | Required. Contact name. Length 1 to 150. |
| recipient.contact.email | String | Email address. Length 1 to 200. |
| recipient.contact.phone | String | Required. Phone number. Length 1 to 30. |
| recipient.contact.phone2 | String | Secondary phone number. Length 1 to 30. |
| recipient.contact.company | String | Company name. Length 1 to 150. |
| recipient.address | Object | Required. Recipient address details. Includes line1, city, country, and optional additional address fields. |
| recipient.address.city | String | Required. City. Length 1 to 100. |
| recipient.address.floor | String | Floor. Length 1 to 20. |
| recipient.address.line1 | String | Required. Address line 1. Length 1 to 300. |
| recipient.address.line2 | String | Address line 2. Length 1 to 300. |
| recipient.address.city_id | String | City identifier. Length 1 to 60. |
| recipient.address.country | String | Required. Country code in ISO 3166-1 alpha-2 format. Pattern: ^[A-Z]{2}$. |
| recipient.address.zone_id | String | Zone identifier. Length 1 to 60. |
| recipient.address.building | String | Building. Length 1 to 40. |
| recipient.address.district | String | District. Length 1 to 100. |
| recipient.address.postcode | String | Postcode. Length 1 to 20. |
| recipient.address.apartment | String | Apartment. Length 1 to 20. |
| recipient.address.district_id | String | District identifier. Length 1 to 60. |
| recipient.account_number | String | Recipient account number. Length 1 to 40. |
| parcel | Object | Required. Parcel details. Includes weight_kg and description, plus optional size and dimensions. |
| parcel.size | ENUM | Parcel size. Allowed values: SMALL, MEDIUM, LARGE. |
| parcel.pieces | Integer | Number of pieces. Minimum 1, maximum 999. |
| parcel.width_cm | Number | Parcel width in centimeters. Minimum 0. |
| parcel.height_cm | Number | Parcel height in centimeters. Minimum 0. |
| parcel.length_cm | Number | Parcel length in centimeters. Minimum 0. |
| parcel.weight_kg | Number | Required. Parcel weight in kilograms. Minimum 0.01, maximum 1000. |
| parcel.description | String | Required. Parcel description. Length 1 to 300. |
| notes | String | Optional shipment notes. Length 1 to 500. |
| currency | String | Currency code in ISO 4217 format. Pattern: ^[A-Z]{3}$. |
| reference | String | Shipment reference. Length 1 to 60. |
| cod_amount | Number | Cash on delivery amount. Minimum 0. |
| credentials | Object | Carrier credentials used only for this request and never stored. For aramex: username, password, account_number, account_pin, account_entity, account_country_code. For bosta: api_key. |
| credentials.api_key | String | API key. Length 10 to 500. |
| credentials.password | String | Password. Length 1 to 200. |
| credentials.username | String | Username. Length 1 to 200. |
| credentials.account_pin | String | Account PIN. Length 1 to 40. |
| credentials.account_entity | String | Account entity. Length 1 to 10. |
| credentials.account_number | String | Account number. Length 1 to 40. |
| credentials.account_country_code | String | Account country code in ISO 3166-1 alpha-2 format. Pattern: ^[A-Z]{2}$. |
| environment | ENUM | Environment to use. Allowed values: production, test. Default: production. test uses the carrier test server. Aramex test mode is not available. |
| allow_open_package | Boolean | Whether an open package is allowed. |
Response
Returns a JSON object with data and meta. data holds the tracking number and the label fields.
| Parameter | Type | Description |
|---|---|---|
| data | Object | The created shipment. |
| data.carrier | String | Carrier that created the shipment: aramex, bosta or demo. |
| data.tracking_number | String | Tracking number of the new shipment. |
| data.label_url | String | Link to the label, or null when the carrier gives none. |
| data.label_pdf_base64 | String | Label as a base64 PDF, or null when the carrier gives none. |
| data.reference | String | Your reference from the request, or null when you sent none. |
| data.demo | Boolean | true when the demo carrier answered. Only returned for demo. |
| meta | Object | Request details. |
| meta.request_id | String | ID of this request, for example req_0faa849ae5aa449d. Quote it when you contact support. |
| meta.version | String | API version, for example v1. |
Notes
- Send your own carrier login in
credentials.aramexneedsusername,password,account_number,account_pin,account_entityandaccount_country_code.bostaneedsapi_key.demoneeds none. environmentisproductionortest. Default:production. Aramex test mode is not available: the API returns HTTP 422not_supported. Usecarrierdemoto try the API without a carrier call.- Errors return HTTP 422 with an
errorobject that hascode,messageandfield. A wrong carrier login returnscarrier_unauthorized. A missing login returnscredentials_required. - Returns HTTP 201 on success. The
democarrier returnslabel_urlandlabel_pdf_base64asnull. countryis a 2-letter uppercase code such asJOorEG.



