Skip to main content
POST
/
orders
/
{id}
/
orderManagedDelivery
cURL
curl --request POST \
  --url https://api.getjusto.com/api/v2/orders/{id}/orderManagedDelivery \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "managedDelivery": "<string>"
}
'
import requests

url = "https://api.getjusto.com/api/v2/orders/{id}/orderManagedDelivery"

payload = { "managedDelivery": "<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({managedDelivery: '<string>'})
};

fetch('https://api.getjusto.com/api/v2/orders/{id}/orderManagedDelivery', 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/orders/{id}/orderManagedDelivery",
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([
'managedDelivery' => '<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/orders/{id}/orderManagedDelivery"

payload := strings.NewReader("{\n \"managedDelivery\": \"<string>\"\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/orders/{id}/orderManagedDelivery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"managedDelivery\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.getjusto.com/api/v2/orders/{id}/orderManagedDelivery")

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 \"managedDelivery\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "ok",
  "data": {
    "_id": "<string>",
    "orderStatus": "<string>",
    "isScheduled": true,
    "websiteId": "<string>",
    "code": "<string>",
    "createdAt": "<string>",
    "fullCode": "<string>",
    "userId": "<string>",
    "storeId": "<string>",
    "address": {
      "_id": "<string>",
      "placeId": "<string>",
      "address": "<string>",
      "addressSecondary": "<string>",
      "location": {
        "lat": 123,
        "lng": 123
      },
      "streetAddress": "<string>",
      "locality": "<string>",
      "region": "<string>",
      "postalCode": "<string>",
      "directions": {
        "duration": 123,
        "distance": 123
      }
    },
    "menuId": "<string>",
    "deliveryType": "<string>",
    "deliverAt": "2023-11-07T05:31:56Z",
    "paymentType": "<string>",
    "paymentTypeLabel": "<string>",
    "paymentTypeIsIntegration": true,
    "otherPaymentType": "<string>",
    "amountToPay": 123,
    "deliveryFee": 123,
    "deliveryFeeWithoutDiscount": 123,
    "serviceFee": 123,
    "itemsPrice": 123,
    "totalPrice": 123,
    "totalPriceBeforeDiscountsAfterProductDiscount": 123,
    "discountedAmountAfterProductDiscount": 123,
    "justoCoinsDiscount": 123,
    "invoiceTotalPrice": 123,
    "amountFinancedByWebsite": 123,
    "amountFinancedByJusto": 123,
    "expectedPreparationDuration": 123,
    "deliveryDuration": 123,
    "cardId": "<string>",
    "channel": "<string>",
    "source": "<string>",
    "buyerName": "<string>",
    "couponId": "<string>",
    "couponName": "<string>",
    "couponDiscount": 123,
    "flagColor": "<string>",
    "store": {
      "_id": "<string>",
      "websiteId": "<string>",
      "name": "<string>",
      "acceptDelivery": true,
      "currentPreparationDuration": 123,
      "currentDeliveryDuration": 123,
      "phone": "<string>",
      "address": {
        "_id": "<string>",
        "placeId": "<string>",
        "address": "<string>",
        "addressSecondary": "<string>",
        "location": {
          "lat": 123,
          "lng": 123
        },
        "streetAddress": "<string>",
        "locality": "<string>",
        "region": "<string>",
        "postalCode": "<string>",
        "directions": {
          "duration": 123,
          "distance": 123
        }
      },
      "externalId": "<string>",
      "schedule": {
        "closedDays": "<array>",
        "availableAtPeriods": true,
        "openPeriods": [
          {
            "daysOfWeek": [
              123
            ],
            "fromMinute": 123,
            "toMinute": 123,
            "specialPeriods": "<array>",
            "timezone": "<string>",
            "availableStateValidUntil": "<string>",
            "isAvailableNow": true,
            "updatedCacheAt": "<string>"
          }
        ]
      }
    },
    "items": [
      {
        "product": {
          "_id": "<string>",
          "name": "<string>",
          "externalId": "<string>"
        },
        "unitPrice": 123,
        "baseUnitPrice": 123,
        "productPrice": 123,
        "baseProductPrice": 123,
        "amount": 123,
        "comment": "<string>",
        "modifiers": "<array>",
        "options": "<array>"
      }
    ],
    "transaction": {},
    "devolutions": [
      {
        "_id": "<string>",
        "amount": 123,
        "completedAt": "2023-11-07T05:31:56Z",
        "createdAt": "2023-11-07T05:31:56Z"
      }
    ],
    "deliveries": [
      {}
    ],
    "charges": {
      "platformFee": {
        "amount": 123,
        "totalAmount": 123,
        "tax": 123,
        "count": 123
      }
    },
    "orderParams": {
      "isGift": true
    },
    "billing": {},
    "clonedOrder": {},
    "parentOrder": {},
    "hasManagedDelivery": true,
    "loyaltyTransaction": {},
    "cancellationInfo": {},
    "websiteCoinsDiscount": 123
  }
}
{
"status": "error",
"error": "Error en la petición"
}
{
"status": "error",
"error": "Unauthorized"
}

Descripción

Este método proporciona la capacidad de determinar dinámicamente quién será responsable de la entrega de un pedido, ya sea Justo o el establecimiento local.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

ID de la orden

Body

application/json
managedDelivery
string
required

Tipo de despacho

Response

Operación exitosa

status
string

Resultado de la operación

Example:

"ok"

data
object