Skip to content
PromotionsDiscounts

Create discount

Creates a discount with type, amount, rules, schedule and limits; returns its ID.

Header Parameters

x-Store-Id?string

Store the request acts on. Not needed when the token is bound to a store.

Authorization*string

OAuth 2.0 bearer token.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

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"}