Actualizar tiempo de preparación
curl --request PATCH \
--url https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currentPreparationDuration": 10
}
'import requests
url = "https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration"
payload = { "currentPreparationDuration": 10 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({currentPreparationDuration: 10})
};
fetch('https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration', 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/stores/{id}/currentPreparationDuration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'currentPreparationDuration' => 10
]),
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/stores/{id}/currentPreparationDuration"
payload := strings.NewReader("{\n \"currentPreparationDuration\": 10\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currentPreparationDuration\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currentPreparationDuration\": 10\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"_id": "xKoiiqdtKGaRA2ve4",
"externalId": 2345,
"websiteId": "ErCkmcyCEovseJq5E",
"name": "Peña",
"acceptDelivery": true,
"acceptServe": true,
"acceptGo": true,
"currentPreparationDuration": 10,
"phone": "null",
"address": {
"placeId": "EihBdmVuaWRhIEhvbGFuZGEgMTYwNSwgUHJvdmlkZW5jaWEsIENoaWxlIjESLwoUChIJCfBr63TPYpYRguPJ8LiSNSgQxQwqFAoSCbELmxJ1z2KWEdvDHqTQ",
"address": "Avenida Holanda 1605",
"addressLine2": 1234,
"addressSecondary": "Providencia, Chile",
"comment": "Dejar con el conserje",
"location": {
"lat": -33.4334297,
"lng": -70.59966380000002
}
},
"schedule": {
"closedUntilDate": "null",
"closedDays": [
"2023-11-07T05:31:56Z"
],
"availableAtPeriods": false,
"openPeriods": [
{
"daysOfWeek": [
1,
2,
3,
4,
5,
6,
7
],
"fromMinute": 480,
"toMinute": 1200
}
],
"timezone": "America/Santiago"
}
}
}{
"status": "error",
"error": "Error en la petición"
}{
"status": "error",
"error": "Unauthorized"
}Locales
Cambiar el tiempo de preparación
Usa este método para cambiar el tiempo de preparación
PATCH
/
stores
/
{id}
/
currentPreparationDuration
Actualizar tiempo de preparación
curl --request PATCH \
--url https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currentPreparationDuration": 10
}
'import requests
url = "https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration"
payload = { "currentPreparationDuration": 10 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({currentPreparationDuration: 10})
};
fetch('https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration', 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/stores/{id}/currentPreparationDuration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'currentPreparationDuration' => 10
]),
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/stores/{id}/currentPreparationDuration"
payload := strings.NewReader("{\n \"currentPreparationDuration\": 10\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currentPreparationDuration\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/stores/{id}/currentPreparationDuration")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currentPreparationDuration\": 10\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"_id": "xKoiiqdtKGaRA2ve4",
"externalId": 2345,
"websiteId": "ErCkmcyCEovseJq5E",
"name": "Peña",
"acceptDelivery": true,
"acceptServe": true,
"acceptGo": true,
"currentPreparationDuration": 10,
"phone": "null",
"address": {
"placeId": "EihBdmVuaWRhIEhvbGFuZGEgMTYwNSwgUHJvdmlkZW5jaWEsIENoaWxlIjESLwoUChIJCfBr63TPYpYRguPJ8LiSNSgQxQwqFAoSCbELmxJ1z2KWEdvDHqTQ",
"address": "Avenida Holanda 1605",
"addressLine2": 1234,
"addressSecondary": "Providencia, Chile",
"comment": "Dejar con el conserje",
"location": {
"lat": -33.4334297,
"lng": -70.59966380000002
}
},
"schedule": {
"closedUntilDate": "null",
"closedDays": [
"2023-11-07T05:31:56Z"
],
"availableAtPeriods": false,
"openPeriods": [
{
"daysOfWeek": [
1,
2,
3,
4,
5,
6,
7
],
"fromMinute": 480,
"toMinute": 1200
}
],
"timezone": "America/Santiago"
}
}
}{
"status": "error",
"error": "Error en la petición"
}{
"status": "error",
"error": "Unauthorized"
}Descripción
Este método permite actualizar el tiempo de preparación actual de los pedidos para un local específico. Adicionalmente, es importante considerar que este tiempo indica la cantidad de minutos que toma preparar un nuevo pedido en dicho local.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID del local
Body
application/json
Tiempo de preparación en minutos.
Example:
10
⌘I