curl --request PUT \
--url https://api-sandbox.fortalpay.tech/v1/coupons/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"value": 15,
"max_uses": 200,
"expires_at": "2026-09-30T23:59:59",
"status": "ACTIVE"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 15, max_uses: 200, expires_at: '2026-09-30T23:59:59', status: 'ACTIVE'})
};
fetch('https://api-sandbox.fortalpay.tech/v1/coupons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 15, max_uses: 200, expires_at: '2026-09-30T23:59:59', status: 'ACTIVE'})
};
fetch('https://api-sandbox.fortalpay.tech/v1/coupons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-sandbox.fortalpay.tech/v1/coupons/{id}"
payload = {
"value": 15,
"max_uses": 200,
"expires_at": "2026-09-30T23:59:59",
"status": "ACTIVE"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.fortalpay.tech/v1/coupons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'value' => 15,
'max_uses' => 200,
'expires_at' => '2026-09-30T23:59:59',
'status' => 'ACTIVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api-sandbox.fortalpay.tech/v1/coupons/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"value\": 15,\n \"max_uses\": 200,\n \"expires_at\": \"2026-09-30T23:59:59\",\n \"status\": \"ACTIVE\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.fortalpay.tech/v1/coupons/{id}"
payload := strings.NewReader("{\n \"value\": 15,\n \"max_uses\": 200,\n \"expires_at\": \"2026-09-30T23:59:59\",\n \"status\": \"ACTIVE\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api-sandbox.fortalpay.tech/v1/coupons/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"value\": 15,\n \"max_uses\": 200,\n \"expires_at\": \"2026-09-30T23:59:59\",\n \"status\": \"ACTIVE\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"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>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}Atualizar cupom
Partially update a coupon owned by the merchant associated with the API key.
curl --request PUT \
--url https://api-sandbox.fortalpay.tech/v1/coupons/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"value": 15,
"max_uses": 200,
"expires_at": "2026-09-30T23:59:59",
"status": "ACTIVE"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 15, max_uses: 200, expires_at: '2026-09-30T23:59:59', status: 'ACTIVE'})
};
fetch('https://api-sandbox.fortalpay.tech/v1/coupons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 15, max_uses: 200, expires_at: '2026-09-30T23:59:59', status: 'ACTIVE'})
};
fetch('https://api-sandbox.fortalpay.tech/v1/coupons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-sandbox.fortalpay.tech/v1/coupons/{id}"
payload = {
"value": 15,
"max_uses": 200,
"expires_at": "2026-09-30T23:59:59",
"status": "ACTIVE"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.fortalpay.tech/v1/coupons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'value' => 15,
'max_uses' => 200,
'expires_at' => '2026-09-30T23:59:59',
'status' => 'ACTIVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api-sandbox.fortalpay.tech/v1/coupons/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"value\": 15,\n \"max_uses\": 200,\n \"expires_at\": \"2026-09-30T23:59:59\",\n \"status\": \"ACTIVE\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.fortalpay.tech/v1/coupons/{id}"
payload := strings.NewReader("{\n \"value\": 15,\n \"max_uses\": 200,\n \"expires_at\": \"2026-09-30T23:59:59\",\n \"status\": \"ACTIVE\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api-sandbox.fortalpay.tech/v1/coupons/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"value\": 15,\n \"max_uses\": 200,\n \"expires_at\": \"2026-09-30T23:59:59\",\n \"status\": \"ACTIVE\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
{
"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>"
}
]
}
}{
"data": null,
"success": false,
"error": {
"timestamp": "2023-11-07T05:31:56Z",
"status": 123,
"message": "<string>",
"path": "<string>",
"fields": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}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.
Path Parameters
Identificador público do cupom.
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})?$ACTIVE, INACTIVE