{"id":2870,"date":"2023-12-22T22:01:42","date_gmt":"2023-12-22T22:01:42","guid":{"rendered":"https:\/\/developers.maplink.global\/generating-tracking-link\/"},"modified":"2024-03-05T13:31:58","modified_gmt":"2024-03-05T13:31:58","slug":"generating-tracking-link","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/generating-tracking-link\/","title":{"rendered":"Generating tracking link"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li><a href=\"#criando\">Creating an order and generating the tracking link<\/a><\/li>\n\n\n\n<li><a href=\"#pagina\">Tracking Page<\/a><\/li>\n\n\n\n<li><a href=\"#consulta\">Consult order<\/a><\/li>\n\n\n\n<li><a href=\"#exclusao\" data-type=\"internal\" data-id=\"#exclusao\">Delete order<\/a><\/li>\n<\/ul>\n\n<p>To generate a tracking link, you must make a request to the API using the <strong>POST<\/strong> method to the following <em>endpoint<\/em>:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.maplink.global\/tracking\/v1\/orders\">https:\/\/api.maplink.global\/tracking\/v1\/orders<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">POST<\/mark><\/strong><\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\" id=\"criando\">Creating an order and generating the tracking link<\/h2>\n\n<h3 class=\"wp-block-heading\"><strong>Mandatory parameters<\/strong><\/h3>\n\n<ul class=\"wp-block-list\">\n<li><code>description<\/code> &#8211; Description of the order.<\/li>\n\n\n\n<li><code>status<\/code> &#8211; Object with data about the order status.\n<ul class=\"wp-block-list\">\n<li><code>value<\/code> &#8211; Possible values: [<code>\"PREPARING\", \"ON_THE_WAY\", \"DONE\", \"NOT_DONE\", \"CANCELLED\"<\/code>].<\/li>\n\n\n\n<li><code>label<\/code> &#8211; Custom text to be displayed on the tracking page.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>destination<\/code> &#8211; Object containing the destination location data.\n<ul class=\"wp-block-list\">\n<li><code>road<\/code> &#8211; (Optional) Street name of the destination location.<\/li>\n\n\n\n<li><code>number<\/code> &#8211; (Optional) Destination location number.<\/li>\n\n\n\n<li><code>city<\/code> &#8211; (Optional) City of destination location.<\/li>\n\n\n\n<li><code>zipCode<\/code> &#8211; (Optional) Zip code of the destination location.<\/li>\n\n\n\n<li><code>state<\/code> &#8211; (Optional) Object containing state data from the destination location.\n<ul class=\"wp-block-list\">\n<li><code>code<\/code> &#8211; State acronym.<\/li>\n\n\n\n<li><code>name<\/code> &#8211; State name.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>mainLocation<\/code> &#8211; Object containing the coordinates of the destination location.\n<ul class=\"wp-block-list\">\n<li><code>lat<\/code>  &#8211; Latitude coordinate in decimal degrees.<\/li>\n\n\n\n<li><code>lon<\/code>  &#8211; Latitude coordinate in decimal degrees.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<h3 class=\"wp-block-heading\"><strong><em>Example with mandatory parameters<\/em><\/strong><\/h3>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"description\": \"Product Test\",\n    \"status\": {\n        \"value\": \"PREPARING\",\n        \"label\": \"Estamos preparando o seu pedido\"\n    },\n    \"destination\": {\n        \"mainLocation\": {\n            \"lat\": -22.72725697031394,\n            \"lon\": -47.636846753567944\n        }\n    }\n}<\/pre>\n\n<h3 class=\"wp-block-heading\"><strong>Optional parameters<\/strong><\/h3>\n\n<ul class=\"wp-block-list\">\n<li><code>companyName<\/code> &#8211; Company Name.<\/li>\n\n\n\n<li><code>number<\/code> &#8211; Order number.<\/li>\n\n\n\n<li><code>theme<\/code> &#8211; Theme that will be used to customize the tracking page. If not informed, the <em>white-label<\/em> theme will be applied.<\/li>\n\n\n\n<li><code>estimatedArrival<\/code> &#8211; Delivery estimate. Format <code>\"yyyy-MM-ddTHH:mm:ss\"<\/code>. Example:  <code>\"2022-11-22T10:00:00\"<\/code><\/li>\n\n\n\n<li><code>totalValue<\/code> &#8211; Object containing the total value of the order.\n<ul class=\"wp-block-list\">\n<li><code>value<\/code> &#8211; Number representing the total value of the order.<\/li>\n\n\n\n<li><code>currency<\/code> &#8211; Currency. For Real, use BRL<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>origin<\/code> &#8211; Object containing data from the departure location.\n<ul class=\"wp-block-list\">\n<li><code>road<\/code> &#8211; (Optional) Street name of the departure location.<\/li>\n\n\n\n<li><code>number<\/code> &#8211; (Optional) Number of the departure location.<\/li>\n\n\n\n<li><code>city<\/code> &#8211; (Optional) City of departure location.<\/li>\n\n\n\n<li><code>zipCode<\/code> &#8211; (Opcional) Zip code of the departure location.<\/li>\n\n\n\n<li><code>state<\/code> &#8211; (Optional) Object containing data from the departure location.\n<ul class=\"wp-block-list\">\n<li><code>code<\/code> &#8211; State acronym.<\/li>\n\n\n\n<li><code>name<\/code> &#8211; State name.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>mainLocation<\/code> &#8211; Object containing the coordinates of the departure location.\n<ul class=\"wp-block-list\">\n<li><code>lat<\/code>  &#8211; Latitude coordinate in decimal degrees.<\/li>\n\n\n\n<li><code>lon<\/code>  &#8211; Latitude coordinate in decimal degrees.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>driver<\/code> &#8211; Object containing driver data\n<ul class=\"wp-block-list\">\n<li><code>name<\/code> &#8211; (Optional) Driver name<\/li>\n\n\n\n<li><code>image<\/code> &#8211; (Optional) URL of the driver&#8217;s photo to be displayed on the website<\/li>\n\n\n\n<li><code>currentLocation<\/code> &#8211; Object with the initial coordinates of the driver.\n<ul class=\"wp-block-list\">\n<li><code>lat<\/code>  &#8211; Latitude coordinate in decimal degrees.<\/li>\n\n\n\n<li><code>lon<\/code>  &#8211; Longitude coordinate in decimal degrees.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<cite><strong>Note: <\/strong>If the order status is <code>ON_THE_WAY<\/code>, the <code>driver<\/code> parameter becomes mandatory.<\/cite><\/blockquote>\n\n<p><\/p>\n\n<h3 class=\"wp-block-heading\"><strong><em>Example with optional parameters<\/em><\/strong><\/h3>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n  \"number\": \"1232132132143438\",\n  \"description\": \"Product Test\",\n  \"estimatedArrival\": \"2022-11-22T10:00:00\",\n  \"companyName\": \"Maplink\",\n  \"totalValue\": {\n    \"value\": 23.12,\n    \"currency\": \"BRL\"\n  },\n  \"status\": {\n    \"value\": \"ON_THE_WAY\",\n    \"label\": \"Pedido em tr\u00e2nsito\"\n  },\n  \"origin\": {\n    \"road\": \"Alameda Campinas\",\n    \"number\": \"579\",\n    \"city\": \"S\u00e3o Paulo\",\n    \"zipCode\": \"01419001\",\n    \"state\": {\n      \"code\": \"SP\",\n      \"name\": \"S\u00e3o Paulo\"\n    },\n    \"mainLocation\": {\n      \"lat\": -22.7342864,\n      \"lon\": -47.6480644\n    }\n  },\n  \"destination\": {\n    \"road\": \"R. Menina Rosana\",\n    \"number\": \"70\",\n    \"city\": \"Itaja\u00ed\",\n    \"zipCode\": \"88304250\",\n    \"state\": {\n      \"code\": \"SC\",\n      \"name\": \"Santa Catarina\"\n    },\n    \"mainLocation\": {\n      \"lat\": -22.72725697031394,\n      \"lon\": -47.636846753567944\n    }\n  },\n  \"driver\": {\n    \"name\": \"Maplink BR\",\n    \"image\": \"https:\/\/example.com\",\n    \"currentLocation\": {\n      \"lat\": -23.564515,\n      \"lon\": -46.652681\n    }\n  },\n  \"theme\": \"DEFAULT\"\n}<\/pre>\n\n<h3 class=\"wp-block-heading\">Response example<\/h3>\n\n<p>The response will have the following structure:<\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"id\": \"63a1b72fd2b7520ade692253\",\n    \"url\": \"https:\/\/tracking.maplink.global\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjIjoicUJQRVJzWXBHdUJwOWtzeEExRUduY0lZbFZNOFVMZWUiLCJpZCI6IjYzYTFiNzJmZDJiNzUyMGFkZTY5MjI1MyIsImlhdCI6MTY3MTU0MjU3NX0.NzncB9t_1ShqnlbbS3O3gGt8E0_rloxKrMrmVDwcnQU\"\n}<\/pre>\n\n<p>Where:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><code>id<\/code> &#8211; Reference ID for the order;<\/li>\n\n\n\n<li><code>url<\/code> &#8211; Link to the tracking page.<\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\" id=\"pagina\"><strong>Tracking Page<\/strong><\/h2>\n\n<p>The <em>white-label<\/em> tracking page template can be seen below:<\/p>\n\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"312\" src=\"https:\/\/lh7-us.googleusercontent.com\/2zYOmYIWhYG3ua5GFM0f3QlgVoDYbHoI6vcn3JB2wxwQIdtMA9LB90y77bIUYBHJvhQllbs-G_Xc4k8TcaJq_HZeNkhJ7Hx5f_Hb18SdsCtaG39L2s8IUuN854Uy32V4UUIY3-oPcNOfrZdQmVvSNws\"\/><\/p>\n\n<h2 class=\"wp-block-heading\" id=\"consulta\"><strong>Consult order<\/strong><\/h2>\n\n<p>To query the order, simply send a request with the <strong>GET<\/strong> method to the following endpoint: <a href=\"https:\/\/api.maplink.global\/tracking\/v1\/orders\/%7B%7BtrackingId%7D%7D\">https:\/\/api.maplink.global\/tracking\/v1\/orders\/<strong>{{trackingId}}<\/strong><\/a><\/p>\n\n<p>Where the term <code>{{trackingId}}<\/code> must be replaced by the ID of the request to be queried.<\/p>\n\n<p>Orders and tracking links are available for consultation during a <strong>7-day period<\/strong>.<\/p>\n\n<h2 class=\"wp-block-heading\" id=\"exclusao\"><strong>Delete order<\/strong><\/h2>\n\n<p>To delete a order, simply send a request with the <strong>DELETE<\/strong> method to the following endpoint:<\/p>\n\n<p><a href=\"https:\/\/api.maplink.global\/tracking\/v1\/orders\/%7B%7BtrackingId%7D%7D\">https:\/\/api.maplink.global\/tracking\/v1\/orders\/<strong>{{trackingId}}<\/strong><\/a><\/p>\n\n<p>Where the term <code>{{trackingId}}<\/code> must be replaced by the ID of the order to be deleted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 Example with mandatory parameters Optional parameters Note: If the order status is ON_THE_WAY, the driver parameter becomes mandatory. Example with optional parameters Response example [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[171],"tags":[],"class_list":["post-2870","post","type-post","status-publish","format-standard","hentry","category-tracking-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/comments?post=2870"}],"version-history":[{"count":3,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2870\/revisions"}],"predecessor-version":[{"id":2873,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2870\/revisions\/2873"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}