getPricePackage
Returns available shipment quotations for a shipment handled by the selected courier.
Input parameters
| order_id | int | Order identifier |
| courier_code | varchar(20) | Courier code. Available only for selected integrations. |
| account_id | int | (optional) Courier API account id for the courier accounts retrieved from the request getCourierAccounts If omitted, the first account will be used. |
| fields | array | List of form fields retrieved from the request getCourierFields Each element must contain the field ID and a value compatible with its returned type. Dates must be provided as Unix timestamp integers in seconds. For a checkbox with multiple selections, each selected option must be sent as a separate array element. Numeric values must be sent as JSON numbers, not strings. The value "auto" can be used for cod, insurance and value_price when supported by the courier. |
| packages | array | Array of shipments. Required only when getCourierFields returns package_fields. When package_fields contains weight, the first shipment must include weight. Use field IDs returned in package_fields by getCourierFields as keys and values compatible with their returned types. Numeric values must be sent as JSON numbers and respect the decimal_places limit. Height, length and width must be sent in centimeters and weight in kilograms. |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| prices | array | List of available shipment quotations returned by the courier. |
| | - name | text | Service or carrier name returned by the courier |
| | - price | float | Shipment price |
| | - currency | text | Price currency code |
| | - info | text | Additional quotation details returned by the courier, such as surcharges |
| | - selected | bool | True when this quotation matches the service selected in the request. Returned only for that quotation. |
| header | text | Additional heading returned by the courier for the quotation result. Returned only when available. |
| notices | array | Additional transport information returned by the courier. Returned only when available. |
Sample
Input data:Output data:
A sample request in PHP: