The resource with prices for shipments has the following
Attribute | Description |
---|---|
id | Shipment ID. Required when converting prices for more than one shipment. |
calculated_charge_amount | Total price for the shipment. |
fuel_charge_amount | Fuel Fee |
notification_charge_amount | Fee for additional notification |
cod_charge_amount | Fee for a parcel with COD |
insurance_charge_amount | Shipment insurance fee |
calculated_charge_amount_non_commission | Fee calculated on the basis of the parcel sender's price list (PRICE) and it determines the Amount without charged Margins for optional services - This amount currently results directly from the size of the shipment. |
Sample resource in the JSON format:
[ { "id": "SHIPMENT1", "calculated_charge_amount": "27.20", "fuel_charge_amount": "0.00", "notification_charge_amount": "0.00", "cod_charge_amount": "0.00", "insurance_charge_amount": "20.00", "calculated_charge_amount_non_commission": "7.20", }, { "id": "SHIPMENT2", "calculated_charge_amount": "18.00", "fuel_charge_amount": null, "notification_charge_amount": null, "cod_charge_amount": null, "insurance_charge_amount": null, "calculated_charge_amount_non_commission": null, } ]
Authentication
Access to the resource and its methods requires provision of the correct and valid access token.
Recalculating prices for shipments
POST /v1/organizations/:organization_id/shipments/calculate
Parameters
Parameter | Type | Description |
---|---|---|
shipments | Array[Hash] | Includes shipment attributes for which the price should be calculated. |
Request example
curl -X POST https://api-shipx-pl.easypack24.net/v1/organizations/1/shipments/calculate -H 'Authorization: Bearer token' -H 'content-type: application/json' -d ' { "shipments": [ { "id": "SHIPMENT1", "receiver": { "email": "receiverrro32969504293051@example.com", "phone": "329695042", "first_name": "John Receiver32969504293051", "last_name": "Mc'Receiver32969504293051", "address":{ "line1":"Ulica jakaś32969504293051", "line2":"Budynek32969504293051", "city":"Szczecin32969504293051", "post_code":"00-001", "country_code":"PL" } }, "parcels": { "dimensions": { "length": "50", "width": "50", "height": "50", "unit": "mm" }, "weight": { "amount": "5", "unit": "kg" } }, "custom_attributes": { "target_point": "KRA010" }, "insurance": { "amount": 25, "currency": "PLN" }, "cod": { "amount": 10, "currency": "PLN" }, "service": "inpost_locker_standard" }, { "id": "SHIPMENT2", "receiver": { "email": "receiverrro32969504293051@example.com", "phone": "329695042", "first_name": "John Receiver32969504293051", "last_name": "Mc'Receiver32969504293051", "address":{ "line1":"Ulica jakaś32969504293051", "line2":"Budynek32969504293051", "city":"Szczecin32969504293051", "post_code":"00-001", "country_code":"PL" } }, "parcels": { "dimensions": { "length": "50", "width": "50", "height": "50", "unit": "mm" }, "weight": { "amount": "5", "unit": "kg" } }, "custom_attributes": { "target_point": "KRA010" }, "insurance": { "amount": 25, "currency": "PLN" }, "cod": { "amount": 10, "currency": "PLN" }, "service": "inpost_courier_standard" } ] }
Response
HTTP/1.1 200 OK Content-Type: application/json [ { "id": "SHIPMENT1", "calculated_charge_amount": "27.20", "fuel_charge_amount": "0.00", "notification_charge_amount": "0.00", "cod_charge_amount": "0.00", "insurance_charge_amount": "20.00", "calculated_charge_amount_non_commission": "7.20", }, { "id": "SHIPMENT2", "calculated_charge_amount": "18.00", "fuel_charge_amount": null, "notification_charge_amount": null, "cod_charge_amount": null, "insurance_charge_amount": null, "calculated_charge_amount_non_commission": null, } ]
In the case the logistic system does not return the prices for the data sent, an error message will be returned for a single shipment:
[ { "id": "SHIPMENT1", "calculated_charge_amount": "27.20", "fuel_charge_amount": "0.00", "notification_charge_amount": "0.00", "cod_charge_amount": "0.00", "insurance_charge_amount": "20.00", "calculated_charge_amount_non_commission": "7.20" }, { "id": "SHIPMENT2", "key": "no_offers", "message": "External logistic system responded with no offers." } ]