Info | ||
---|---|---|
| ||
Resource available only for specific countries: PL |
DispatchOrders allow to order 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 is not yet acceptedaccepted
- order is accepted to execution by the courierdone
- order is executedrejected
- order is rejected by the couriercanceled
- order is canceled
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Structure
DispatchOrder
resource has following attributes:
id
status
created_at
address
shipments
Array of shipments that will be taken by the courier. Required Shipment
attributes:
href
- shipment's url addressid
- shipment's idtracking_number
- shipment's tracking number
comment
Example of DispatchOrder
resource in JSON format:
DispatchOrders list
Listę zleceń odbioru w ramach określonej organizacji można pobrać pod adresem:
DispatchOrders list for specific organization can be accessed by using this endpoint:
Code Block |
---|
GET /v1/organizations/:organization_id/dispatch_orders |
Example request:
Code Block |
---|
curl -X GET https://api-shipx-pl.easypack24.net/v1/organizations/1/dispatch_orders -H 'Authorization: Bearer token' -H 'Content-Type: application/json' |
Example response:
Code Block |
---|
HTTP/1.1 200 OK
Content-Type: application/json
{
"href": "https://api-shipx-pl.easypack24.net/v1/organizations/1/dispatch_orders",
"count": 15,
"per_page": 30,
"page": 1,
"created_at": "2016-03-21T10:13:58.625+01:00",
"items": [
{
"href": "https://api-shipx-pl.easypack24.net/v1/dispatch_orders/3",
"id": 123,
... other attribute omitted for brevity ....
}
... other items omitted for brevity ...
]
} |
Possible Errors:
resource_not_found
- organization with this ID not existforbidden
- this is not valid token for this organization
DispatchOrder details
Code Block |
---|
GET /v1/dispatch_orders/:id |
Example request
Code Block |
---|
curl -X GET https://api-shipx-pl.easypack24.net/v1/dispatch_orders/1 -H 'Authorization: Bearer token' -H 'Content-Type: application/json' |
Example response
Possible Errors
resource_not_found
- when DispatchOrder with this id not exist
Creating new DispatchOrder
Info | ||
---|---|---|
| ||
Generating of 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 Next, |
Info | ||
---|---|---|
| ||
We are not showing prices after creation of DispatchOrder, for debit clients. price attribute will be returned as null. |
Code Block |
---|
POST /v1/organizations/:organization_id/dispatch_orders |
Available parameters:
dispatch_point_id
Address of this DispatchPoint will be assigned to DispatchOrder as a pick-up point.
In general this attribute is not required.
It is starting to be required, only when address
attribute is not provided.
shipments
List of shipments ids, for which DispatchOrder is being generated.
Attribute is required.
- Shipments must be in
confirmed
status and can't be assigned to any other DispatchOrder - All shipments must belong to the same carrier type.
- There is no option to join allegro and non-allegro shipments in the same DispatchOrder
- Allegro services can be joined together
- Non-allegro services can be joined together
comment
Attribute is not required for creating DispatchOrder.
But is is required when DispatchOrder is updated.
address
In general this attribute is not required.
It is starting to be required, only when dispatch_point_id
attribute is not provided.
Attribute is not required.
name
email
Example request:
Possible Errors
validation_failed
- provided data are incorrect, e.g DispatchPoint not exist or one of shipments is in incorrect statusinvalid_range
- invalid shipment id, e.g range of the id is not matching Integer typedispatch_point_and_address_cannot_be_mixed
- address
and dispatch_point_id
cant be provided at the same time Organisation organisation