Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Cria um novo desconto ou cupom
CHARGEFY_ACCESS_TOKEN
Authorization
name
string
type
fixed
percentage
amount
integer
type: fixed
basisPoints
type: percentage
duration
once
repeating
forever
durationInMonths
duration: repeating
maxRedemptions
code
productIds
array
curl -X POST "https://api.chargefy.io/api/v1/discounts/" \ -H "Authorization: Bearer $CHARGEFY_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Desconto de Lançamento", "type": "percentage", "basisPoints": 2000, "duration": "once", "maxRedemptions": 100, "code": "LAUNCH20" }'
import { Chargefy } from '@chargefy/sdk'; const chargefy = new Chargefy({ accessToken: process.env.CHARGEFY_ACCESS_TOKEN, }); const discount = await chargefy.discounts.create({ name: 'Desconto de Lançamento', type: 'percentage', basisPoints: 2000, duration: 'once', maxRedemptions: 100, code: 'LAUNCH20', });
{ "id": "disc_new456", "name": "Desconto de Lançamento", "type": "percentage", "basisPoints": 2000, "duration": "once", "maxRedemptions": 100, "redemptionsCount": 0, "code": "LAUNCH20", "createdAt": "2026-03-12T10:00:00Z" }