import { Lapyme } from "lapyme";
const lapyme = new Lapyme({
bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
});
const product = await lapyme.products.create({
idempotencyKey: crypto.randomUUID(),
body: {
name: "Remera basica",
sku: "REM-BASICA-M",
productType: "product",
price: 1250000,
cost: 700000,
currency: "PES",
},
});curl --request POST \
--url https://api.lapyme.com.ar/api/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visibility": "both",
"image_url": "<string>",
"product_type": "product",
"barcode": "<string>",
"unit_of_measure": "07",
"currency": "PES",
"cost": 0,
"price": 1,
"promotional_price": 1,
"markup_percentage": 5000,
"tax_rate_id": 5,
"is_exempt": false,
"default_supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_sales_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_purchase_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_stocks": [],
"is_active": true,
"metafields": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/products"
payload = {
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visibility": "both",
"image_url": "<string>",
"product_type": "product",
"barcode": "<string>",
"unit_of_measure": "07",
"currency": "PES",
"cost": 0,
"price": 1,
"promotional_price": 1,
"markup_percentage": 5000,
"tax_rate_id": 5,
"is_exempt": False,
"default_supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_sales_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_purchase_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_stocks": [],
"is_active": True,
"metafields": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
sku: '<string>',
description: '<string>',
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
visibility: 'both',
image_url: '<string>',
product_type: 'product',
barcode: '<string>',
unit_of_measure: '07',
currency: 'PES',
cost: 0,
price: 1,
promotional_price: 1,
markup_percentage: 5000,
tax_rate_id: 5,
is_exempt: false,
default_supplier_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
default_sales_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
default_purchase_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
warehouse_stocks: [],
is_active: true,
metafields: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.lapyme.com.ar/api/v1/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://api.lapyme.com.ar/api/v1/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>',
'sku' => '<string>',
'description' => '<string>',
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'visibility' => 'both',
'image_url' => '<string>',
'product_type' => 'product',
'barcode' => '<string>',
'unit_of_measure' => '07',
'currency' => 'PES',
'cost' => 0,
'price' => 1,
'promotional_price' => 1,
'markup_percentage' => 5000,
'tax_rate_id' => 5,
'is_exempt' => false,
'default_supplier_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'default_sales_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'default_purchase_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'warehouse_stocks' => [
],
'is_active' => true,
'metafields' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.lapyme.com.ar/api/v1/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"description\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visibility\": \"both\",\n \"image_url\": \"<string>\",\n \"product_type\": \"product\",\n \"barcode\": \"<string>\",\n \"unit_of_measure\": \"07\",\n \"currency\": \"PES\",\n \"cost\": 0,\n \"price\": 1,\n \"promotional_price\": 1,\n \"markup_percentage\": 5000,\n \"tax_rate_id\": 5,\n \"is_exempt\": false,\n \"default_supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_sales_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_purchase_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warehouse_stocks\": [],\n \"is_active\": true,\n \"metafields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.lapyme.com.ar/api/v1/products")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"description\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visibility\": \"both\",\n \"image_url\": \"<string>\",\n \"product_type\": \"product\",\n \"barcode\": \"<string>\",\n \"unit_of_measure\": \"07\",\n \"currency\": \"PES\",\n \"cost\": 0,\n \"price\": 1,\n \"promotional_price\": 1,\n \"markup_percentage\": 5000,\n \"tax_rate_id\": 5,\n \"is_exempt\": false,\n \"default_supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_sales_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_purchase_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warehouse_stocks\": [],\n \"is_active\": true,\n \"metafields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"description\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visibility\": \"both\",\n \"image_url\": \"<string>\",\n \"product_type\": \"product\",\n \"barcode\": \"<string>\",\n \"unit_of_measure\": \"07\",\n \"currency\": \"PES\",\n \"cost\": 0,\n \"price\": 1,\n \"promotional_price\": 1,\n \"markup_percentage\": 5000,\n \"tax_rate_id\": 5,\n \"is_exempt\": false,\n \"default_supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_sales_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_purchase_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warehouse_stocks\": [],\n \"is_active\": true,\n \"metafields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sku": "<string>",
"barcode": "<string>",
"image_url": "<string>",
"currency": "<string>",
"cost": 123,
"price": 123,
"tax_rate": {
"id": 123,
"value": 123
},
"default_supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"is_active": true,
"organization_slug": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"tags": [
{
"object": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"variant_group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variant_options": {},
"is_exempt": true,
"metafields": [
{
"key": "<string>",
"value": "<string>"
}
],
"stock_summary": {
"total_quantity": 123,
"warehouse_count": 1,
"by_warehouse": [
{
"warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_name": "<string>",
"quantity": 123,
"on_hand": 123,
"reserved_quantity": 123,
"incoming_quantity": 123
}
]
},
"effective_price": 123,
"applied_price_list": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"is_automatic": true,
"adjustment_percentage": 123,
"tax_inclusive": true
}
},
"idempotent_replay": true
},
"warnings": [
"<unknown>"
]
}{
"request_id": "req_product_create_1",
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request for creating products",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "API key is required in the Authorization header",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "FORBIDDEN",
"message": "Your API key does not have permission for this operation",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "NOT_FOUND",
"message": "Category not found",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "CONFLICT",
"message": "A product with this SKU already exists",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_rate_limit_1",
"error": {
"type": "rate_limit_error",
"code": "RATE_LIMITED",
"message": "The organization request limit was reached. Try again later.",
"retryable": true,
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "INTERNAL_ERROR",
"message": "Could not process the product",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}Crear producto
Crea un producto simple, servicio, combo o kit, o un producto con hasta tres opciones y 250 variantes. En la creación con variantes, cada variante define su combinación, SKU, precios y stock inicial.
import { Lapyme } from "lapyme";
const lapyme = new Lapyme({
bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
});
const product = await lapyme.products.create({
idempotencyKey: crypto.randomUUID(),
body: {
name: "Remera basica",
sku: "REM-BASICA-M",
productType: "product",
price: 1250000,
cost: 700000,
currency: "PES",
},
});curl --request POST \
--url https://api.lapyme.com.ar/api/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visibility": "both",
"image_url": "<string>",
"product_type": "product",
"barcode": "<string>",
"unit_of_measure": "07",
"currency": "PES",
"cost": 0,
"price": 1,
"promotional_price": 1,
"markup_percentage": 5000,
"tax_rate_id": 5,
"is_exempt": false,
"default_supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_sales_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_purchase_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_stocks": [],
"is_active": true,
"metafields": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/products"
payload = {
"name": "<string>",
"sku": "<string>",
"description": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visibility": "both",
"image_url": "<string>",
"product_type": "product",
"barcode": "<string>",
"unit_of_measure": "07",
"currency": "PES",
"cost": 0,
"price": 1,
"promotional_price": 1,
"markup_percentage": 5000,
"tax_rate_id": 5,
"is_exempt": False,
"default_supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_sales_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"default_purchase_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_stocks": [],
"is_active": True,
"metafields": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
sku: '<string>',
description: '<string>',
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
visibility: 'both',
image_url: '<string>',
product_type: 'product',
barcode: '<string>',
unit_of_measure: '07',
currency: 'PES',
cost: 0,
price: 1,
promotional_price: 1,
markup_percentage: 5000,
tax_rate_id: 5,
is_exempt: false,
default_supplier_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
default_sales_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
default_purchase_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
warehouse_stocks: [],
is_active: true,
metafields: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.lapyme.com.ar/api/v1/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://api.lapyme.com.ar/api/v1/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>',
'sku' => '<string>',
'description' => '<string>',
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'visibility' => 'both',
'image_url' => '<string>',
'product_type' => 'product',
'barcode' => '<string>',
'unit_of_measure' => '07',
'currency' => 'PES',
'cost' => 0,
'price' => 1,
'promotional_price' => 1,
'markup_percentage' => 5000,
'tax_rate_id' => 5,
'is_exempt' => false,
'default_supplier_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'default_sales_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'default_purchase_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'warehouse_stocks' => [
],
'is_active' => true,
'metafields' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://api.lapyme.com.ar/api/v1/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"description\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visibility\": \"both\",\n \"image_url\": \"<string>\",\n \"product_type\": \"product\",\n \"barcode\": \"<string>\",\n \"unit_of_measure\": \"07\",\n \"currency\": \"PES\",\n \"cost\": 0,\n \"price\": 1,\n \"promotional_price\": 1,\n \"markup_percentage\": 5000,\n \"tax_rate_id\": 5,\n \"is_exempt\": false,\n \"default_supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_sales_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_purchase_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warehouse_stocks\": [],\n \"is_active\": true,\n \"metafields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.lapyme.com.ar/api/v1/products")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"description\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visibility\": \"both\",\n \"image_url\": \"<string>\",\n \"product_type\": \"product\",\n \"barcode\": \"<string>\",\n \"unit_of_measure\": \"07\",\n \"currency\": \"PES\",\n \"cost\": 0,\n \"price\": 1,\n \"promotional_price\": 1,\n \"markup_percentage\": 5000,\n \"tax_rate_id\": 5,\n \"is_exempt\": false,\n \"default_supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_sales_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_purchase_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warehouse_stocks\": [],\n \"is_active\": true,\n \"metafields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"description\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visibility\": \"both\",\n \"image_url\": \"<string>\",\n \"product_type\": \"product\",\n \"barcode\": \"<string>\",\n \"unit_of_measure\": \"07\",\n \"currency\": \"PES\",\n \"cost\": 0,\n \"price\": 1,\n \"promotional_price\": 1,\n \"markup_percentage\": 5000,\n \"tax_rate_id\": 5,\n \"is_exempt\": false,\n \"default_supplier_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_sales_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"default_purchase_account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warehouse_stocks\": [],\n \"is_active\": true,\n \"metafields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"sku": "<string>",
"barcode": "<string>",
"image_url": "<string>",
"currency": "<string>",
"cost": 123,
"price": 123,
"tax_rate": {
"id": 123,
"value": 123
},
"default_supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"is_active": true,
"organization_slug": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"tags": [
{
"object": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"variant_group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variant_options": {},
"is_exempt": true,
"metafields": [
{
"key": "<string>",
"value": "<string>"
}
],
"stock_summary": {
"total_quantity": 123,
"warehouse_count": 1,
"by_warehouse": [
{
"warehouse_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_name": "<string>",
"quantity": 123,
"on_hand": 123,
"reserved_quantity": 123,
"incoming_quantity": 123
}
]
},
"effective_price": 123,
"applied_price_list": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"is_automatic": true,
"adjustment_percentage": 123,
"tax_inclusive": true
}
},
"idempotent_replay": true
},
"warnings": [
"<unknown>"
]
}{
"request_id": "req_product_create_1",
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request for creating products",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "API key is required in the Authorization header",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "FORBIDDEN",
"message": "Your API key does not have permission for this operation",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "NOT_FOUND",
"message": "Category not found",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "CONFLICT",
"message": "A product with this SKU already exists",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_rate_limit_1",
"error": {
"type": "rate_limit_error",
"code": "RATE_LIMITED",
"message": "The organization request limit was reached. Try again later.",
"retryable": true,
"details": []
}
}{
"request_id": "req_product_create_1",
"error": {
"code": "INTERNAL_ERROR",
"message": "Could not process the product",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}Authorizations
Incluí tu API key en el header Authorization con el prefijo Bearer.
Headers
Clave única para evitar duplicados al reintentar la misma creación de producto.
ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.
Body
- Option 1
- Option 2
both, sales, purchases External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.
product, service, combo, kit 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 41, 47, 48, 49, 50, 51, 52, 53, 54, 55, 61, 62, 63, 97, 98, 99, 00, 01, 02, 03, 04, 05, 06, 07, 08, 09 PES, DOL x >= 0Manual sale price in cents. Mutually exclusive with markup_percentage; send price for manual pricing or markup_percentage for markup pricing.
x >= 0x >= 0Markup percentage used to calculate the sale price from cost, tax, and organization rounding rules. Mutually exclusive with price; send null to switch back to manual pricing.
0 <= x <= 10000Show child attributes
Show child attributes
Group-level custom field values addressed by canonical key. Available when custom fields are enabled for the organization.
1 - 100 elementsShow child attributes
Show child attributes
Was this page helpful?

