La Pyme SDK
import { Lapyme } from "lapyme";
const lapyme = new Lapyme({
bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
});
const product = await lapyme.products.update({
productId: "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
body: {
price: 1390000,
},
});curl --request PUT \
--url https://api.lapyme.com.ar/api/v1/products/{product_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_type": "combo",
"name": "<string>",
"sku": "<string>",
"components": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123
}
],
"barcode": "<string>",
"image_url": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"pricing_mode": "automatic",
"price": 1,
"price_adjustment_percentage": 4950
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/products/{product_id}"
payload = {
"product_type": "combo",
"name": "<string>",
"sku": "<string>",
"components": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123
}
],
"barcode": "<string>",
"image_url": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": True,
"pricing_mode": "automatic",
"price": 1,
"price_adjustment_percentage": 4950
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_type: 'combo',
name: '<string>',
sku: '<string>',
components: [{product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 123}],
barcode: '<string>',
image_url: '<string>',
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
is_active: true,
pricing_mode: 'automatic',
price: 1,
price_adjustment_percentage: 4950
})
};
fetch('https://api.lapyme.com.ar/api/v1/products/{product_id}', 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/{product_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'product_type' => 'combo',
'name' => '<string>',
'sku' => '<string>',
'components' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123
]
],
'barcode' => '<string>',
'image_url' => '<string>',
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'is_active' => true,
'pricing_mode' => 'automatic',
'price' => 1,
'price_adjustment_percentage' => 4950
]),
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.lapyme.com.ar/api/v1/products/{product_id}"
payload := strings.NewReader("{\n \"product_type\": \"combo\",\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"components\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123\n }\n ],\n \"barcode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"pricing_mode\": \"automatic\",\n \"price\": 1,\n \"price_adjustment_percentage\": 4950\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.lapyme.com.ar/api/v1/products/{product_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_type\": \"combo\",\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"components\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123\n }\n ],\n \"barcode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"pricing_mode\": \"automatic\",\n \"price\": 1,\n \"price_adjustment_percentage\": 4950\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_type\": \"combo\",\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"components\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123\n }\n ],\n \"barcode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"pricing_mode\": \"automatic\",\n \"price\": 1,\n \"price_adjustment_percentage\": 4950\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>"
},
"product_type": "product",
"visibility": "both",
"is_active": true,
"organization_slug": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"components": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"sku": "<string>",
"quantity": 123
}
],
"object": "product",
"tags": [
{
"object": "tag",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": "customer",
"name": "<string>",
"slug": "<string>",
"color": "slate",
"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,
"price_source": "automatic",
"applied_price_list": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"is_automatic": true,
"automatic_pricing_mode": "base_price_adjustment",
"adjustment_percentage": 123,
"source_price_list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tax_inclusive": true
}
}
},
"warnings": [
"<unknown>"
]
}{
"request_id": "req_product_update_1",
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request for updating products",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_update_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_update_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_update_1",
"error": {
"code": "NOT_FOUND",
"message": "Product not found",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_update_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_update_1",
"error": {
"code": "INTERNAL_ERROR",
"message": "Could not update the product",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}Actualizar producto
Actualiza un producto y devuelve el detalle persistido. La actualización de un combo requiere Idempotency-Key para deduplicar reintentos.
PUT
/
api
/
v1
/
products
/
{product_id}
La Pyme SDK
import { Lapyme } from "lapyme";
const lapyme = new Lapyme({
bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
});
const product = await lapyme.products.update({
productId: "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
body: {
price: 1390000,
},
});curl --request PUT \
--url https://api.lapyme.com.ar/api/v1/products/{product_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_type": "combo",
"name": "<string>",
"sku": "<string>",
"components": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123
}
],
"barcode": "<string>",
"image_url": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"pricing_mode": "automatic",
"price": 1,
"price_adjustment_percentage": 4950
}
'import requests
url = "https://api.lapyme.com.ar/api/v1/products/{product_id}"
payload = {
"product_type": "combo",
"name": "<string>",
"sku": "<string>",
"components": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123
}
],
"barcode": "<string>",
"image_url": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": True,
"pricing_mode": "automatic",
"price": 1,
"price_adjustment_percentage": 4950
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_type: 'combo',
name: '<string>',
sku: '<string>',
components: [{product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', quantity: 123}],
barcode: '<string>',
image_url: '<string>',
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
is_active: true,
pricing_mode: 'automatic',
price: 1,
price_adjustment_percentage: 4950
})
};
fetch('https://api.lapyme.com.ar/api/v1/products/{product_id}', 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/{product_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'product_type' => 'combo',
'name' => '<string>',
'sku' => '<string>',
'components' => [
[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123
]
],
'barcode' => '<string>',
'image_url' => '<string>',
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'is_active' => true,
'pricing_mode' => 'automatic',
'price' => 1,
'price_adjustment_percentage' => 4950
]),
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.lapyme.com.ar/api/v1/products/{product_id}"
payload := strings.NewReader("{\n \"product_type\": \"combo\",\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"components\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123\n }\n ],\n \"barcode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"pricing_mode\": \"automatic\",\n \"price\": 1,\n \"price_adjustment_percentage\": 4950\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.lapyme.com.ar/api/v1/products/{product_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_type\": \"combo\",\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"components\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123\n }\n ],\n \"barcode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"pricing_mode\": \"automatic\",\n \"price\": 1,\n \"price_adjustment_percentage\": 4950\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lapyme.com.ar/api/v1/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_type\": \"combo\",\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"components\": [\n {\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123\n }\n ],\n \"barcode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"pricing_mode\": \"automatic\",\n \"price\": 1,\n \"price_adjustment_percentage\": 4950\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>"
},
"product_type": "product",
"visibility": "both",
"is_active": true,
"organization_slug": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"components": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"sku": "<string>",
"quantity": 123
}
],
"object": "product",
"tags": [
{
"object": "tag",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": "customer",
"name": "<string>",
"slug": "<string>",
"color": "slate",
"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,
"price_source": "automatic",
"applied_price_list": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"is_automatic": true,
"automatic_pricing_mode": "base_price_adjustment",
"adjustment_percentage": 123,
"source_price_list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tax_inclusive": true
}
}
},
"warnings": [
"<unknown>"
]
}{
"request_id": "req_product_update_1",
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request for updating products",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_update_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_update_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_update_1",
"error": {
"code": "NOT_FOUND",
"message": "Product not found",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}{
"request_id": "req_product_update_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_update_1",
"error": {
"code": "INTERNAL_ERROR",
"message": "Could not update the product",
"retryable": false,
"type": "invalid_request_error",
"details": []
}
}Authorizations
Incluí tu API key en el header Authorization con el prefijo Bearer.
Headers
ID opcional de la solicitud para trazabilidad. Si se omite, el servidor genera uno.
Required string length:
1 - 255Clave estable obligatoria cuando product_type es combo. Reutilizala solo para reintentar exactamente la misma actualización.
Required string length:
1 - 255Path Parameters
ID del producto
Body
application/json
- Option 1
- Option 2
Allowed value:
"combo"Required string length:
1 - 255Required string length:
1 - 100Minimum array length:
1Show child attributes
Show child attributes
Maximum string length:
100External product image URL reference. La Pyme displays it best effort and does not copy, ingest, or host the image.
Maximum string length:
2000Available options:
automatic, manual Precio manual en centavos; obligatorio en modo manual.
Required range:
x >= 0Required range:
-100 <= x <= 10000Was this page helpful?

