[1.23.0] Dispatch Orders
Warning!
Resource available only for specific countries: PL
DispatchOrders allow ordering courier to collect shipments from the client.
Each DispatchOrder has status, which describing it's state. Available statuses:
new
- new order, which is not yet passed to executionsent
- order is passed to execution, but is not yet accepted
Structure
DispatchOrder
resource has the following attributes:
Attribute | Type | Description | Availability |
---|---|---|---|
| String | ID number (read-only) | PL |
| String | Order status | PL |
| DateTime | Timestamp describing when order was created | PL |
| Address | Address, where courier will take over shipments | PL |
| Array[Shipment] | Array of shipments that will be taken by the courier. Required
| PL |
| String | Optional comments for the DispatchOrder | PL |
Example of DispatchOrder
resource in JSON format:
{
"href": "https://api-shipx-pl.easypack24.net/v1/dispatch_orders/1",
"id": 1,
"status": "sent",
"address": {
"id": "123",
"street": "Tottenham Court Road",
"building_number": "14",
"post_code": "W1T 1JY",
"city": "London",
"country_code": "GB"
},
"shipments": [
{
"href": "https://api-shipx-pl.easypack24.net/v1/shipments/8",
"id": 8,
"tracking_number": "622111081631876319900026"
}
],
"comments": [
{
"24",
"comment": "Some Test Comment",
"created_at": "2018-02-14T11:37:07.852+01:00"
}
],
"created_at": "2018-02-14T11:37:07.843+01:00",
"updated_at": "2018-02-14T11:37:08.340+01:00"
}
Creating new DispatchOrder
DispatchOrder for specific address
Generating of DispatchOrder
require providing correct address using address
attribute.
Using data from address, algorithm is calculating checksum, so it is very important to provide correct address without typos etc.
Later, this checksum is used to determine if this DispatchPoint
is already registered in our database. If not, a new DispatchPoint
is generated (only for locker's shipments).
Next, DispatchPoint
found or generated this way is assigned to DispatchOrder
for the courier, allowing order execution.
Warning! Debit clients
We are not showing prices after creation of DispatchOrder, for debit clients.
price
attribute will be returned as null.
POST /v1/organizations/:organization_id/dispatch_orders
Available parameters:
Parameter | Type | Description | Validation | Availability |
---|---|---|---|---|
| Integer | Id of DispatchPoint for the place, from where shipment should be taken by the courier. | In general, this attribute is not required. It is starting to be required, only when | PL |
| Array | List of shipments ids, for which DispatchOrder is being generated.
| Attribute is required.
| PL |
| String | Optional comment | The attribute is not required for creating DispatchOrder. But is required when DispatchOrder is updated. | PL |
| Address | Address of pick-up point (DispatchPoint) | Attribute is required. | PL |
| String | Describing time when DispatchPoint is available for picking up shipments. | Attribute is not required. | PL |
| String | Name used for generating new DispatchPoint in our database. | Attribute is required. | PL |
| String | Phone number used for generating DispatchPoint. | Attribute is required. | PL |
| String | Email address used for generating DispatchPoint. | Attribute is not required. | PL |
Example request:
curl -X POST https://api-shipx-pl.easypack24.net/v1/organizations/1/dispatch_orders -H 'Authorization: Bearer token' -H 'Content-Type: application/json' -d '{
"shipments": ["1", "2"],
"comment": "Dowolny komentarz do zlecenia odbioru",
"name": "Przykładowa nazwa DispatchPoint",
"phone": "505404202",
"email": "sample@email.com",
"address": {
"street": "Malborska",
"building_number": "130",
"city": "Krakow",
"post_code": "31-209",
"country_code": "PL"
}
}'
Example response
DispatchOrders list
DispatchOrders list for specific organization can be accessed by using this endpoint:
Example request:
Example response:
DispatchOrder details
Example request
Example response
Deleting Dispatch Orders
Dispatch order Can be deleted in the following statuses only: new, sent
Example request
Response
Creating Dispatch Order comment
When creating a dispatch order, we allow adding additional comments.
Additionally, we allow creating a comment for an already existing Dispatch Order.
Request example
Response
Editing Dispatch Order comments
When creating a dispatch order, we allow adding additional comments.
Additionally, we allow editing a comment for an already existing Dispatch Order.
Request example
Response
Deleting Dispatch Order comment
We allow deleting a comment for an already existing Dispatch Order.
Request example
Response