Zasób Batch
posiada następujące atrybuty:
Atrybut | Typ | Opis |
---|---|---|
id | Integer | Id obiektu |
status | String | Status przetwarzania przesyłek |
shipments | Array[Shipment ] | Przesyłki |
created_at | DateTime | Data utworzenia |
updated_at | DateTime | Data aktualizacji |
Przykład zasobu Batch
w formacie JSON:
Code Block |
---|
{ "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" } |
Uwierzytelnianie
Dostęp do zasobu wymaga podania prawidłowego i aktualnego access tokenu.
Info | ||
---|---|---|
| ||
Po utworzeniu przesyłki, nie zwracamy cen dla klientów debetowych. Atrybut rate przyjmuje wartość null |
Tworzenie wielu przesyłek
Code Block |
---|
POST /v1/organizations/:organization_id/batches |
Parametry
Parametr | Typ | Opis | Walidacja | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
only_choice_of_offer | Boolean | Ustawienie parametru na | Atrybut nie jest wymagany.
| |||||||||
shipments | Array[Hash] |
| Atrybut nie jest wymagany.
|
Przykład zapytania
Code Block |
---|
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": "KRA010" KRA012" }, "parcels":{ "template": "small" }, "receiver": { "name": "Name", "company_name": "Company name 1", "first_name": "Jan", "last_name": "Kowalski", "email": "sklep@inpostreceiver@example.plcom", "phone": "888888888888000000", "address": { "line1"street": "Cybernetyki", "building_number": "Zawila 65L10", "city": "KrakowWarszawa", "post_code": "3002-390677", "country_code": "PL" } }, "sender": { "company_name": "Company name 2Nazwa", "emailcompany_name": "sklep@inpostInPost S.A.pl", "phone"first_name": "999999999Jan", "address"last_name": { "line1"Nowak", "email": "Zawila 65Lsender@email.com", "city"phone": "Krakow888000000", "post_codeaddress": "30-390", "country_code{ "street": "PL" } }, "cod": { "amount": 1, "currencyMalborska", "building_number": "130", "city": "PLN" }, "insurance": { "amount": 23, "currencyKraków", "post_code": "30-624", "country_code": "PLNPL" } } }, { "id": 2, "service": "inpost_locker_standard", "reference": "Test", "custom_attributes": { "target_point": "KRA010KRA012" }, "parcels":{ "template": "small" }, "receiver": { "name": "Name", "company_name": "Company name 1", "first_name": "Jan", "last_name": "Kowalski", "email": "sklep@inpostreceiver@example.plcom", "phone": "888888888888000000", "address": { "street": "line1"Cybernetyki", "building_number": "Zawila 65L10", "city": "KrakowWarszawa", "post_code": "3002-390677", "country_code": "PL" } }, "sender": { "company_name": "Company name 2Nazwa", "email"company_name": "sklep@inpostInPost S.A.pl", "phonefirst_name": "999999999Jan", "addresslast_name": { "line1"Nowak", "email": "Zawila 65Lsender@email.com", "city"phone": "Krakow888000000", "post_codeaddress": "30-390", "country_code{ "street": "PL" } }, "cod": { "amount": 1, "currencyMalborska", "building_number": "130", "city": "PLN" }, "insurance": { "amount": 23, "currencyKraków", "post_code": "30-624", "country_code": "PLNPL" } } } ] }' |
Odpowiedź
Code Block |
---|
HTTP/1.1 201 Created Content-Type: application/json { "href": "https://api-shipx-pl.easypack24.net/v1/batches/351672310", "id": 351672310, "status": "in_progress", "shipments": [ { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/195", "id": 195, "status": "confirmed", "tracking_number": "520000017830390003337439" }, { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/195", "id": 195, "status": "offer_selected", "tracking_number": "520000017830390003337439" }, { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/196", "id": 196, "status": "create", "tracking_number": null } ], "created_at": "20172021-0608-12T1411T12:1958:2040.432579+02:00", "updated_at": "20172021-0608-12T1411T12:1958:2040.432579+02:00" } |
Informacje o błędach
Serwer może zwrócić następujące błędy
validation_failed
- błąd walidacjiforbidden
- akcja jest niedostępna dla podanego tokenutoken_invalid
- użytkownik nie ma praw dostępu do określonej organizacji
Podgląd wielu przesyłek
Code Block |
---|
GET /v1/batches/:id |
Przykład zapytania
Code Block |
---|
curl -X GET https://api-shipx-pl.easypack24.net/v1/batches/16 -H 'Authorization: Bearer token' -H 'content-type: application/json' |
Odpowiedź
Code Block |
---|
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" } |
Informacje o błędach
Serwer może zwrócić następujące błędy
resource_not_found
- w przypadku gdy batch nie istniejetoken_invalid
- użytkownik nie ma praw dostępu do określonej organizacji