Integraciones para partners

Shoppex Partner API

La Shoppex Partner API permite a partners externos aprobados consultar de forma segura el catálogo de productos disponible y crear órdenes para clientes existentes de Shoppex mediante integraciones REST servidor a servidor. Las solicitudes se autentican con API key y cabeceras de firma HMAC.

Se requiere autenticación HMAC. Toda solicitud debe incluir X-Shoppex-Key, X-Shoppex-Timestamp, X-Shoppex-Nonce y X-Shoppex-Signature. Las solicitudes JSON también deben incluir Content-Type: application/json.
La firma se calcula a partir de METHOD, ROUTE, TIMESTAMP, NONCE y el hash SHA256 del cuerpo crudo. ROUTE es solo la ruta REST: sin dominio y sin query string. Por ejemplo, /api/v1/products?page=1 firma /api/v1/products.

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.

GET
Ruta del endpoint /api/v1/products
URL completa https://partners-api.shoppexcorp.com/api/v1/products

Cabeceras requeridas

  • X-Shoppex-Key: pk_demo_partner_key
  • X-Shoppex-Timestamp: 1775726400
  • X-Shoppex-Nonce: req-demo-001
  • X-Shoppex-Signature: hmac_sha256_signature_placeholder

Atributos de la solicitud

Atributos requeridos

  • Ninguno Este endpoint no requiere atributos en el cuerpo de la solicitud.

Atributos opcionales

  • page Página del catálogo a consultar. Por defecto: 1.
  • per_page Productos por página. Por defecto: 100. Máximo: 100.
  • search Búsqueda por nombre de producto, ProductID/SKU o UPC.
  • brand Filtra por marca exacta.
  • type Filtra por tipo de producto exacto.
  • subcategory Filtra 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
JavaScript 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);
PHP 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;
Python 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ódigoMotivo
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.

POST /api/v1/orders

Crea una orden a través del cliente por defecto configurado para el partner autenticado. La solicitud envía solo el ID de orden del partner y los ítems; los datos de cliente, facturación y envío se cargan desde la configuración del partner. El monto de la orden debe cumplir la regla de negocio del partner. El envío a SellerCloud se encola después de crear la orden local.

POST
Ruta del endpoint /api/v1/orders
URL completa https://partners-api.shoppexcorp.com/api/v1/orders

Cabeceras requeridas

  • Content-Type: application/json
  • X-Shoppex-Key: pk_demo_partner_key
  • X-Shoppex-Timestamp: 1775726400
  • X-Shoppex-Nonce: req-demo-001
  • X-Shoppex-Signature: hmac_sha256_signature_placeholder

Atributos de la solicitud

Atributos requeridos

  • items Arreglo de productos a incluir en la orden. Debe contener al menos un ítem.
  • items[].product_id or items[].sku Envíe el ProductID/SKU de data-sc.csv. Si se envían product_id y sku, ambos deben apuntar al mismo producto.
  • items[].quantity Cantidad a comprar. Debe ser un entero mayor que cero.
  • id_order_partner ID de la orden en el sistema externo del partner. Se guarda localmente y se envía a SellerCloud en el campo Notes de cada ítem.

Atributos opcionales

  • comments Comentario o nota opcional del partner.
  • tax_id Metadato fiscal opcional. Toma el valor del cliente del partner cuando está configurado.
  • resale_tax Metadato fiscal opcional. Toma el valor del cliente del partner cuando está configurado.

Ejemplo de solicitud

