GET /api/v1/products
Lista productos paginados para partners externos con el payload de producto de la Shoppex Partner API. El backorder solo cambia qué productos son visibles y si stock_quantity proviene de Stock o de StockSC. image_url se resuelve desde SellerCloud y se cachea en el servidor; en un raro fallo de caché puede ser null y se completa en una solicitud posterior.
Cabeceras requeridas
X-Shoppex-Key: pk_demo_partner_keyX-Shoppex-Timestamp: 1775726400X-Shoppex-Nonce: req-demo-001X-Shoppex-Signature: hmac_sha256_signature_placeholder
Atributos de la solicitud
Atributos requeridos
-
NingunoEste endpoint no requiere atributos en el cuerpo de la solicitud.
Atributos opcionales
-
pagePágina del catálogo a consultar. Por defecto: 1. -
per_pageProductos por página. Por defecto: 100. Máximo: 100. -
searchBúsqueda por nombre de producto, ProductID/SKU o UPC. -
brandFiltra por marca exacta. -
typeFiltra por tipo de producto exacto. -
subcategoryFiltra por subcategoria de perfume: arabe (Árabe), disenador (Diseñador) o nicho (Nicho). Los productos aun sin clasificar (subcategory null) nunca coinciden.
Ejemplo de solicitud
curl -X GET "https://partners-api.shoppexcorp.com/api/v1/products?page=1&per_page=100" \
-H "X-Shoppex-Key: pk_demo_partner_key" \
-H "X-Shoppex-Timestamp: 1775726400" \
-H "X-Shoppex-Nonce: req-demo-001" \
-H "X-Shoppex-Signature: hmac_sha256_signature_placeholder"
Ejemplos de implementación
Node.js
import crypto from 'node:crypto';
const baseUrl = 'https://partners-api.shoppexcorp.com';
const partnerKey = 'YOUR_PARTNER_KEY';
const partnerSecret = 'YOUR_PARTNER_SECRET';
const method = 'GET';
const route = '/api/v1/products';
const body = '';
const timestamp = Math.floor(Date.now() / 1000).toString();
const nonce = crypto.randomUUID();
const bodyHash = crypto.createHash('sha256').update(body).digest('hex');
const message = [method, route, timestamp, nonce, bodyHash].join('\n');
const signature = crypto
.createHmac('sha256', partnerSecret)
.update(message)
.digest('hex');
const response = await fetch(`${baseUrl}/api/v1/products?page=1&per_page=100`, {
method,
headers: {
'Content-Type': 'application/json',
'X-Shoppex-Key': partnerKey,
'X-Shoppex-Timestamp': timestamp,
'X-Shoppex-Nonce': nonce,
'X-Shoppex-Signature': signature,
},
});
const data = await response.json();
console.log(data);
cURL
<?php
$baseUrl = 'https://partners-api.shoppexcorp.com';
$partnerKey = 'YOUR_PARTNER_KEY';
$partnerSecret = 'YOUR_PARTNER_SECRET';
$method = 'GET';
$route = '/api/v1/products';
$body = '';
$timestamp = (string) time();
$nonce = bin2hex(random_bytes(16));
$bodyHash = hash('sha256', $body);
$message = implode("\n", [$method, $route, $timestamp, $nonce, $bodyHash]);
$signature = hash_hmac('sha256', $message, $partnerSecret);
$ch = curl_init($baseUrl.'/api/v1/products?page=1&per_page=100');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Shoppex-Key: '.$partnerKey,
'X-Shoppex-Timestamp: '.$timestamp,
'X-Shoppex-Nonce: '.$nonce,
'X-Shoppex-Signature: '.$signature,
],
]);
if ($body !== '') {
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
}
$response = curl_exec($ch);
curl_close($ch);
echo $response;
requests
import hashlib
import hmac
import json
import time
import uuid
import requests
base_url = 'https://partners-api.shoppexcorp.com'
partner_key = 'YOUR_PARTNER_KEY'
partner_secret = 'YOUR_PARTNER_SECRET'
method = 'GET'
route = '/api/v1/products'
body = ''
timestamp = str(int(time.time()))
nonce = str(uuid.uuid4())
body_hash = hashlib.sha256(body.encode()).hexdigest()
message = '\n'.join([method, route, timestamp, nonce, body_hash])
signature = hmac.new(
partner_secret.encode(),
message.encode(),
hashlib.sha256,
).hexdigest()
response = requests.request(
method,
base_url + '/api/v1/products?page=1&per_page=100',
headers={
'Content-Type': 'application/json',
'X-Shoppex-Key': partner_key,
'X-Shoppex-Timestamp': timestamp,
'X-Shoppex-Nonce': nonce,
'X-Shoppex-Signature': signature,
},
timeout=30,
)
print(response.status_code)
print(response.json())
Ejemplo de respuesta exitosa
{
"success": true,
"data": [
{
"product_id": "WHO-ZAK-731529",
"sku": "WHO-ZAK-731529",
"name": "Demo SC Product",
"price": "19.99",
"stock_quantity": 24,
"type": "Perfume",
"brand": "Demo Brand",
"subcategory": "disenador",
"upc": "000000000001",
"image_url": "https://cdn.shoppexcorp.com/products/demo-product.jpg",
"origin": "SC",
"stock_sc": 24,
"qty_per_case": 12,
"min_start": 12
}
],
"pagination": {
"page": 1,
"per_page": 100,
"total": 348,
"total_pages": 4,
"has_next": true,
"has_prev": false
}
}
Ejemplo de respuesta de error
{
"success": false,
"code": "partner_auth_invalid_signature",
"message": "HMAC signature does not match."
}
Códigos de error posibles
| Código | Motivo |
|---|---|
401 |
Faltan cabeceras HMAC, timestamp inválido o vencido, nonce reutilizado, key inválida o firma incorrecta. |
403 |
El partner no tiene el permiso products.read. |
429 |
Demasiadas solicitudes para la misma key de partner y endpoint. Reintente cuando se reinicie la ventana del rate limit. |