Additional Fields
When tracking a page through several delivery services, you must provide additional information, such as the post code or recipient's surname. The list of all required and optional additional fields is sent in the extra_fields array of the Courier object. The values of the additional fields can be either random or selected only from the available options. Both options are described in this section.
1. Additional fields with random value
Object example:
{
"name": "zip",
"type": "text",
"placeholder": "Recipient post code",
"field_regexp": "^(3S|KG)([A-Z]{4}|)\\d{9}$",
"validate_regexp": "^[A-Z0-9]{5,8}$"
}
Object description:
Property | Type | Description |
---|---|---|
name | String | The name of the POST parameter where you must send the value when adding a package. It varies depending on the delivery service and field mapping. The current list of additional fields for each delivery service can be obtained from the API list of delivery services. |
type | String |
Additional field type: text - random value. |
placeholder | String | A description of the required additional information that should be provided in this field. |
field_regexp | String | A regular expression used to check if this field is required to get information from the delivery service. If the tracking number matches this regular expression, the field is required. |
validate_regexp | String | Regular expression used to check if the value of an additional field is entered correctly. |
2. Additional fields with value selected from the available options
Object example:
{
"name": "extra_destination_country",
"type": "dropdown",
"placeholder": "Destination country",
"field_regexp": "^(3S|KG)([A-Z]{4}|)\\d{9}$",
"values": {
"AU": "Australia",
"AT": "Austria",
"AZ": "Azerbaijan",
"AX": "Aland Islands"
}
}
Object description:
Property | Type | Description |
---|---|---|
name | String | The name of the POST parameter where you must send the value when adding a package. It varies depending on the delivery service and field mapping. The current list of additional fields for each delivery service can be obtained from the API list of delivery services. |
type | String |
Additional field type: dropdown - value selected from available options. |
placeholder | String | A description of the required additional information that should be provided in this field. |
field_regexp | String | A regular expression used to check if this field is required to get information from the delivery service. If the tracking number matches this regular expression, the field is required. |
values | String | List of available values and their descriptions. |