Discount codes
Create a discount code
POST
Creates a percent-off code for the listed products, limited to a number of discounted units.
apiKeyheader
AuthorizationBearer <token>An API key of the organization the request acts for, created in the dashboard and sent as "Authorization: Bearer ".
Discount code details
application/json- body
code*stringWhat the buyer types. Stored in uppercase, so it matches in any case.
Length
3 <= length <= 50Example
"VERANO25"percentOffBasisPoints*integerPercent off each discounted unit, in hundredths of a percent
Range
1 <= value <= 10000Example
2500maxUses*integerHow many units, across all checkouts, the code can discount
Range
1 <= value <= 2147483647Example
100products*array<>The products the code discounts. Each product is created on first use and renamed on later requests. A code cannot be live twice on the same product.
Items
1 <= itemsThe discount code as stored
application/json- response
id*stringFormat
uuidExample
"3f9b2d7e-1c4a-4b8e-a6f0-5d2e8c1b7a94"code*stringExample
"VERANO25"percentOffBasisPoints*integerExample
2500remainingUses*integerExample
100createdAt*stringFormat
date-timeExample
"2026-10-01T16:45:18.000Z"curl -X POST 'https://api.rapidopagos.com/discount-code' \ -H 'Content-Type: application/json' \ -d '{ "code": "VERANO25", "percentOffBasisPoints": 2500, "maxUses": 100, "products": [ { "externalId": "ticket-type-vip", "name": "Concierto X, VIP" } ]}'Example Response
{ "id": "3f9b2d7e-1c4a-4b8e-a6f0-5d2e8c1b7a94", "code": "VERANO25", "percentOffBasisPoints": 2500, "remainingUses": 100, "createdAt": "2026-10-01T16:45:18.000Z"}