Skip to main content
POST
/
v1
/
subscription-plans
Create a 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"
}
'
{
  "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"
}

Authorizations

Authorization
string
header
required

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

application/json
merchantId
string
required

Merchant ID

Example:

"2RhQg9M7ZCg3X3nMb9W1kX8Q"

name
string
required

Plan name

Example:

"Plano Premium Mensal"

price
number
required

Price in currency units (e.g., 99.90 for R$99.90)

Example:

99.9

currency
string
required

ISO 4217 currency code

Example:

"BRL"

recurrenceType
enum<string>
required

Recurrence type

Available options:
weekly,
biweekly,
monthly,
custom
Example:

"monthly"

recurrenceInterval
integer

Custom recurrence interval in months (required if recurrenceType is 'custom')

Example:

3

endDate
string<date>

Plan end date (ISO 8601)

Example:

"2025-12-31"

buyerMessage
string

Message displayed to buyer

Example:

"Bem-vindo ao Plano Premium!"

paymentMethods
string[]

Accepted payment methods

Example:
["credit_card"]
trial
object

Optional trial period configuration. If provided, new subscribers will go through a trial before the first full billing cycle.

status
enum<string>
default:active

Initial plan status

Available options:
active,
inactive
Example:

"active"

Response

Subscription plan successfully created

id
string

Unique plan identifier

Example:

"2RhQg9M7ZCg3X3nMb9W1kX8Q"

merchantId
string

Merchant ID

Example:

"2RhQg9M7ZCg3X3nMb9W1kX8Q"

name
string

Plan name

Example:

"Plano Premium Mensal"

price
number

Plan price

Example:

99.9

currency
string

Currency code

Example:

"BRL"

recurrenceType
enum<string>

Recurrence type

Available options:
weekly,
biweekly,
monthly,
custom
Example:

"monthly"

recurrenceInterval
integer | null

Custom recurrence interval in months

Example:

null

endDate
string<date-time> | null

Plan end date

Example:

null

buyerMessage
string | null

Message displayed to buyer

Example:

"Bem-vindo ao Plano Premium!"

paymentMethods
string[]

Accepted payment methods

Example:
["credit_card"]
imageUrl
string | null

Plan image URL

Example:

"https://storage.example.com/plans/image.png"

status
enum<string>

Plan status

Available options:
active,
inactive
Example:

"active"

activeSubscriptionsCount
integer

Number of active subscriptions

Example:

150

createdAt
string<date-time>

Creation timestamp

Example:

"2024-01-15T10:30:00.000Z"

updatedAt
string<date-time>

Last update timestamp

Example:

"2024-01-15T10:30:00.000Z"