Publicar producto
curl --request PATCH \
--url https://{tenantDomain}/api/v1/products/{product}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenantDomain}/api/v1/products/{product}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenantDomain}/api/v1/products/{product}/publish', 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://{tenantDomain}/api/v1/products/{product}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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://{tenantDomain}/api/v1/products/{product}/publish"
req, _ := http.NewRequest("PATCH", 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.patch("https://{tenantDomain}/api/v1/products/{product}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v1/products/{product}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"tagline": "<string>",
"social_links": "<string>",
"store_active": "<string>",
"published_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"logos": [
"<unknown>"
],
"media": {
"gallery": [
"<string>"
],
"unit_thumbnail": {
"id": "<string>",
"name": "<string>",
"file_name": "<string>",
"mime_type": "<string>",
"size": "<string>",
"order": "<string>",
"urls": "<string>"
}
},
"product_type": {
"value": "<string>",
"label": "<string>",
"labels": {
"sector": "<string>",
"unit": "<string>"
}
},
"project": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"tagline": "<string>",
"store_active": "<string>",
"logos": [
"<unknown>"
],
"product_types": [
"<unknown>"
],
"lots_map": [
"<unknown>"
],
"has_lots_map": true,
"published_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"neighborhood": "<string>"
}
},
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"neighborhood": "<string>",
"district": "<string>",
"postal_code": "<string>",
"address_line_1": "<string>",
"address_line_2": "<string>",
"phone": "<string>",
"latitude": "<string>",
"longitude": "<string>"
},
"tags": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}Product
Publicar producto
Publica un producto específico, haciéndolo visible en la API pública. Establece la fecha de publicación al momento actual.
PATCH
/
products
/
{product}
/
publish
Publicar producto
curl --request PATCH \
--url https://{tenantDomain}/api/v1/products/{product}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenantDomain}/api/v1/products/{product}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenantDomain}/api/v1/products/{product}/publish', 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://{tenantDomain}/api/v1/products/{product}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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://{tenantDomain}/api/v1/products/{product}/publish"
req, _ := http.NewRequest("PATCH", 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.patch("https://{tenantDomain}/api/v1/products/{product}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v1/products/{product}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"tagline": "<string>",
"social_links": "<string>",
"store_active": "<string>",
"published_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"logos": [
"<unknown>"
],
"media": {
"gallery": [
"<string>"
],
"unit_thumbnail": {
"id": "<string>",
"name": "<string>",
"file_name": "<string>",
"mime_type": "<string>",
"size": "<string>",
"order": "<string>",
"urls": "<string>"
}
},
"product_type": {
"value": "<string>",
"label": "<string>",
"labels": {
"sector": "<string>",
"unit": "<string>"
}
},
"project": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"tagline": "<string>",
"store_active": "<string>",
"logos": [
"<unknown>"
],
"product_types": [
"<unknown>"
],
"lots_map": [
"<unknown>"
],
"has_lots_map": true,
"published_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"neighborhood": "<string>"
}
},
"address": {
"country": "<string>",
"state": "<string>",
"city": "<string>",
"neighborhood": "<string>",
"district": "<string>",
"postal_code": "<string>",
"address_line_1": "<string>",
"address_line_2": "<string>",
"phone": "<string>",
"latitude": "<string>",
"longitude": "<string>"
},
"tags": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}