curl -X POST "https://partners-api.shoppexcorp.com/api/v1/orders" \
  -H "Content-Type: application/json" \
  -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" \
  -d '{
    "items": [
        {
            "product_id": "WHO-ZAK-731529",
            "quantity": 2
        }
    ],
    "id_order_partner": "PARTNER-ORDER-12345",
    "comments": "Demo order created by an external partner integration."
}'
Ejemplos de implementación
JavaScript 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 = 'POST';
const route = '/api/v1/orders';
const body = JSON.stringify({
    "items": [
        {
            "product_id": "WHO-ZAK-731529",
            "quantity": 2
        }
    ],
    "id_order_partner": "PARTNER-ORDER-12345",
    "comments": "Demo order created by an external partner integration."
});
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/orders`, {
  method,
  headers: {
    'Content-Type': 'application/json',
    'X-Shoppex-Key': partnerKey,
    'X-Shoppex-Timestamp': timestamp,
    'X-Shoppex-Nonce': nonce,
    'X-Shoppex-Signature': signature,
  },
  body,
});

const data = await response.json();
console.log(data);
PHP cURL
<?php
$baseUrl = 'https://partners-api.shoppexcorp.com';
$partnerKey = 'YOUR_PARTNER_KEY';
$partnerSecret = 'YOUR_PARTNER_SECRET';
$method = 'POST';
$route = '/api/v1/orders';
$body = json_encode(array (
  'items' => 
  array (
    0 => 
    array (
      'product_id' => 'WHO-ZAK-731529',
      'quantity' => 2,
    ),
  ),
  'id_order_partner' => 'PARTNER-ORDER-12345',
  'comments' => 'Demo order created by an external partner integration.',
), JSON_UNESCAPED_SLASHES);
$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/orders');
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;
Python 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 = 'POST'
route = '/api/v1/orders'
body = json.dumps({
    "items": [
        {
            "product_id": "WHO-ZAK-731529",
            "quantity": 2
        }
    ],
    "id_order_partner": "PARTNER-ORDER-12345",
    "comments": "Demo order created by an external partner integration."
}, separators=(",", ":"))
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/orders',
    headers={
        'Content-Type': 'application/json',
        'X-Shoppex-Key': partner_key,
        'X-Shoppex-Timestamp': timestamp,
        'X-Shoppex-Nonce': nonce,
        'X-Shoppex-Signature': signature,
    }, data=body,
    timeout=30,
)

print(response.status_code)
print(response.json())

Ejemplo de respuesta exitosa

{
    "success": true,
    "order_id": 98765,
    "order_source_order_id": "SP15O98765",
    "partner_order_id": "PARTNER-ORDER-12345",
    "status": "queued",
    "sellercloud_order_id": null
}

Ejemplo de respuesta de error

{
    "success": false,
    "code": "partner_customer_billing_incomplete",
    "message": "Partner billing address is incomplete."
}

Códigos de error posibles

CódigoMotivo
400 Payload inválido, faltan ítems, falta id_order_partner, identificador de producto inválido, product_id y sku no coinciden o cantidad de producto inválida.
401 Faltan cabeceras HMAC, timestamp inválido o vencido, nonce reutilizado, key inválida o firma incorrecta.
403 El partner no tiene el permiso orders.create, el monto de la orden no está permitido o la orden contiene productos en backorder con el backorder deshabilitado.
404 No se encontró el cliente configurado o alguno de los productos solicitados.
409 El mismo id_order_partner ya fue usado por este partner con un payload distinto.
422 El cliente por defecto, la dirección de facturación o la dirección de envío del partner están incompletos.
429 Demasiadas solicitudes para la misma key de partner y endpoint. Reintente cuando se reinicie la ventana del rate limit.

GET /api/v1/orders

Lista únicamente las órdenes que pertenecen al partner autenticado.

GET
Ruta del endpoint /api/v1/orders
URL completa https://partners-api.shoppexcorp.com/api/v1/orders

Cabeceras requeridas

  • X-Shoppex-Key: pk_demo_partner_key
  • X-Shoppex-Timestamp: 1775726400
  • X-Shoppex-Nonce: req-demo-001
  • X-Shoppex-Signature: hmac_sha256_signature_placeholder

Atributos de la solicitud

Atributos requeridos

  • Ninguno Este endpoint no requiere atributos en el cuerpo de la solicitud.

Atributos opcionales

  • page Página de órdenes a consultar. Por defecto: 1.
  • per_page Órdenes por página. Por defecto: 100. Máximo: 200.
  • limit Alias de per_page cuando no se envía per_page. Máximo: 200.
  • status Filtra por estado de la orden, por ejemplo queued, sending, confirmed o failed.
  • from Filtra órdenes creadas en esta fecha o después. Formato: YYYY-MM-DD.
  • to Filtra órdenes creadas en esta fecha o antes. Formato: YYYY-MM-DD.

Ejemplo de solicitud

curl -X GET "https://partners-api.shoppexcorp.com/api/v1/orders?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
JavaScript 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/orders';
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/orders?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);
PHP cURL
<?php
$baseUrl = 'https://partners-api.shoppexcorp.com';
$partnerKey = 'YOUR_PARTNER_KEY';
$partnerSecret = 'YOUR_PARTNER_SECRET';
$method = 'GET';
$route = '/api/v1/orders';
$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/orders?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;
Python 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/orders'
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/orders?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": [
        {
            "id": 98765,
            "order": null,
            "partner_order_id": "PARTNER-ORDER-12345",
            "order_source_order_id": "SP15O98765",
            "date": "2026-08-10T08:30:00+00:00",
            "status": "queued",
            "price": 1999.98,
            "invoiceAvailable": false,
            "shipping_service": "Local Delivery"
        }
    ],
    "pagination": {
        "page": 1,
        "per_page": 100,
        "total": 8,
        "total_pages": 1
    }
}

Ejemplo de respuesta de error

{
    "success": false,
    "code": "partner_auth_invalid_signature",
    "message": "HMAC signature does not match."
}

Códigos de error posibles

CódigoMotivo
401 Faltan cabeceras HMAC, timestamp inválido o vencido, nonce reutilizado, key inválida o firma incorrecta.
403 El partner no tiene el permiso orders.read.
429 Demasiadas solicitudes para la misma key de partner y endpoint. Reintente cuando se reinicie la ventana del rate limit.

GET /api/v1/orders/{order_id}

Busca una orden del partner autenticado por ID local, ID de orden del partner, OrderSourceOrderID o ID de orden de SellerCloud.

GET
Ruta del endpoint /api/v1/orders/{order_id}
URL completa https://partners-api.shoppexcorp.com/api/v1/orders/{order_id}

Cabeceras requeridas

  • X-Shoppex-Key: pk_demo_partner_key
  • X-Shoppex-Timestamp: 1775726400
  • X-Shoppex-Nonce: req-demo-001
  • X-Shoppex-Signature: hmac_sha256_signature_placeholder

Atributos de la solicitud

Atributos requeridos

  • order_id ID local, ID de orden del partner, OrderSourceOrderID o ID de orden de SellerCloud.

Atributos opcionales

  • Ninguno Este endpoint no admite atributos opcionales.

Ejemplo de solicitud

curl -X GET "https://partners-api.shoppexcorp.com/api/v1/orders/PARTNER-ORDER-12345" \
  -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
JavaScript 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/orders/PARTNER-ORDER-12345';
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/orders/PARTNER-ORDER-12345`, {
  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);
