Rápido Pagos
Discount codes

Create a discount code

POST
/discount-code

Creates a percent-off code for the listed products, limited to a number of discounted units.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key of the organization the request acts for, created in the dashboard and sent as "Authorization: Bearer ".

Request Body

Discount code details

application/json
  1. body
code*string

What the buyer types. Stored in uppercase, so it matches in any case.

Length3 <= length <= 50
Example"VERANO25"
percentOffBasisPoints*integer

Percent off each discounted unit, in hundredths of a percent

Range1 <= value <= 10000
Example2500
maxUses*integer

How many units, across all checkouts, the code can discount

Range1 <= value <= 2147483647
Example100
products*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.

Items1 <= items

Response Body

The discount code as stored

application/json
  1. response
id*string
Formatuuid
Example"3f9b2d7e-1c4a-4b8e-a6f0-5d2e8c1b7a94"
code*string
Example"VERANO25"
percentOffBasisPoints*integer
Example2500
remainingUses*integer
Example100
createdAt*string
Formatdate-time
Example"2026-10-01T16:45:18.000Z"
Create a discount code
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"}