The Batch resource has the following attributes:
Attribute | Type | Description |
---|---|---|
id | Integer | Object ID |
status | String | Shipment processing status |
shipments | Array[Shipment ] | Shipments |
created_at | DateTime | Date created |
updated_at | DateTime | Date updated |
Sample Batch resource in the JSON format:
{ "href": "https://api-shipx-pl.easypack24.net/v1/batches/16", "id": 16, "status": "done", "shipments": [ { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/151", "id": 151, "status": "confirmed", "tracking_number": "633100159730624319900067" }, { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/150", "id": 150, "status": "confirmed", "tracking_number": "633100159730624319900068" } ], "created_at": "2017-06-08T14:17:25.675+02:00", "updated_at": "2017-06-08T14:17:25.675+02:00" }
Authentication
Access to the resource requires provision of the correct and valid access token.
Note! Debit clients
After creating a shipment, we do not return prices for debit clients.
The rate attribute takes the null value
Creating multiple shipments
POST /v1/organizations/:organization_id/batches
Parameters
Parameter | Type | Description | Validation | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
only_choice_of_offer | Boolean | Setting the parameter to true makes the offer in all shipments being selected for the stated service, but it will not be automatically paid. | The attribute • Default false | |||||||||
shipments | Array[Hash] |
| The attribute is not required. • Minimum 1 • Maximum 2500 |
Sample request
curl -X POST https://api-shipx-pl.easypack24.net/v1/organizations/1/batches -H 'Authorization: Bearer token' -H 'content-type: application/json' -d '{ "only_choice_of_offer": false, "shipments": [ { "id": 1, "service": "inpost_locker_standard", "reference": "Test", "custom_attributes": { "target_point": "KRA012" }, "parcels":{ "template": "small" }, "receiver": { "company_name": "Company name 1", "email": "sklep@inpost.pl", "phone": "888888888", "address": { "line1": "Zawila 65L", "city": "Krakow", "post_code": "30-390", "country_code": "PL" } }, "sender": { "company_name": "Company name 2", "email": "sklep@inpost.pl", "phone": "999999999", "address": { "line1": "Zawila 65L", "city": "Krakow", "post_code": "30-390", "country_code": "PL" } }, "cod": { "amount": 1, "currency": "PLN" }, "insurance": { "amount": 23, "currency": "PLN" } }, { "id": 2, "service": "inpost_locker_standard", "reference": "Test", "custom_attributes": { "target_point": "KRA012" }, "parcels":{ "template": "small" }, "receiver": { "company_name": "Company name 1", "email": "sklep@inpost.pl", "phone": "888888888", "address": { "line1": "Zawila 65L", "city": "Krakow", "post_code": "30-390", "country_code": "PL" } }, "sender": { "company_name": "Company name 2", "email": "sklep@inpost.pl", "phone": "999999999", "address": { "line1": "Zawila 65L", "city": "Krakow", "post_code": "30-390", "country_code": "PL" } }, "cod": { "amount": 1, "currency": "PLN" }, "insurance": { "amount": 23, "currency": "PLN" } } ] }'
Response
HTTP/1.1 201 Created Content-Type: application/json { "href": "https://api-shipx-pl.easypack24.net/v1/batches/1672413", "id": 1672413, "status": "in_progress", "shipments": [], "created_at": "2021-08-11T13:12:50.325+02:00", "updated_at": "2021-08-11T13:12:50.325+02:00" }
Information about errors
The server may return the following errors
- validation_failed - validation error
- forbidden - the action is unavailable for the token provided
- token_invalid - the user does not have access rights to the specified organization
Viewing multiple shipments
GET /v1/batches/:id
Sample request
curl -X GET https://api-shipx-pl.easypack24.net/v1/batches/16 -H 'Authorization: Bearer token' -H 'content-type: application/json'
Response
HTTP/1.1 200 OK Content-Type: application/json { "href": "https://api-shipx-pl.easypack24.net/v1/batches/16", "id": 16, "status": "done", "shipments": [ { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/151", "id": 151, "status": "confirmed", "tracking_number": "633100159730624319900067" }, { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/150", "id": 150, "status": "confirmed", "tracking_number": "633100159730624319900068" } ], "created_at": "2017-06-08T14:17:25.675+02:00", "updated_at": "2017-06-08T14:17:25.675+02:00" }
Information about errors
The server may return the following errors
• resource_not_found - in the event that to the batch does not exist
• token_invalid - the user does not have access rights to the specified organization