Obtener una entrega
curl --request GET \
--url https://api.getjusto.com/api/v2/deliveries/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getjusto.com/api/v2/deliveries/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getjusto.com/api/v2/deliveries/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getjusto.com/api/v2/deliveries/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getjusto.com/api/v2/deliveries/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getjusto.com/api/v2/deliveries/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/deliveries/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"price": 123,
"status": "canceled",
"placeName": "<string>",
"isCash": "<string>",
"fromLocation": {
"address": "<string>",
"addressSecondary": "<string>",
"storeName": "<string>",
"lat": -33.4489,
"lng": -70.6693
},
"toLocation": {
"address": "<string>",
"addressSecondary": "<string>",
"storeName": "<string>",
"lat": -33.4489,
"lng": -70.6693
},
"receiveProofImage": "<string>",
"deliverProofImage": "<string>",
"driverPassword": "<string>",
"activatesAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"forDate": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"nearStoreAt": "2023-11-07T05:31:56Z",
"nearClientAt": "2023-11-07T05:31:56Z",
"deliveryExpectedAt": "2023-11-07T05:31:56Z",
"driverReceivedAt": "2023-11-07T05:31:56Z",
"trackingURL": "<string>",
"deliveryInformation": "<string>",
"driverInformation": {
"code": "<string>",
"type": "<string>",
"phone": "<string>",
"name": "<string>",
"categoryId": "<string>",
"image": "<string>"
},
"instructions": "<string>",
"specialCode": "<string>",
"externalId": "<string>",
"orderId": "<string>",
"uncompletedReason": "<string>"
}{
"status": "error",
"error": "Error en la petición"
}{
"status": "error",
"error": "Unauthorized"
}Ultima milla
Consultar información de despacho
Usa este metodo para consultar el estado del despacho
GET
/
deliveries
/
{id}
Obtener una entrega
curl --request GET \
--url https://api.getjusto.com/api/v2/deliveries/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getjusto.com/api/v2/deliveries/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getjusto.com/api/v2/deliveries/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getjusto.com/api/v2/deliveries/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getjusto.com/api/v2/deliveries/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getjusto.com/api/v2/deliveries/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/deliveries/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"price": 123,
"status": "canceled",
"placeName": "<string>",
"isCash": "<string>",
"fromLocation": {
"address": "<string>",
"addressSecondary": "<string>",
"storeName": "<string>",
"lat": -33.4489,
"lng": -70.6693
},
"toLocation": {
"address": "<string>",
"addressSecondary": "<string>",
"storeName": "<string>",
"lat": -33.4489,
"lng": -70.6693
},
"receiveProofImage": "<string>",
"deliverProofImage": "<string>",
"driverPassword": "<string>",
"activatesAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"forDate": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"nearStoreAt": "2023-11-07T05:31:56Z",
"nearClientAt": "2023-11-07T05:31:56Z",
"deliveryExpectedAt": "2023-11-07T05:31:56Z",
"driverReceivedAt": "2023-11-07T05:31:56Z",
"trackingURL": "<string>",
"deliveryInformation": "<string>",
"driverInformation": {
"code": "<string>",
"type": "<string>",
"phone": "<string>",
"name": "<string>",
"categoryId": "<string>",
"image": "<string>"
},
"instructions": "<string>",
"specialCode": "<string>",
"externalId": "<string>",
"orderId": "<string>",
"uncompletedReason": "<string>"
}{
"status": "error",
"error": "Error en la petición"
}{
"status": "error",
"error": "Unauthorized"
}Descripción
Este método posibilita la consulta de la información y el estado actual de un despacho (Delivery) específico. Esta función es esencial para el seguimiento y la gestión de entregas, ya que permite que tanto el usuario como el sistema obtengan los datos actualizados sobre cada proceso de despacho.Authorizations
Response
success
Estado del pedido. Puede tomar los siguientes valores:
canceled: Pedido cancelado.pending: Pedido pendiente.scheduled: Pedido programado.active: En camino a buscar el pedido.delivering: En proceso de entrega.done: Pedido completado.Dispatch not completed: No se pudo completar el pedido. En el campo uncompletedReason podrá encontrar el motivo porque no se pudo completar la entrega.error: Error en el pedido.
Available options:
canceled, pending, scheduled, active, delivering, done, Dispatch not completed, error