Crear una entrega externa
curl --request POST \
--url https://api.getjusto.com/api/v2/deliveries/externalDelivery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"originAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placePhone": "<string>",
"placeName": "<string>"
},
"destinationAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placeName": "<string>"
},
"storeId": "<string>",
"externalId": "<string>",
"tipAmount": 123,
"expectedDate": "2023-11-07T05:31:56Z",
"contents": [
{
"quantity": 123,
"name": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://api.getjusto.com/api/v2/deliveries/externalDelivery"
payload = {
"originAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placePhone": "<string>",
"placeName": "<string>"
},
"destinationAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placeName": "<string>"
},
"storeId": "<string>",
"externalId": "<string>",
"tipAmount": 123,
"expectedDate": "2023-11-07T05:31:56Z",
"contents": [
{
"quantity": 123,
"name": "<string>",
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
originAddress: {
latitude: '<string>',
longitude: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
placePhone: '<string>',
placeName: '<string>'
},
destinationAddress: {
latitude: '<string>',
longitude: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
placeName: '<string>'
},
storeId: '<string>',
externalId: '<string>',
tipAmount: 123,
expectedDate: '2023-11-07T05:31:56Z',
contents: [{quantity: 123, name: '<string>', description: '<string>'}]
})
};
fetch('https://api.getjusto.com/api/v2/deliveries/externalDelivery', 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/externalDelivery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'originAddress' => [
'latitude' => '<string>',
'longitude' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'placePhone' => '<string>',
'placeName' => '<string>'
],
'destinationAddress' => [
'latitude' => '<string>',
'longitude' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'placeName' => '<string>'
],
'storeId' => '<string>',
'externalId' => '<string>',
'tipAmount' => 123,
'expectedDate' => '2023-11-07T05:31:56Z',
'contents' => [
[
'quantity' => 123,
'name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getjusto.com/api/v2/deliveries/externalDelivery"
payload := strings.NewReader("{\n \"originAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placePhone\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"destinationAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"storeId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tipAmount\": 123,\n \"expectedDate\": \"2023-11-07T05:31:56Z\",\n \"contents\": [\n {\n \"quantity\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getjusto.com/api/v2/deliveries/externalDelivery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"originAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placePhone\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"destinationAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"storeId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tipAmount\": 123,\n \"expectedDate\": \"2023-11-07T05:31:56Z\",\n \"contents\": [\n {\n \"quantity\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/deliveries/externalDelivery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"originAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placePhone\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"destinationAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"storeId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tipAmount\": 123,\n \"expectedDate\": \"2023-11-07T05:31:56Z\",\n \"contents\": [\n {\n \"quantity\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"_id": "<string>",
"price": 123,
"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
Crear solicitud de despacho externo
Usa este metodo para crear una solicitud de despacho externo
POST
/
deliveries
/
externalDelivery
Crear una entrega externa
curl --request POST \
--url https://api.getjusto.com/api/v2/deliveries/externalDelivery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"originAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placePhone": "<string>",
"placeName": "<string>"
},
"destinationAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placeName": "<string>"
},
"storeId": "<string>",
"externalId": "<string>",
"tipAmount": 123,
"expectedDate": "2023-11-07T05:31:56Z",
"contents": [
{
"quantity": 123,
"name": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "https://api.getjusto.com/api/v2/deliveries/externalDelivery"
payload = {
"originAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placePhone": "<string>",
"placeName": "<string>"
},
"destinationAddress": {
"latitude": "<string>",
"longitude": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"placeName": "<string>"
},
"storeId": "<string>",
"externalId": "<string>",
"tipAmount": 123,
"expectedDate": "2023-11-07T05:31:56Z",
"contents": [
{
"quantity": 123,
"name": "<string>",
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
originAddress: {
latitude: '<string>',
longitude: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
placePhone: '<string>',
placeName: '<string>'
},
destinationAddress: {
latitude: '<string>',
longitude: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
placeName: '<string>'
},
storeId: '<string>',
externalId: '<string>',
tipAmount: 123,
expectedDate: '2023-11-07T05:31:56Z',
contents: [{quantity: 123, name: '<string>', description: '<string>'}]
})
};
fetch('https://api.getjusto.com/api/v2/deliveries/externalDelivery', 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/externalDelivery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'originAddress' => [
'latitude' => '<string>',
'longitude' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'placePhone' => '<string>',
'placeName' => '<string>'
],
'destinationAddress' => [
'latitude' => '<string>',
'longitude' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'placeName' => '<string>'
],
'storeId' => '<string>',
'externalId' => '<string>',
'tipAmount' => 123,
'expectedDate' => '2023-11-07T05:31:56Z',
'contents' => [
[
'quantity' => 123,
'name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getjusto.com/api/v2/deliveries/externalDelivery"
payload := strings.NewReader("{\n \"originAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placePhone\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"destinationAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"storeId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tipAmount\": 123,\n \"expectedDate\": \"2023-11-07T05:31:56Z\",\n \"contents\": [\n {\n \"quantity\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getjusto.com/api/v2/deliveries/externalDelivery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"originAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placePhone\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"destinationAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"storeId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tipAmount\": 123,\n \"expectedDate\": \"2023-11-07T05:31:56Z\",\n \"contents\": [\n {\n \"quantity\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/deliveries/externalDelivery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"originAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placePhone\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"destinationAddress\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"placeName\": \"<string>\"\n },\n \"storeId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"tipAmount\": 123,\n \"expectedDate\": \"2023-11-07T05:31:56Z\",\n \"contents\": [\n {\n \"quantity\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"_id": "<string>",
"price": 123,
"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 creación de una solicitud de despacho para el traslado de un pedido entre dos puntos, sin que el punto de origen sea necesariamente la tienda.Ejemplo
{
"originAddress" : {
"latitude": "-33.403961",
"longitude": "-70.573359",
"addressLine1": "Rosario Norte 660",
"addressLine2": "Oficina 192",
"placePhone" : "+56912345678",
"placeName": "Juan Perez"
},
"destinationAddress" : {
"latitude": "-33.412449",
"longitude": "-70.574669",
"addressLine1": "Neveria 5092",
"addressLine2": "Dpto 144",
"placePhone": "+56987654321",
"placeName": "Javier Diaz"
},
"storeId": "Li4eEa3W2hiuGGCFa",
"externalId": "P13G3",
"tipAmount": 998,
"expectedDate": "2023-07-24T22:15:26Z",
"contents": [
{
"quantity": 1,
"name": "Pizza",
"description": "Extras: Bebida 1.5lt",
"unitPrice": 4000
}
]
}
Respuestas
200 - Éxito
{
"status": "ok",
"data": {
<Delivery>
}
}
400 - Error en la petición
{
"status": "error",
"error": "Error en la petición"
}
401 - Token inválido
{
"status": "error",
"error": "Unauthorized"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I