Oleada 5 · Documentación

Quick Start

Onboarding para desarrolladores: de cero a un pedido CUSTOM en menos de 15 minutos.

Checklist

Variables de entorno (terminal)

export PUSHSLOG_API_BASE="https://api.pushslog.com"
export PUSHSLOG_API_KEY="pk_TU_CLAVE"
export PUSHSLOG_SHOP_ID="SHOP_ID_TRAS_REGISTRO"

1. Comprobar la API

curl -s "$PUSHSLOG_API_BASE/health"
curl -s "$PUSHSLOG_API_BASE/health/ready"

2. Cuenta y API key

3. Registrar tienda CUSTOM

curl -s -X POST "$PUSHSLOG_API_BASE/api/v1/custom/shops/register" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $PUSHSLOG_API_KEY" \
  -d '{
    "externalShopId": "demo.mi-tienda.com",
    "name": "Mi tienda demo"
  }'
{
  "success": true,
  "data": {
    "shopId": "clx00000000000000000000001",
    "externalShopId": "demo.mi-tienda.com",
    "name": "Mi tienda demo",
    "webhookEndpoint": "https://api.pushslog.com/api/v1/webhook/custom",
    "webhookSecret": "whsec_…",
    "headers": {
      "shopId": "X-PushSLog-Shop-Id",
      "signature": "X-PushSLog-Signature"
    }
  },
  "message": "Guarda webhookSecret; no se vuelve a mostrar si lo generamos nosotros."
}

4. Enviar un pedido

curl -s -X POST "$PUSHSLOG_API_BASE/api/v1/custom/orders" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $PUSHSLOG_API_KEY" \
  -d '{
    "shopId": "'"$PUSHSLOG_SHOP_ID"'",
    "orderId": "ORD-1001",
    "total": 129900,
    "currency": "COP",
    "shippingAddress": {
      "city": "Bogotá",
      "address": "Calle 123 #45-67",
      "zip": "110111"
    }
  }'
{
  "success": true,
  "data": {
    "id": "clx00000000000000000000002",
    "orderNumber": "PS-1042",
    "externalId": "ORD-1001",
    "status": "pending",
    "total": "129900",
    "currency": "COP",
    "shopId": "clx00000000000000000000001"
  }
}

5. Errores frecuentes

HTTPerrorCuándo
401API_KEY_REQUIREDFalta header x-api-key o Bearer pk_…
403API_KEY_INVALIDClave revocada, mal copiada o de otro tenant
400BAD_REQUESTFalta externalShopId, shopId, orderId o total en el body
400CUSTOM_INVALID_SHOP_IDexternalShopId con formato no válido
404CUSTOM_SHOP_NOT_FOUNDshopId no pertenece al tenant de la pk_
500CUSTOM_REGISTER_FAILED / CUSTOM_ORDER_FAILEDError interno; reintenta y contacta soporte con hora UTC

6. Verificar en el panel

7. Siguientes pasos