REST API
TariffPilot offers a REST API for programmatically accessing PilotMemos.
The API is in early alpha and probably will change in the future. Please let us know, when you are using the API, so we can inform you about changes.
Authorization
All of the following endpoints require authorization with a bearer access token. Such an access token can be retrieved at cloud.tariffpilot.com in the tenant settings at tab API
. Please note that the access token is associated to the user account and tenant it has been generated for. Thus removing an user from a tenant invalidates the access token.
PilotMemos API
List All PilotMemos as JSON
Returns a JSON list of all PilotMemos in the tenant.
curl -X GET "https://app-cloud.tariffpilot.com/api/memos" \
-H "Authorization: Bearer <BEARER_TOKEN>" \
-H "Content-Type: application/json"
Get a PilotMemo as JSON
Returns a JSON representation of the PilotMemo in the tenant.
curl -X GET "https://app-cloud.tariffpilot.com/api/memos/<MEMO_ID>" \
-H "Authorization: Bearer <BEARER_TOKEN>" \
-H "Content-Type: application/json"
Delete a PilotMemo
Deletes the PilotMemo in the tenant.
curl -X DELETE "https://app-cloud.tariffpilot.com/api/memos/<MEMO_ID>" \
-H "Authorization: Bearer <BEARER_TOKEN>" \
-H "Content-Type: application/json"
Post a PilotMemo
Posts a JSON representation of a PilotMemo into the tenant.
curl -X POST "https://app-cloud.tariffpilot.com/api/memos" \
-H "Authorization: Bearer <BEARER_TOKEN>" \
-H "Content-Type: application/json" \
-d '{ "description": "Nici Einhorn 80cm", "direction": "export", "search_web": true }'
The property direction
is mandatory and can be either export
for 8-digit or import
for 11-digit customs code. The property search_web
is optional and defaults to false
. When set to true
, the web will be searched for the product descripton.
curl -X POST "https://app-cloud.tariffpilot.com/api/memos" \
-H "Authorization: Bearer <BEARER_TOKEN>" \
-H "Content-Type: application/json" \
-d '{ "description": "Nici Einhorn 80cm", "direction": "export", "job_id": <JOB_ID>, "search_web": true }'
The property job_id
is optional and can be used to associate the PilotMemo with a job. The job_id
must be a UUID4 string. If the job does not exist, it will be created.
Binding Tariff Information (BTI) API
Search for BTIs
Searches for up to 100 BTIs by a given search term.
curl -X POST "https://app-cloud.tariffpilot.com/api/bti/search" \
-H "Authorization: Bearer <BEARER_TOKEN>" \
-H "Content-Type: application/json" \
-d '{ "search": "Nici Einhorn 80cm" }'