Actualizar horarios
curl --request PATCH \
--url https://api.getjusto.com/api/v2/stores/{id}/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schedule": {
"closedDays": [
"2023-11-07T05:31:56Z"
],
"openPeriods": [
{
"daysOfWeek": [
[
1,
2,
3,
4,
5,
6,
7
]
],
"fromMinute": 480,
"toMinute": 1200
}
]
}
}
'import requests
url = "https://api.getjusto.com/api/v2/stores/{id}/schedule"
payload = { "schedule": {
"closedDays": ["2023-11-07T05:31:56Z"],
"openPeriods": [
{
"daysOfWeek": [[1, 2, 3, 4, 5, 6, 7]],
"fromMinute": 480,
"toMinute": 1200
}
]
} }
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({
schedule: {
closedDays: ['2023-11-07T05:31:56Z'],
openPeriods: [{daysOfWeek: [[1, 2, 3, 4, 5, 6, 7]], fromMinute: 480, toMinute: 1200}]
}
})
};
fetch('https://api.getjusto.com/api/v2/stores/{id}/schedule', 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}/schedule",
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([
'schedule' => [
'closedDays' => [
'2023-11-07T05:31:56Z'
],
'openPeriods' => [
[
'daysOfWeek' => [
[
1,
2,
3,
4,
5,
6,
7
]
],
'fromMinute' => 480,
'toMinute' => 1200
]
]
]
]),
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}/schedule"
payload := strings.NewReader("{\n \"schedule\": {\n \"closedDays\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"openPeriods\": [\n {\n \"daysOfWeek\": [\n [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n ],\n \"fromMinute\": 480,\n \"toMinute\": 1200\n }\n ]\n }\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}/schedule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"schedule\": {\n \"closedDays\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"openPeriods\": [\n {\n \"daysOfWeek\": [\n [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n ],\n \"fromMinute\": 480,\n \"toMinute\": 1200\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/stores/{id}/schedule")
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 \"schedule\": {\n \"closedDays\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"openPeriods\": [\n {\n \"daysOfWeek\": [\n [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n ],\n \"fromMinute\": 480,\n \"toMinute\": 1200\n }\n ]\n }\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 horario de atención
Usa este método para cambiar el horario de atención
PATCH
/
stores
/
{id}
/
schedule
Actualizar horarios
curl --request PATCH \
--url https://api.getjusto.com/api/v2/stores/{id}/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schedule": {
"closedDays": [
"2023-11-07T05:31:56Z"
],
"openPeriods": [
{
"daysOfWeek": [
[
1,
2,
3,
4,
5,
6,
7
]
],
"fromMinute": 480,
"toMinute": 1200
}
]
}
}
'import requests
url = "https://api.getjusto.com/api/v2/stores/{id}/schedule"
payload = { "schedule": {
"closedDays": ["2023-11-07T05:31:56Z"],
"openPeriods": [
{
"daysOfWeek": [[1, 2, 3, 4, 5, 6, 7]],
"fromMinute": 480,
"toMinute": 1200
}
]
} }
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({
schedule: {
closedDays: ['2023-11-07T05:31:56Z'],
openPeriods: [{daysOfWeek: [[1, 2, 3, 4, 5, 6, 7]], fromMinute: 480, toMinute: 1200}]
}
})
};
fetch('https://api.getjusto.com/api/v2/stores/{id}/schedule', 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}/schedule",
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([
'schedule' => [
'closedDays' => [
'2023-11-07T05:31:56Z'
],
'openPeriods' => [
[
'daysOfWeek' => [
[
1,
2,
3,
4,
5,
6,
7
]
],
'fromMinute' => 480,
'toMinute' => 1200
]
]
]
]),
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}/schedule"
payload := strings.NewReader("{\n \"schedule\": {\n \"closedDays\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"openPeriods\": [\n {\n \"daysOfWeek\": [\n [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n ],\n \"fromMinute\": 480,\n \"toMinute\": 1200\n }\n ]\n }\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}/schedule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"schedule\": {\n \"closedDays\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"openPeriods\": [\n {\n \"daysOfWeek\": [\n [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n ],\n \"fromMinute\": 480,\n \"toMinute\": 1200\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getjusto.com/api/v2/stores/{id}/schedule")
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 \"schedule\": {\n \"closedDays\": [\n \"2023-11-07T05:31:56Z\"\n ],\n \"openPeriods\": [\n {\n \"daysOfWeek\": [\n [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n ],\n \"fromMinute\": 480,\n \"toMinute\": 1200\n }\n ]\n }\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 horario de atención de un local. Útil para que una tienda mantenga su horario de atención actualizado.⌘I