Criar cupom
curl --request POST \
--url https://apiv3.usecorvex.com.br/api/v1/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Store-Id: <x-store-id>' \
--data '
{
"name": "Black Friday",
"code": "BF10",
"totalAvailable": 0,
"startAt": "2026-09-24T14:00:00.000Z",
"endAt": null,
"discountType": "PERCENT",
"amount": 10,
"singleUsePerCustomer": true,
"automaticApply": false,
"status": "ACTIVE"
}
'const options = {
method: 'POST',
headers: {
'X-Store-Id': '<x-store-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Black Friday',
code: 'BF10',
totalAvailable: 0,
startAt: '2026-09-24T14:00:00.000Z',
endAt: null,
discountType: 'PERCENT',
amount: 10,
singleUsePerCustomer: true,
automaticApply: false,
status: 'ACTIVE'
})
};
fetch('https://apiv3.usecorvex.com.br/api/v1/coupons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apiv3.usecorvex.com.br/api/v1/coupons"
payload = {
"name": "Black Friday",
"code": "BF10",
"totalAvailable": 0,
"startAt": "2026-09-24T14:00:00.000Z",
"endAt": None,
"discountType": "PERCENT",
"amount": 10,
"singleUsePerCustomer": True,
"automaticApply": False,
"status": "ACTIVE"
}
headers = {
"X-Store-Id": "<x-store-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"coupon": {
"id": "99999999-9999-4999-8999-999999999999",
"storeId": "11111111-1111-4111-8111-111111111111",
"name": "Black Friday",
"code": "BF10",
"totalAvailable": 0,
"usedCount": 12,
"startAt": "2026-09-24T14:00:00.000Z",
"endAt": null,
"discountType": "PERCENT",
"amount": 10,
"singleUsePerCustomer": true,
"automaticApply": false,
"status": "ACTIVE",
"createdAt": "2026-09-24T14:00:00.000Z",
"updatedAt": "2026-09-24T14:00:00.000Z"
}
}
}{
"success": false,
"error": {
"message": "X-Store-Id deve ser um UUID válido",
"code": "VALIDATION_ERROR"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 400
}
}{
"success": false,
"error": {
"message": "Esta rota exige uma API Key. Use Authorization: Bearer cvx_live_...",
"code": "AUTH_API_KEY_REQUIRED"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 401
}
}{
"success": false,
"error": {
"message": "Sua API Key não tem o escopo necessário para esta operação.",
"code": "AUTH_SCOPE_DENIED"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 403
}
}{
"success": false,
"error": {
"message": "O código \"BF10\" já está em uso nesta loja.",
"code": "DUPLICATE_ENTRY"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 409
}
}{
"success": false,
"message": "Muitas requisições. Tente novamente em instantes.",
"error": "RATE_LIMITED",
"retryAfter": 12
}Cupons
Criar cupom
POST
/
api
/
v1
/
coupons
Criar cupom
curl --request POST \
--url https://apiv3.usecorvex.com.br/api/v1/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Store-Id: <x-store-id>' \
--data '
{
"name": "Black Friday",
"code": "BF10",
"totalAvailable": 0,
"startAt": "2026-09-24T14:00:00.000Z",
"endAt": null,
"discountType": "PERCENT",
"amount": 10,
"singleUsePerCustomer": true,
"automaticApply": false,
"status": "ACTIVE"
}
'const options = {
method: 'POST',
headers: {
'X-Store-Id': '<x-store-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Black Friday',
code: 'BF10',
totalAvailable: 0,
startAt: '2026-09-24T14:00:00.000Z',
endAt: null,
discountType: 'PERCENT',
amount: 10,
singleUsePerCustomer: true,
automaticApply: false,
status: 'ACTIVE'
})
};
fetch('https://apiv3.usecorvex.com.br/api/v1/coupons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apiv3.usecorvex.com.br/api/v1/coupons"
payload = {
"name": "Black Friday",
"code": "BF10",
"totalAvailable": 0,
"startAt": "2026-09-24T14:00:00.000Z",
"endAt": None,
"discountType": "PERCENT",
"amount": 10,
"singleUsePerCustomer": True,
"automaticApply": False,
"status": "ACTIVE"
}
headers = {
"X-Store-Id": "<x-store-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"coupon": {
"id": "99999999-9999-4999-8999-999999999999",
"storeId": "11111111-1111-4111-8111-111111111111",
"name": "Black Friday",
"code": "BF10",
"totalAvailable": 0,
"usedCount": 12,
"startAt": "2026-09-24T14:00:00.000Z",
"endAt": null,
"discountType": "PERCENT",
"amount": 10,
"singleUsePerCustomer": true,
"automaticApply": false,
"status": "ACTIVE",
"createdAt": "2026-09-24T14:00:00.000Z",
"updatedAt": "2026-09-24T14:00:00.000Z"
}
}
}{
"success": false,
"error": {
"message": "X-Store-Id deve ser um UUID válido",
"code": "VALIDATION_ERROR"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 400
}
}{
"success": false,
"error": {
"message": "Esta rota exige uma API Key. Use Authorization: Bearer cvx_live_...",
"code": "AUTH_API_KEY_REQUIRED"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 401
}
}{
"success": false,
"error": {
"message": "Sua API Key não tem o escopo necessário para esta operação.",
"code": "AUTH_SCOPE_DENIED"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 403
}
}{
"success": false,
"error": {
"message": "O código \"BF10\" já está em uso nesta loja.",
"code": "DUPLICATE_ENTRY"
},
"meta": {
"timestamp": "2026-09-24T14:00:00.000Z",
"status": 409
}
}{
"success": false,
"message": "Muitas requisições. Tente novamente em instantes.",
"error": "RATE_LIMITED",
"retryAfter": 12
}Authorizations
API Key no formato cvx_live_..., criada no painel Corvex. Não use JWT de sessão nem x-api-key.
Headers
UUID da loja. A chave precisa ter esta loja autorizada.
Body
application/json
Required string length:
1 - 120Código que o cliente digita. Não muda depois de criado.
Required string length:
3 - 64Available options:
CURRENCY, PERCENT Valor em reais (CURRENCY) ou percentual (PERCENT).
Required range:
x >= 00 = ilimitado.
Required range:
x >= 0Início da vigência (ISO 8601).
Fim da vigência. null = sem término.
Aplica sozinho no checkout quando as regras batem.
Available options:
ACTIVE, INACTIVE Response
Criado.