curl --request POST \
--url https://sandbox-api.superpagamentos.com/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "536feaf7-014b-4ad3-a2db-f14897bc2275",
"tokenizedCardId": "10aaa074-dd95-4bdb-9618-f81e6fdc1e17",
"title": "Plano Premium Mensal",
"amount": 2990,
"frequency": 30,
"dueDate": "2025-06-04",
"setupAmount": 1000,
"duration": 12,
"expirationDate": "2026-06-04",
"tolerancePeriod": 5,
"split": [
{
"subaccountId": "c873d310-d2eb-41da-adaa-36fc8900fb99",
"splitType": "percentage",
"chargebackLiable": true,
"splitPercentage": 80,
"splitAmount": 80
}
]
}
'import requests
url = "https://sandbox-api.superpagamentos.com/subscriptions"
payload = {
"customerId": "536feaf7-014b-4ad3-a2db-f14897bc2275",
"tokenizedCardId": "10aaa074-dd95-4bdb-9618-f81e6fdc1e17",
"title": "Plano Premium Mensal",
"amount": 2990,
"frequency": 30,
"dueDate": "2025-06-04",
"setupAmount": 1000,
"duration": 12,
"expirationDate": "2026-06-04",
"tolerancePeriod": 5,
"split": [
{
"subaccountId": "c873d310-d2eb-41da-adaa-36fc8900fb99",
"splitType": "percentage",
"chargebackLiable": True,
"splitPercentage": 80,
"splitAmount": 80
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '536feaf7-014b-4ad3-a2db-f14897bc2275',
tokenizedCardId: '10aaa074-dd95-4bdb-9618-f81e6fdc1e17',
title: 'Plano Premium Mensal',
amount: 2990,
frequency: 30,
dueDate: '2025-06-04',
setupAmount: 1000,
duration: 12,
expirationDate: '2026-06-04',
tolerancePeriod: 5,
split: [
{
subaccountId: 'c873d310-d2eb-41da-adaa-36fc8900fb99',
splitType: 'percentage',
chargebackLiable: true,
splitPercentage: 80,
splitAmount: 80
}
]
})
};
fetch('https://sandbox-api.superpagamentos.com/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.superpagamentos.com/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => '536feaf7-014b-4ad3-a2db-f14897bc2275',
'tokenizedCardId' => '10aaa074-dd95-4bdb-9618-f81e6fdc1e17',
'title' => 'Plano Premium Mensal',
'amount' => 2990,
'frequency' => 30,
'dueDate' => '2025-06-04',
'setupAmount' => 1000,
'duration' => 12,
'expirationDate' => '2026-06-04',
'tolerancePeriod' => 5,
'split' => [
[
'subaccountId' => 'c873d310-d2eb-41da-adaa-36fc8900fb99',
'splitType' => 'percentage',
'chargebackLiable' => true,
'splitPercentage' => 80,
'splitAmount' => 80
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.superpagamentos.com/subscriptions"
payload := strings.NewReader("{\n \"customerId\": \"536feaf7-014b-4ad3-a2db-f14897bc2275\",\n \"tokenizedCardId\": \"10aaa074-dd95-4bdb-9618-f81e6fdc1e17\",\n \"title\": \"Plano Premium Mensal\",\n \"amount\": 2990,\n \"frequency\": 30,\n \"dueDate\": \"2025-06-04\",\n \"setupAmount\": 1000,\n \"duration\": 12,\n \"expirationDate\": \"2026-06-04\",\n \"tolerancePeriod\": 5,\n \"split\": [\n {\n \"subaccountId\": \"c873d310-d2eb-41da-adaa-36fc8900fb99\",\n \"splitType\": \"percentage\",\n \"chargebackLiable\": true,\n \"splitPercentage\": 80,\n \"splitAmount\": 80\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.superpagamentos.com/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"536feaf7-014b-4ad3-a2db-f14897bc2275\",\n \"tokenizedCardId\": \"10aaa074-dd95-4bdb-9618-f81e6fdc1e17\",\n \"title\": \"Plano Premium Mensal\",\n \"amount\": 2990,\n \"frequency\": 30,\n \"dueDate\": \"2025-06-04\",\n \"setupAmount\": 1000,\n \"duration\": 12,\n \"expirationDate\": \"2026-06-04\",\n \"tolerancePeriod\": 5,\n \"split\": [\n {\n \"subaccountId\": \"c873d310-d2eb-41da-adaa-36fc8900fb99\",\n \"splitType\": \"percentage\",\n \"chargebackLiable\": true,\n \"splitPercentage\": 80,\n \"splitAmount\": 80\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.superpagamentos.com/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"536feaf7-014b-4ad3-a2db-f14897bc2275\",\n \"tokenizedCardId\": \"10aaa074-dd95-4bdb-9618-f81e6fdc1e17\",\n \"title\": \"Plano Premium Mensal\",\n \"amount\": 2990,\n \"frequency\": 30,\n \"dueDate\": \"2025-06-04\",\n \"setupAmount\": 1000,\n \"duration\": 12,\n \"expirationDate\": \"2026-06-04\",\n \"tolerancePeriod\": 5,\n \"split\": [\n {\n \"subaccountId\": \"c873d310-d2eb-41da-adaa-36fc8900fb99\",\n \"splitType\": \"percentage\",\n \"chargebackLiable\": true,\n \"splitPercentage\": 80,\n \"splitAmount\": 80\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "0b756e37-d852-4aa6-ae10-80e4b35e5cd7",
"customerId": "536feaf7-014b-4ad3-a2db-f14897bc2275",
"cardId": "10aaa074-dd95-4bdb-9618-f81e6fdc1e17",
"title": "Plano Premium Mensal",
"amount": 2990,
"setupAmount": 1000,
"frequency": 30,
"duration": 12,
"dueDate": "2025-06-04",
"expirationDate": "2026-06-04",
"tolerancePeriod": 5,
"status": "ACTIVE",
"createdAt": "2025-06-04T23:00:54.887Z",
"updatedAt": "2025-06-04T23:00:54.887Z",
"canceledAt": null,
"splits": [
{
"subaccountId": "c873d310-d2eb-41da-adaa-36fc8900fb99",
"splitType": "percentage",
"splitPercentage": 80,
"splitAmount": null,
"liquidAmount": 2392,
"chargebackLiable": true
}
]
},
"message": "Assinatura criada com sucesso"
}Adicionar assinatura
Cria uma nova assinatura recorrente para um cliente. As assinaturas recorrentes permitem cobrar automaticamente um valor fixo em intervalos regulares, facilitando a gestão de pagamentos recorrentes.
Fluxo de funcionamento:
- A assinatura é criada com os dados do cliente, cartão, valores e frequência
- No dia especificado em
dueDate, é realizada a primeira cobrança - As cobranças subsequentes ocorrem automaticamente de acordo com a
frequencydefinida - O sistema respeita o
tolerancePeriodpara tentativas de cobrança em caso de falha - A assinatura pode ter duração limitada (
duration) ou ser vitalícia - É possível definir uma data de expiração (
expirationDate) para encerramento automático
Vantagens:
- Automatização de cobranças recorrentes
- Gestão simplificada de assinaturas
- Suporte a diferentes frequências de cobrança
- Possibilidade de split entre subcontas
- Período de tolerância para tentativas de cobrança
- Flexibilidade na duração e expiração
Validações importantes:
- O cliente e o cartão devem existir e estar ativos
- A data de início (
dueDate) não pode ser no passado - O valor total dos splits deve somar 100% ou o valor total da assinatura
- Apenas uma subconta pode ser responsável por chargebacks
- O período de tolerância é opcional e deve ser maior que 0
- O valor de setup é opcional e deve ser maior que 100 (R$ 1,00) quando informado
curl --request POST \
--url https://sandbox-api.superpagamentos.com/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "536feaf7-014b-4ad3-a2db-f14897bc2275",
"tokenizedCardId": "10aaa074-dd95-4bdb-9618-f81e6fdc1e17",
"title": "Plano Premium Mensal",
"amount": 2990,
"frequency": 30,
"dueDate": "2025-06-04",
"setupAmount": 1000,
"duration": 12,
"expirationDate": "2026-06-04",
"tolerancePeriod": 5,
"split": [
{
"subaccountId": "c873d310-d2eb-41da-adaa-36fc8900fb99",
"splitType": "percentage",
"chargebackLiable": true,
"splitPercentage": 80,
"splitAmount": 80
}
]
}
'import requests
url = "https://sandbox-api.superpagamentos.com/subscriptions"
payload = {
"customerId": "536feaf7-014b-4ad3-a2db-f14897bc2275",
"tokenizedCardId": "10aaa074-dd95-4bdb-9618-f81e6fdc1e17",
"title": "Plano Premium Mensal",
"amount": 2990,
"frequency": 30,
"dueDate": "2025-06-04",
"setupAmount": 1000,
"duration": 12,
"expirationDate": "2026-06-04",
"tolerancePeriod": 5,
"split": [
{
"subaccountId": "c873d310-d2eb-41da-adaa-36fc8900fb99",
"splitType": "percentage",
"chargebackLiable": True,
"splitPercentage": 80,
"splitAmount": 80
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '536feaf7-014b-4ad3-a2db-f14897bc2275',
tokenizedCardId: '10aaa074-dd95-4bdb-9618-f81e6fdc1e17',
title: 'Plano Premium Mensal',
amount: 2990,
frequency: 30,
dueDate: '2025-06-04',
setupAmount: 1000,
duration: 12,
expirationDate: '2026-06-04',
tolerancePeriod: 5,
split: [
{
subaccountId: 'c873d310-d2eb-41da-adaa-36fc8900fb99',
splitType: 'percentage',
chargebackLiable: true,
splitPercentage: 80,
splitAmount: 80
}
]
})
};
fetch('https://sandbox-api.superpagamentos.com/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.superpagamentos.com/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => '536feaf7-014b-4ad3-a2db-f14897bc2275',
'tokenizedCardId' => '10aaa074-dd95-4bdb-9618-f81e6fdc1e17',
'title' => 'Plano Premium Mensal',
'amount' => 2990,
'frequency' => 30,
'dueDate' => '2025-06-04',
'setupAmount' => 1000,
'duration' => 12,
'expirationDate' => '2026-06-04',
'tolerancePeriod' => 5,
'split' => [
[
'subaccountId' => 'c873d310-d2eb-41da-adaa-36fc8900fb99',
'splitType' => 'percentage',
'chargebackLiable' => true,
'splitPercentage' => 80,
'splitAmount' => 80
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.superpagamentos.com/subscriptions"
payload := strings.NewReader("{\n \"customerId\": \"536feaf7-014b-4ad3-a2db-f14897bc2275\",\n \"tokenizedCardId\": \"10aaa074-dd95-4bdb-9618-f81e6fdc1e17\",\n \"title\": \"Plano Premium Mensal\",\n \"amount\": 2990,\n \"frequency\": 30,\n \"dueDate\": \"2025-06-04\",\n \"setupAmount\": 1000,\n \"duration\": 12,\n \"expirationDate\": \"2026-06-04\",\n \"tolerancePeriod\": 5,\n \"split\": [\n {\n \"subaccountId\": \"c873d310-d2eb-41da-adaa-36fc8900fb99\",\n \"splitType\": \"percentage\",\n \"chargebackLiable\": true,\n \"splitPercentage\": 80,\n \"splitAmount\": 80\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.superpagamentos.com/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"536feaf7-014b-4ad3-a2db-f14897bc2275\",\n \"tokenizedCardId\": \"10aaa074-dd95-4bdb-9618-f81e6fdc1e17\",\n \"title\": \"Plano Premium Mensal\",\n \"amount\": 2990,\n \"frequency\": 30,\n \"dueDate\": \"2025-06-04\",\n \"setupAmount\": 1000,\n \"duration\": 12,\n \"expirationDate\": \"2026-06-04\",\n \"tolerancePeriod\": 5,\n \"split\": [\n {\n \"subaccountId\": \"c873d310-d2eb-41da-adaa-36fc8900fb99\",\n \"splitType\": \"percentage\",\n \"chargebackLiable\": true,\n \"splitPercentage\": 80,\n \"splitAmount\": 80\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.superpagamentos.com/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"536feaf7-014b-4ad3-a2db-f14897bc2275\",\n \"tokenizedCardId\": \"10aaa074-dd95-4bdb-9618-f81e6fdc1e17\",\n \"title\": \"Plano Premium Mensal\",\n \"amount\": 2990,\n \"frequency\": 30,\n \"dueDate\": \"2025-06-04\",\n \"setupAmount\": 1000,\n \"duration\": 12,\n \"expirationDate\": \"2026-06-04\",\n \"tolerancePeriod\": 5,\n \"split\": [\n {\n \"subaccountId\": \"c873d310-d2eb-41da-adaa-36fc8900fb99\",\n \"splitType\": \"percentage\",\n \"chargebackLiable\": true,\n \"splitPercentage\": 80,\n \"splitAmount\": 80\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "0b756e37-d852-4aa6-ae10-80e4b35e5cd7",
"customerId": "536feaf7-014b-4ad3-a2db-f14897bc2275",
"cardId": "10aaa074-dd95-4bdb-9618-f81e6fdc1e17",
"title": "Plano Premium Mensal",
"amount": 2990,
"setupAmount": 1000,
"frequency": 30,
"duration": 12,
"dueDate": "2025-06-04",
"expirationDate": "2026-06-04",
"tolerancePeriod": 5,
"status": "ACTIVE",
"createdAt": "2025-06-04T23:00:54.887Z",
"updatedAt": "2025-06-04T23:00:54.887Z",
"canceledAt": null,
"splits": [
{
"subaccountId": "c873d310-d2eb-41da-adaa-36fc8900fb99",
"splitType": "percentage",
"splitPercentage": 80,
"splitAmount": null,
"liquidAmount": 2392,
"chargebackLiable": true
}
]
},
"message": "Assinatura criada com sucesso"
}Authorizations
Token JWT gerado na rota de autenticação (/auth). Deve ser enviado no formato: Bearer
Body
Identificador único do cliente que terá a assinatura
"536feaf7-014b-4ad3-a2db-f14897bc2275"
Identificador único do cartão tokenizado que será utilizado para as cobranças
"10aaa074-dd95-4bdb-9618-f81e6fdc1e17"
Título/descrição da assinatura
"Plano Premium Mensal"
Valor da assinatura em centavos
2990
Frequência em dias que será cobrado (ex: 7 para semanal, 30 para mensal)
30
Data de início da cobrança. Não pode ser uma data que já passou.
"2025-06-04"
Valor de setup do plano em centavos. Opcional. Se preenchido, deve ser maior que 100 (R$ 1,00).
1000
Duração em ciclos (quantas vezes será cobrado). Opcional, se não informado será vitalício.
12
Data que expira a cobrança. Opcional, se não informado não expira.
"2026-06-04"
Período de tolerância para atrasos em dias. Opcional.
5
Array para divisão dos valores entre subcontas. Pode ser feito até 20 splits por pagamento.
20Show child attributes
Show child attributes