Generating tracking link
To generate a tracking link, you must make a request to the API using the POST method to the following endpoint:
Creating an order and generating the tracking link
Mandatory parameters
description
– Description of the order.status
– Object with data about the order status.value
– Possible values: ["PREPARING", "ON_THE_WAY", "DONE", "NOT_DONE", "CANCELLED"
].label
– Custom text to be displayed on the tracking page.
destination
– Object containing the destination location data.road
– (Optional) Street name of the destination location.number
– (Optional) Destination location number.city
– (Optional) City of destination location.zipCode
– (Optional) Zip code of the destination location.state
– (Optional) Object containing state data from the destination location.code
– State acronym.name
– State name.
mainLocation
– Object containing the coordinates of the destination location.lat
– Latitude coordinate in decimal degrees.lon
– Latitude coordinate in decimal degrees.
Example with mandatory parameters
{ "description": "Product Test", "status": { "value": "PREPARING", "label": "Estamos preparando o seu pedido" }, "destination": { "mainLocation": { "lat": -22.72725697031394, "lon": -47.636846753567944 } } }
Optional parameters
companyName
– Company Name.number
– Order number.theme
– Theme that will be used to customize the tracking page. If not informed, the white-label theme will be applied.estimatedArrival
– Delivery estimate. Format"yyyy-MM-ddTHH:mm:ss"
. Example:"2022-11-22T10:00:00"
totalValue
– Object containing the total value of the order.value
– Number representing the total value of the order.currency
– Currency. For Real, use BRL
origin
– Object containing data from the departure location.road
– (Optional) Street name of the departure location.number
– (Optional) Number of the departure location.city
– (Optional) City of departure location.zipCode
– (Opcional) Zip code of the departure location.state
– (Optional) Object containing data from the departure location.code
– State acronym.name
– State name.
mainLocation
– Object containing the coordinates of the departure location.lat
– Latitude coordinate in decimal degrees.lon
– Latitude coordinate in decimal degrees.
driver
– Object containing driver dataname
– (Optional) Driver nameimage
– (Optional) URL of the driver’s photo to be displayed on the websitecurrentLocation
– Object with the initial coordinates of the driver.lat
– Latitude coordinate in decimal degrees.lon
– Longitude coordinate in decimal degrees.
Note: If the order status isON_THE_WAY
, thedriver
parameter becomes mandatory.
Example with optional parameters
{ "number": "1232132132143438", "description": "Product Test", "estimatedArrival": "2022-11-22T10:00:00", "companyName": "Maplink", "totalValue": { "value": 23.12, "currency": "BRL" }, "status": { "value": "ON_THE_WAY", "label": "Pedido em trânsito" }, "origin": { "road": "Alameda Campinas", "number": "579", "city": "São Paulo", "zipCode": "01419001", "state": { "code": "SP", "name": "São Paulo" }, "mainLocation": { "lat": -22.7342864, "lon": -47.6480644 } }, "destination": { "road": "R. Menina Rosana", "number": "70", "city": "Itajaí", "zipCode": "88304250", "state": { "code": "SC", "name": "Santa Catarina" }, "mainLocation": { "lat": -22.72725697031394, "lon": -47.636846753567944 } }, "driver": { "name": "Maplink BR", "image": "https://example.com", "currentLocation": { "lat": -23.564515, "lon": -46.652681 } }, "theme": "DEFAULT" }
Response example
The response will have the following structure:
{ "id": "63a1b72fd2b7520ade692253", "url": "https://tracking.maplink.global/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjIjoicUJQRVJzWXBHdUJwOWtzeEExRUduY0lZbFZNOFVMZWUiLCJpZCI6IjYzYTFiNzJmZDJiNzUyMGFkZTY5MjI1MyIsImlhdCI6MTY3MTU0MjU3NX0.NzncB9t_1ShqnlbbS3O3gGt8E0_rloxKrMrmVDwcnQU" }
Where:
id
– Reference ID for the order;url
– Link to the tracking page.
Tracking Page
The white-label tracking page template can be seen below:
Consult order
To query the order, simply send a request with the GET method to the following endpoint: https://api.maplink.global/tracking/v1/orders/{{trackingId}}
Where the term {{trackingId}}
must be replaced by the ID of the request to be queried.
Orders and tracking links are available for consultation during a 7-day period.
Delete order
To delete a order, simply send a request with the DELETE method to the following endpoint:
https://api.maplink.global/tracking/v1/orders/{{trackingId}}
Where the term {{trackingId}}
must be replaced by the ID of the order to be deleted.