curl --request POST \
--url https://api-global.fastpaybrasil.com/v1/subscription-plans \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly",
"recurrenceInterval": 3,
"endDate": "2025-12-31",
"buyerMessage": "Bem-vindo ao Plano Premium!",
"paymentMethods": [
"credit_card"
],
"status": "active"
}
'import requests
url = "https://api-global.fastpaybrasil.com/v1/subscription-plans"
payload = {
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly",
"recurrenceInterval": 3,
"endDate": "2025-12-31",
"buyerMessage": "Bem-vindo ao Plano Premium!",
"paymentMethods": ["credit_card"],
"status": "active"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '2RhQg9M7ZCg3X3nMb9W1kX8Q',
name: 'Plano Premium Mensal',
price: 99.9,
currency: 'BRL',
recurrenceType: 'monthly',
recurrenceInterval: 3,
endDate: '2025-12-31',
buyerMessage: 'Bem-vindo ao Plano Premium!',
paymentMethods: ['credit_card'],
status: 'active'
})
};
fetch('https://api-global.fastpaybrasil.com/v1/subscription-plans', 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://api-global.fastpaybrasil.com/v1/subscription-plans",
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([
'merchantId' => '2RhQg9M7ZCg3X3nMb9W1kX8Q',
'name' => 'Plano Premium Mensal',
'price' => 99.9,
'currency' => 'BRL',
'recurrenceType' => 'monthly',
'recurrenceInterval' => 3,
'endDate' => '2025-12-31',
'buyerMessage' => 'Bem-vindo ao Plano Premium!',
'paymentMethods' => [
'credit_card'
],
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api-global.fastpaybrasil.com/v1/subscription-plans"
payload := strings.NewReader("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Plano Premium Mensal\",\n \"price\": 99.9,\n \"currency\": \"BRL\",\n \"recurrenceType\": \"monthly\",\n \"recurrenceInterval\": 3,\n \"endDate\": \"2025-12-31\",\n \"buyerMessage\": \"Bem-vindo ao Plano Premium!\",\n \"paymentMethods\": [\n \"credit_card\"\n ],\n \"status\": \"active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api-global.fastpaybrasil.com/v1/subscription-plans")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Plano Premium Mensal\",\n \"price\": 99.9,\n \"currency\": \"BRL\",\n \"recurrenceType\": \"monthly\",\n \"recurrenceInterval\": 3,\n \"endDate\": \"2025-12-31\",\n \"buyerMessage\": \"Bem-vindo ao Plano Premium!\",\n \"paymentMethods\": [\n \"credit_card\"\n ],\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/subscription-plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Plano Premium Mensal\",\n \"price\": 99.9,\n \"currency\": \"BRL\",\n \"recurrenceType\": \"monthly\",\n \"recurrenceInterval\": 3,\n \"endDate\": \"2025-12-31\",\n \"buyerMessage\": \"Bem-vindo ao Plano Premium!\",\n \"paymentMethods\": [\n \"credit_card\"\n ],\n \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly",
"recurrenceInterval": null,
"endDate": null,
"buyerMessage": "Bem-vindo ao Plano Premium!",
"paymentMethods": [
"credit_card"
],
"imageUrl": "https://storage.example.com/plans/image.png",
"status": "active",
"activeSubscriptionsCount": 150,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 403,
"message": "Forbidden"
}Create a subscription plan
Creates a new recurring subscription plan.
curl --request POST \
--url https://api-global.fastpaybrasil.com/v1/subscription-plans \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly",
"recurrenceInterval": 3,
"endDate": "2025-12-31",
"buyerMessage": "Bem-vindo ao Plano Premium!",
"paymentMethods": [
"credit_card"
],
"status": "active"
}
'import requests
url = "https://api-global.fastpaybrasil.com/v1/subscription-plans"
payload = {
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly",
"recurrenceInterval": 3,
"endDate": "2025-12-31",
"buyerMessage": "Bem-vindo ao Plano Premium!",
"paymentMethods": ["credit_card"],
"status": "active"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '2RhQg9M7ZCg3X3nMb9W1kX8Q',
name: 'Plano Premium Mensal',
price: 99.9,
currency: 'BRL',
recurrenceType: 'monthly',
recurrenceInterval: 3,
endDate: '2025-12-31',
buyerMessage: 'Bem-vindo ao Plano Premium!',
paymentMethods: ['credit_card'],
status: 'active'
})
};
fetch('https://api-global.fastpaybrasil.com/v1/subscription-plans', 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://api-global.fastpaybrasil.com/v1/subscription-plans",
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([
'merchantId' => '2RhQg9M7ZCg3X3nMb9W1kX8Q',
'name' => 'Plano Premium Mensal',
'price' => 99.9,
'currency' => 'BRL',
'recurrenceType' => 'monthly',
'recurrenceInterval' => 3,
'endDate' => '2025-12-31',
'buyerMessage' => 'Bem-vindo ao Plano Premium!',
'paymentMethods' => [
'credit_card'
],
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api-global.fastpaybrasil.com/v1/subscription-plans"
payload := strings.NewReader("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Plano Premium Mensal\",\n \"price\": 99.9,\n \"currency\": \"BRL\",\n \"recurrenceType\": \"monthly\",\n \"recurrenceInterval\": 3,\n \"endDate\": \"2025-12-31\",\n \"buyerMessage\": \"Bem-vindo ao Plano Premium!\",\n \"paymentMethods\": [\n \"credit_card\"\n ],\n \"status\": \"active\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api-global.fastpaybrasil.com/v1/subscription-plans")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Plano Premium Mensal\",\n \"price\": 99.9,\n \"currency\": \"BRL\",\n \"recurrenceType\": \"monthly\",\n \"recurrenceInterval\": 3,\n \"endDate\": \"2025-12-31\",\n \"buyerMessage\": \"Bem-vindo ao Plano Premium!\",\n \"paymentMethods\": [\n \"credit_card\"\n ],\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/subscription-plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"2RhQg9M7ZCg3X3nMb9W1kX8Q\",\n \"name\": \"Plano Premium Mensal\",\n \"price\": 99.9,\n \"currency\": \"BRL\",\n \"recurrenceType\": \"monthly\",\n \"recurrenceInterval\": 3,\n \"endDate\": \"2025-12-31\",\n \"buyerMessage\": \"Bem-vindo ao Plano Premium!\",\n \"paymentMethods\": [\n \"credit_card\"\n ],\n \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"merchantId": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly",
"recurrenceInterval": null,
"endDate": null,
"buyerMessage": "Bem-vindo ao Plano Premium!",
"paymentMethods": [
"credit_card"
],
"imageUrl": "https://storage.example.com/plans/image.png",
"status": "active",
"activeSubscriptionsCount": 150,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 403,
"message": "Forbidden"
}Authorizations
HTTP Basic authentication. Use your secret key as the username and an empty string as password. The API key should be base64 encoded in the format 'username:' when sending the Authorization header.
Body
Merchant ID
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
Plan name
"Plano Premium Mensal"
Price in currency units (e.g., 99.90 for R$99.90)
99.9
ISO 4217 currency code
"BRL"
Recurrence type
weekly, biweekly, monthly, custom "monthly"
Custom recurrence interval in months (required if recurrenceType is 'custom')
3
Plan end date (ISO 8601)
"2025-12-31"
Message displayed to buyer
"Bem-vindo ao Plano Premium!"
Accepted payment methods
["credit_card"]
Optional trial period configuration. If provided, new subscribers will go through a trial before the first full billing cycle.
Show child attributes
Show child attributes
Initial plan status
active, inactive "active"
Response
Subscription plan successfully created
Unique plan identifier
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
Merchant ID
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
Plan name
"Plano Premium Mensal"
Plan price
99.9
Currency code
"BRL"
Recurrence type
weekly, biweekly, monthly, custom "monthly"
Custom recurrence interval in months
null
Plan end date
null
Message displayed to buyer
"Bem-vindo ao Plano Premium!"
Accepted payment methods
["credit_card"]
Plan image URL
"https://storage.example.com/plans/image.png"
Plan status
active, inactive "active"
Number of active subscriptions
150
Creation timestamp
"2024-01-15T10:30:00.000Z"
Last update timestamp
"2024-01-15T10:30:00.000Z"