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.
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>"
}
]
}
}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
Merchant-unique code. It is trimmed and converted to uppercase.
1 - 50PERCENTAGE, FIXED_AMOUNT Integer percentage from 1 to 100 for PERCENTAGE; discount in cents for FIXED_AMOUNT.
x >= 1Maximum number of uses. Null or -1 means unlimited.
Local date in yyyy-MM-dd format or local date and time in yyyy-MM-dd'T'HH:mm:ss format. Date-only starts_at uses 00:00:00 and date-only expires_at uses 23:59:59.
^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?$Local date in yyyy-MM-dd format or local date and time in yyyy-MM-dd'T'HH:mm:ss format. Date-only starts_at uses 00:00:00 and date-only expires_at uses 23:59:59.
^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?$