We allow additional comments to be provided for an existing collection order. In addition, we allow updates of a comment assigned to a particular collection order.
We allow additional comments to be provided for an existing collection order. In addition, we allow updates of a comment assigned to a particular collection order.
Sample request
Creating a collection order, we allow an optional comment to be provided.
In addition, we allow other comments to be added to an already existing collection order.
Collection orders allow for ordering a courier visit in order to collect an earlier prepared shipment.
Every collection order has a status which determines its condition. The statuses supported are:
• new - a new collection order which has not been transferred to processing yet,
• sent - the collection order has been transferred to processing, but has not been accepted yet,
• accepted - the order has been accepted for processing by the courier,
• done - the collection order has been completed,
• rejected - the collection order has been rejected by the courier,
• canceled - the order has been canceled,
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
The DispatchOrder resource has the following attributes:
Description
href
URI to the resource.
id
Collection order ID. Read-only.
status
Collection order status.
created_at
Collection order creation time.
address
Address which the collection is to be made from.
shipments
Table of shipments the collection order applies to. The Shipment object contains the attributes:
• href - shipment's URI address,
• id - shipment's ID,
• tracking_number - shipment's tracking number.
Optional comment to the collection order
Sample DispatchOrder resource in the JSON format:
Code Block |
---|
{
"href": "https://api-shipx-pl.easypack24.net/v1/dispatch_orders/1",
"id": 1,
"status": "sent",
"address": {
"id": "123",
"street": "Malborska",
"building_number": "130",
"post_code": "30-624",
"city": "Kraków",
"country_code": "PL",
},
"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"
} |
Authentication
Access to the resource and its methods requires provision of the correct and valid access token.
Info | ||
---|---|---|
| ||
After creating a collection order, we do not return prices for debit clients. |
Creating a new collection order
codeorgParametersSample request
dispatch_point_id
ID of the dispatch point which the shipment is to be collected from (the dispatch point address will become the collection order address).
The attribute is not required.
It is required when the address attribute is not provided
shipments
List of shipment IDs which the collection order is to be created for.
The attribute is required.
• The parcels must be in the confirmed status and cannot be assigned to a different collection order in the new, sent, accepted or done status.
• In addition, they must be parcels from the same carrier.
• It is not possible to create one collection order for allegro and other shipments.
• Shipments can be either for allegro, or any other.
comment
Optional comment to the collection order
The attribute is not required to create a collection order.
It becomes required when creating a comment to an already existing collection order.
address
Collection order address
The attribute is not required.
It is required when the dispatch_point_id attribute is not provided
Point working hours
The attribute is not required.
Determines the point's working hours, if we create a collection order for an address.
Shipments collection order for address
Generation of an order for an address makes the address necessary to be provided by the address attribute Address object
The system generates the checksum from the information provided, attention has to be paid to ensure that the address is exact and without errors (the so-called typographic errors)
Based on the checksum, the system verifies whether a dispatch point with the same address exists in the database, if not, a new dispatch point is automatically generated (applies only to parcel station shipments).
The collection order (DispatchOrder) is executed to the newly generated dispatch point (DispachPoint).
Errors
• validation_failed - data sent by the user are incorrect, e.g. the stated dispatch point or any of the shipments has an incorrect status
• invalid_range - an incorrect shipment ID range has been provided, the range is not within the range of Integer values
• dispatch_point_and_address_cannot_be_mixed - It is not allowed to simultaneously assign collection orders for an address and a dispatch point id
Collecting information about a collection order
Code Block |
---|
GET /v1/dispatch_orders/:order_id |
Sample request
Response
Errors
resource_not_found
- in the event that the order with the stated ID is not found.
Removing a collection order
A collection order can only be deleted when it has new or sent status.
Code Block |
---|
DELETE /v1/dispatch_orders/1 |
Sample request
Code Block |
---|
DELETE /v1/dispatch_orders/1 HTTP/1.1
Host: api-shipx-pl.easypack24.net
Content-Type: application/json
Authorization: Bearer lkfjasd9f70y43ohriw...[ommited for brevity]... |
Response
Code Block |
---|
HTTP/1.1 204 No Content
Content-Type: application/json |
Errors
resource_not_found
- in the event that the order with the stated ID is not found,invalid_status
- in the event that the order with the stated ID is in a different status than new or sent,
List of collection orders
The collection orders list within the given organization can be collected at:
Code Block |
---|
GET /v1/organizations/:organization_id/dispatch_orders |
Sample request
Code Block |
---|
GET /v1/organizations/12345/dispatch_orders HTTP/1.1
Host: api-shipx-pl.easypack24.net
Content-Type: application/json
Authorization: Bearer lkfjasd9f70y43ohriw...[ommited for brevity]... |
In reply to a correctly sent request, the server will return a response with HTTP 200 OK code:
forbidden
- the token does not authorize to collect the collection orders list for the selected organization..Creating a comment to a collection order
Creating a collection order, we allow an optional comment to be provided.
In addition, we allow other comments to be added to an already existing collection order.codeSample request:organization_id:dispatch_order_idHTTP/1.1 Host: api-shipx-pl.easypack24.net Authorization: Bearer lkfjasd9f70y43ohriw...[ommited for brevity]... " }In reply to a correctly sent request, the server will return a response with HTTP 201 Created code:
codeTojestjakisnastepnytestowykomentarzUpdating a comment to a collection order
We allow additional comments to be provided for an existing collection order.
In addition, we allow updates of a comment assigned to a particular collection order.
codeSample request:organization_id:dispatch_order_idHTTP/1.1 Host: api-shipx-pl.easypack24.net Authorization: Bearer lkfjasd9f70y43ohriw...[ommited for brevity]...In reply to a correctly sent request, the server will return a response with HTTP 201 Created code:
code Errors that may occur when collecting the collection orders list: - the organization which the user wants to collect the collection orders list for does not exist,forbidden
- the token does not authorize to collect the collection orders list for the selected organization.Delete comment to the dispatch order
For the existing dispatch order, we provide option of delete additional comments.
In response to a request sent correctly, the server returns the response with code HTTP 200 OK:
The errors that can occur while retrieving the list of receiving orders:
resource_not_found
- organization for which the user wants to get a list of dispatch orders, does not exist,forbidden
- the token does not entitle the user to get the list of dispatch orders for the selected organization.