curl --request POST \
--url https://api-sandbox.fortalpay.tech/v1/coupons \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "BEMVINDO10",
"type": "PERCENTAGE",
"value": 10
}
'{
"data": {
"id": "6f84d2b5-a612-4e67-8af5-69f98de980f5",
"code": "<string>",
"type": "PERCENTAGE",
"value": 10,
"used_count": 123,
"status": "ACTIVE",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"max_uses": 123,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
},
"success": true,
"error": null
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}Criar cupom
Create a percentage or fixed-amount coupon for the merchant.
POST
/
coupons
curl --request POST \
--url https://api-sandbox.fortalpay.tech/v1/coupons \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "BEMVINDO10",
"type": "PERCENTAGE",
"value": 10
}
'{
"data": {
"id": "6f84d2b5-a612-4e67-8af5-69f98de980f5",
"code": "<string>",
"type": "PERCENTAGE",
"value": 10,
"used_count": 123,
"status": "ACTIVE",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"max_uses": 123,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
},
"success": true,
"error": null
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}Cria um cupom com status
ACTIVE. Cupons percentuais usam um valor de 1 a 100; cupons fixos usam o valor em centavos.Authorizations
Todas as requisições devem incluir sua API key no cabeçalho Authorization
usando o formato ApiKey <sua_api_key>. Não use o esquema Bearer.
Sem esse cabeçalho, a requisição será rejeitada.
Use fpay_sk_test_... no ambiente de teste e fpay_sk_live_... em produção.
Saiba como criar e usar uma API key.
Body
application/json