Saltar al contenido
PromocionesDescuentos

Crear descuento

Crea un descuento con tipo, importe, reglas, vigencia y límites; devuelve su ID.

Parámetros de cabecera

x-Store-Id?string

Tienda sobre la que actúa la solicitud. No hace falta cuando el token ya está vinculado a una tienda.

Authorization*string

Token bearer OAuth 2.0.

Cuerpo de la solicitud

application/json

Definiciones TypeScript

Usa esta definición en TypeScript.

Cuerpo de la respuesta

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.ecomiq.pe/api/v1/discounts" \  -H "x-Store-Id: <store-id>" \  -H "Authorization: Bearer <token>" \  -H "Content-Type: application/json" \  -d '{    "name": "Polos al 15 %",    "description": "15 % de descuento en todos los polos.",    "status": "active",    "type": "percentage",    "target": "item",    "amount": 15,    "combineWithOtherDiscounts": false,    "validFrom": "2026-10-01T05:00:00Z",    "validTo": "2026-11-01T04:59:59Z",    "rules": [      {        "field": "categoryId",        "operator": "in",        "resourceIds": [          "7204558912004325310"        ]      }    ]  }'
{  "id": "7204558912004325431"}