PHP cURL
<?php
$baseUrl = 'https://partners-api.shoppexcorp.com';
$partnerKey = 'YOUR_PARTNER_KEY';
$partnerSecret = 'YOUR_PARTNER_SECRET';
$method = 'GET';
$route = '/api/v1/orders/PARTNER-ORDER-12345';
$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/orders/PARTNER-ORDER-12345');
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;
Python 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/orders/PARTNER-ORDER-12345'
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/orders/PARTNER-ORDER-12345',
    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": {
        "id": 98765,
        "partner_order_id": "PARTNER-ORDER-12345",
        "order_source_order_id": "SP15O98765",
        "sellercloud_order_id": null,
        "status": "queued",
        "subtotal": 1999.98,
        "total": 1999.98,
        "billing": {
            "first_name": "John",
            "last_name": "Doe",
            "business": "Customer Business",
            "country": "US",
            "city": "Miami",
            "state": "FL",
            "zip_code": "33101",
            "address_1": "123 Main St",
            "phone": "+17865550123",
            "email": "customer@example.com"
        },
        "shipping": {
            "first_name": "John",
            "last_name": "Doe",
            "country": "US",
            "city": "Miami",
            "state": "FL",
            "zip_code": "33101",
            "address_1": "123 Main St",
            "phone": "+17865550123"
        },
        "items": [
            {
                "product_id": "WHO-ZAK-731529",
                "name": "Demo SC Product",
                "quantity": 2,
                "price": 999.99,
                "total": 1999.98,
                "upc": "000000000001"
            }
        ],
        "sellercloud": {
            "last_status": "queued",
            "last_response": null,
            "last_error": null
        }
    }
}

Ejemplo de respuesta de error

{
    "success": false,
    "code": "order_not_found",
    "message": "Order was not found."
}

Códigos de error posibles

CódigoMotivo
401 Faltan cabeceras HMAC, timestamp inválido o vencido, nonce reutilizado, key inválida o firma incorrecta.
403 El partner no tiene el permiso orders.read.
404 No se encontró la orden para el partner autenticado.
429 Demasiadas solicitudes para la misma key de partner y endpoint. Reintente cuando se reinicie la ventana del rate limit.