Crear
curl --request POST \
--url https://sandbox.api.riqra.com/products \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"name": "<string>",
"mainVariant": {
"sku": "<string>",
"price": 123,
"stock": 123,
"erpCode": "<string>",
"priceIsTaxExempt": false,
"salesUnitFactor": 1,
"jumpFactor": 1,
"images": [
{
"url": "<string>",
"order": 123
}
],
"order": 2,
"attributes": [
{
"name": "<string>",
"value": "<string>"
}
],
"weight": 123,
"length": 123,
"width": 123,
"height": 123
},
"subcategories": [
123
],
"description": "<string>",
"shortDescription": "<string>",
"seo": {
"title": "<string>",
"description": "<string>"
},
"isPublished": true,
"isFeatured": true,
"order": 123,
"extraFields": {},
"attributes": [
"<string>"
]
}
'import requests
url = "https://sandbox.api.riqra.com/products"
payload = {
"name": "<string>",
"mainVariant": {
"sku": "<string>",
"price": 123,
"stock": 123,
"erpCode": "<string>",
"priceIsTaxExempt": False,
"salesUnitFactor": 1,
"jumpFactor": 1,
"images": [
{
"url": "<string>",
"order": 123
}
],
"order": 2,
"attributes": [
{
"name": "<string>",
"value": "<string>"
}
],
"weight": 123,
"length": 123,
"width": 123,
"height": 123
},
"subcategories": [123],
"description": "<string>",
"shortDescription": "<string>",
"seo": {
"title": "<string>",
"description": "<string>"
},
"isPublished": True,
"isFeatured": True,
"order": 123,
"extraFields": {},
"attributes": ["<string>"]
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
mainVariant: {
sku: '<string>',
price: 123,
stock: 123,
erpCode: '<string>',
priceIsTaxExempt: false,
salesUnitFactor: 1,
jumpFactor: 1,
images: [{url: '<string>', order: 123}],
order: 2,
attributes: [{name: '<string>', value: '<string>'}],
weight: 123,
length: 123,
width: 123,
height: 123
},
subcategories: [123],
description: '<string>',
shortDescription: '<string>',
seo: {title: '<string>', description: '<string>'},
isPublished: true,
isFeatured: true,
order: 123,
extraFields: {},
attributes: ['<string>']
})
};
fetch('https://sandbox.api.riqra.com/products', 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://sandbox.api.riqra.com/products",
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([
'name' => '<string>',
'mainVariant' => [
'sku' => '<string>',
'price' => 123,
'stock' => 123,
'erpCode' => '<string>',
'priceIsTaxExempt' => false,
'salesUnitFactor' => 1,
'jumpFactor' => 1,
'images' => [
[
'url' => '<string>',
'order' => 123
]
],
'order' => 2,
'attributes' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'weight' => 123,
'length' => 123,
'width' => 123,
'height' => 123
],
'subcategories' => [
123
],
'description' => '<string>',
'shortDescription' => '<string>',
'seo' => [
'title' => '<string>',
'description' => '<string>'
],
'isPublished' => true,
'isFeatured' => true,
'order' => 123,
'extraFields' => [
],
'attributes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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://sandbox.api.riqra.com/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"mainVariant\": {\n \"sku\": \"<string>\",\n \"price\": 123,\n \"stock\": 123,\n \"erpCode\": \"<string>\",\n \"priceIsTaxExempt\": false,\n \"salesUnitFactor\": 1,\n \"jumpFactor\": 1,\n \"images\": [\n {\n \"url\": \"<string>\",\n \"order\": 123\n }\n ],\n \"order\": 2,\n \"attributes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"weight\": 123,\n \"length\": 123,\n \"width\": 123,\n \"height\": 123\n },\n \"subcategories\": [\n 123\n ],\n \"description\": \"<string>\",\n \"shortDescription\": \"<string>\",\n \"seo\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"isPublished\": true,\n \"isFeatured\": true,\n \"order\": 123,\n \"extraFields\": {},\n \"attributes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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://sandbox.api.riqra.com/products")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"mainVariant\": {\n \"sku\": \"<string>\",\n \"price\": 123,\n \"stock\": 123,\n \"erpCode\": \"<string>\",\n \"priceIsTaxExempt\": false,\n \"salesUnitFactor\": 1,\n \"jumpFactor\": 1,\n \"images\": [\n {\n \"url\": \"<string>\",\n \"order\": 123\n }\n ],\n \"order\": 2,\n \"attributes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"weight\": 123,\n \"length\": 123,\n \"width\": 123,\n \"height\": 123\n },\n \"subcategories\": [\n 123\n ],\n \"description\": \"<string>\",\n \"shortDescription\": \"<string>\",\n \"seo\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"isPublished\": true,\n \"isFeatured\": true,\n \"order\": 123,\n \"extraFields\": {},\n \"attributes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.riqra.com/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"mainVariant\": {\n \"sku\": \"<string>\",\n \"price\": 123,\n \"stock\": 123,\n \"erpCode\": \"<string>\",\n \"priceIsTaxExempt\": false,\n \"salesUnitFactor\": 1,\n \"jumpFactor\": 1,\n \"images\": [\n {\n \"url\": \"<string>\",\n \"order\": 123\n }\n ],\n \"order\": 2,\n \"attributes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"weight\": 123,\n \"length\": 123,\n \"width\": 123,\n \"height\": 123\n },\n \"subcategories\": [\n 123\n ],\n \"description\": \"<string>\",\n \"shortDescription\": \"<string>\",\n \"seo\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"isPublished\": true,\n \"isFeatured\": true,\n \"order\": 123,\n \"extraFields\": {},\n \"attributes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "<string>",
"code": 123
}
]
}Productos
Crear
Crea un producto nuevo.
POST
/
products
Crear
curl --request POST \
--url https://sandbox.api.riqra.com/products \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"name": "<string>",
"mainVariant": {
"sku": "<string>",
"price": 123,
"stock": 123,
"erpCode": "<string>",
"priceIsTaxExempt": false,
"salesUnitFactor": 1,
"jumpFactor": 1,
"images": [
{
"url": "<string>",
"order": 123
}
],
"order": 2,
"attributes": [
{
"name": "<string>",
"value": "<string>"
}
],
"weight": 123,
"length": 123,
"width": 123,
"height": 123
},
"subcategories": [
123
],
"description": "<string>",
"shortDescription": "<string>",
"seo": {
"title": "<string>",
"description": "<string>"
},
"isPublished": true,
"isFeatured": true,
"order": 123,
"extraFields": {},
"attributes": [
"<string>"
]
}
'import requests
url = "https://sandbox.api.riqra.com/products"
payload = {
"name": "<string>",
"mainVariant": {
"sku": "<string>",
"price": 123,
"stock": 123,
"erpCode": "<string>",
"priceIsTaxExempt": False,
"salesUnitFactor": 1,
"jumpFactor": 1,
"images": [
{
"url": "<string>",
"order": 123
}
],
"order": 2,
"attributes": [
{
"name": "<string>",
"value": "<string>"
}
],
"weight": 123,
"length": 123,
"width": 123,
"height": 123
},
"subcategories": [123],
"description": "<string>",
"shortDescription": "<string>",
"seo": {
"title": "<string>",
"description": "<string>"
},
"isPublished": True,
"isFeatured": True,
"order": 123,
"extraFields": {},
"attributes": ["<string>"]
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
mainVariant: {
sku: '<string>',
price: 123,
stock: 123,
erpCode: '<string>',
priceIsTaxExempt: false,
salesUnitFactor: 1,
jumpFactor: 1,
images: [{url: '<string>', order: 123}],
order: 2,
attributes: [{name: '<string>', value: '<string>'}],
weight: 123,
length: 123,
width: 123,
height: 123
},
subcategories: [123],
description: '<string>',
shortDescription: '<string>',
seo: {title: '<string>', description: '<string>'},
isPublished: true,
isFeatured: true,
order: 123,
extraFields: {},
attributes: ['<string>']
})
};
fetch('https://sandbox.api.riqra.com/products', 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://sandbox.api.riqra.com/products",
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([
'name' => '<string>',
'mainVariant' => [
'sku' => '<string>',
'price' => 123,
'stock' => 123,
'erpCode' => '<string>',
'priceIsTaxExempt' => false,
'salesUnitFactor' => 1,
'jumpFactor' => 1,
'images' => [
[
'url' => '<string>',
'order' => 123
]
],
'order' => 2,
'attributes' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'weight' => 123,
'length' => 123,
'width' => 123,
'height' => 123
],
'subcategories' => [
123
],
'description' => '<string>',
'shortDescription' => '<string>',
'seo' => [
'title' => '<string>',
'description' => '<string>'
],
'isPublished' => true,
'isFeatured' => true,
'order' => 123,
'extraFields' => [
],
'attributes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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://sandbox.api.riqra.com/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"mainVariant\": {\n \"sku\": \"<string>\",\n \"price\": 123,\n \"stock\": 123,\n \"erpCode\": \"<string>\",\n \"priceIsTaxExempt\": false,\n \"salesUnitFactor\": 1,\n \"jumpFactor\": 1,\n \"images\": [\n {\n \"url\": \"<string>\",\n \"order\": 123\n }\n ],\n \"order\": 2,\n \"attributes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"weight\": 123,\n \"length\": 123,\n \"width\": 123,\n \"height\": 123\n },\n \"subcategories\": [\n 123\n ],\n \"description\": \"<string>\",\n \"shortDescription\": \"<string>\",\n \"seo\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"isPublished\": true,\n \"isFeatured\": true,\n \"order\": 123,\n \"extraFields\": {},\n \"attributes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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://sandbox.api.riqra.com/products")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"mainVariant\": {\n \"sku\": \"<string>\",\n \"price\": 123,\n \"stock\": 123,\n \"erpCode\": \"<string>\",\n \"priceIsTaxExempt\": false,\n \"salesUnitFactor\": 1,\n \"jumpFactor\": 1,\n \"images\": [\n {\n \"url\": \"<string>\",\n \"order\": 123\n }\n ],\n \"order\": 2,\n \"attributes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"weight\": 123,\n \"length\": 123,\n \"width\": 123,\n \"height\": 123\n },\n \"subcategories\": [\n 123\n ],\n \"description\": \"<string>\",\n \"shortDescription\": \"<string>\",\n \"seo\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"isPublished\": true,\n \"isFeatured\": true,\n \"order\": 123,\n \"extraFields\": {},\n \"attributes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.riqra.com/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"mainVariant\": {\n \"sku\": \"<string>\",\n \"price\": 123,\n \"stock\": 123,\n \"erpCode\": \"<string>\",\n \"priceIsTaxExempt\": false,\n \"salesUnitFactor\": 1,\n \"jumpFactor\": 1,\n \"images\": [\n {\n \"url\": \"<string>\",\n \"order\": 123\n }\n ],\n \"order\": 2,\n \"attributes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"weight\": 123,\n \"length\": 123,\n \"width\": 123,\n \"height\": 123\n },\n \"subcategories\": [\n 123\n ],\n \"description\": \"<string>\",\n \"shortDescription\": \"<string>\",\n \"seo\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n },\n \"isPublished\": true,\n \"isFeatured\": true,\n \"order\": 123,\n \"extraFields\": {},\n \"attributes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "<string>",
"code": 123
}
]
}Autorizaciones
Todas las llamadas al API tienen que contener este header junto a la clave para poder autenticar y autorizar al cliente.
Cuerpo
application/json
One subcategory ID at least should be included
Nombre del producto.
Show child attributes
Show child attributes
Lista de IDs de subcategorías a las que pertenece el producto.
Minimum array length:
1El ID de la subcategoría.
Detalles sobre el producto, puede ser contenido HTML.
Breve descripción o presentación del producto.
Atributos para el SEO.
Show child attributes
Show child attributes
Indica si el producto debe mostrarse o no.
Indica si el producto será destacado.
Orden del producto entre a todos los demás productos.
Objeto JSON válido de campos adicionales.
Atributos que rigen las definiciones de los atributos de las variantes, incluida la principal.
Respuesta
Created
⌘I