Wybór oferty
Na tej stronie
Wybór oferty
POST /v1/shipments/:shipment_id/select_offer |
Parametry
Parametr | Typ | Opis | Walidacja |
---|---|---|---|
| Integer | ID oferty | Atrybut jest wymagany
|
Przykład zapytania
curl -X POST https://api-shipx-pl.easypack24.net/v1/shipments/1/select_offer -H 'Authorization: Bearer token' -H 'Content-Type: application/json' -d '{
"offer_id": 183
}' |
Odpowiedź
HTTP/1.1 200 OK
Content-Type: application/json
{
"href": "https://api-shipx-pl.easypack24.net/v1/shipments/1",
"id": 1,
"status": "offer_selected",
"tracking_number": null,
"service": "inpost_locker_standard",
"reference": null,
"is_return": false,
"application_id": 1,
"created_by_id": null,
"external_customer_id": null,
"sending_method": null,
"additional_services": [],
"custom_attributes": {
"target_point": "KRA010"
},
"cod": {
"amount": null,
"currency": null
},
"insurance": {
"amount": null,
"currency": null
},
"sender": {
"id": 428,
"name": null,
"company_name": "Inittec Sp. z o.o. (API Tests)",
"first_name": null,
"last_name": null,
"email": "inittec@inpost.pl",
"phone": "121323123",
"address": {
"id": 434,
"street": "Zawiła",
"building_number": "65L",
"line1": null,
"line2": null,
"city": "Kraków",
"post_code": "30-390",
"country_code": "PL"
}
},
"receiver": {
"id": 427,
"name": null,
"company_name": "Inpost",
"first_name": null,
"last_name": null,
"email": "inpost@sklep.pl",
"phone": "888888888",
"address": {
"id": 433,
"street": "Zawila 65L",
"building_number": null,
"line1": null,
"line2": null,
"city": "Krakow",
"post_code": "30-390",
"country_code": "PL"
}
},
"selected_offer": {
"id": 203,
"status": "selected",
"expires_at": "2017-06-16T11:37:00.063+02:00",
"rate": 13.5,
"currency": "PLN",
"additional_services": [],
"carrier": {
"id": "inpost_locker",
"name": "InPost Paczkomaty",
"description": "InPost Paczkomaty - Przesyłki paczkomatowe."
},
"service": {
"id": "inpost_locker_standard",
"name": "Paczkomatowa Standardowa",
"description": "Przesyłka paczkomatowa standardowa."
},
"unavailability_reasons": null
},
"offers": [
{
"id": 203,
"status": "selected",
"expires_at": "2017-06-16T11:37:00.063+02:00",
"rate": 13.5,
"currency": "PLN",
"additional_services": [],
"carrier": {
"id": "inpost_locker",
"name": "InPost Paczkomaty",
"description": "InPost Paczkomaty - Przesyłki paczkomatowe."
},
"service": {
"id": "inpost_locker_standard",
"name": "Paczkomatowa Standardowa",
"description": "Przesyłka paczkomatowa standardowa."
},
"unavailability_reasons": null
}
],
"transactions": [],
"parcels": [
{
"id": 214,
"tracking_number": null,
"is_non_standard": false,
"template": null,
"dimensions": {
"length": 13,
"width": 20,
"height": 20,
"unit": "mm"
},
"weight": {
"amount": 1,
"unit": "kg"
}
}
],
"created_at": "2017-06-16T11:26:59.418+02:00",
"updated_at": "2017-06-16T11:27:54.819+02:00"
} |
Informacje o błędach
Serwer może zwrócić następujące błędy
validation_failed
- błąd walidacjiresource_not_found
- w przypadku gdy przesyłka nie istniejetoken_invalid
- użytkownik nie ma praw dostępu do określonej organizacji