getCourierFields
The method allows you to retrieve the form fields for creating shipments for the selected courier.
Input parameters
Output data:
A sample request in PHP:
courier_code | varchar(20) | Courier code |
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 |
multi_packages | bool | Does the courier support multiple shipments (0/1). |
fields | array | An array with a list of fields to create a shipment containing the fields listed below. |
| - id | varchar(50) | The field ID |
| - name | varchar(50) | The field name |
| - type | varchar(10) | Field type (available select, checkbox, text, date) |
| - desc | text | Additional field description |
| - options | array | List of available options (appears for select, checkbox). The key to each element is the option id (varchar) The value is the option name (varchar) |
| - show_field | array | List of additional fields that are available for the selected option. The key for each element is (varchar) - id of the option for which additional fields (varchar) are to be available The value is the list of fields that are available for this option (array) |
| - value | varchar(50) | Default value for a field |
| - function | varchar(20) | If this value is not empty, it means that the field has dynamic options and in order to download the current options for a particular order, you should retrieve with the getCourierServices" request |
package_fields | array | An array with a list of fields to create packages containing the fields listed below. The completed list of these fields must be provided to the createPackage method under the packages key as an array of objects. |
| - id | varchar(50) | The field ID |
| - name | varchar(50) | The field name |
| - type | varchar(10) | Field type (available select, checkbox, text) |
Sample
Input data:Output data:
A sample request in PHP: