Skip to main content
GET
/
v1
/
subscriptions
/
{id}
Get subscription by ID
curl --request GET \
  --url https://api-global.fastpaybrasil.com/v1/subscriptions/{id} \
  --header 'Authorization: Basic <encoded-value>'
{
  "id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
  "status": "active",
  "currentPeriodStart": "2024-01-15T10:30:00.000Z",
  "currentPeriodEnd": "2024-02-15T10:30:00.000Z",
  "billingDay": 15,
  "cancelledAt": null,
  "cancellationType": null,
  "refunded": false,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "plan": {
    "id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
    "name": "Plano Premium Mensal",
    "price": 99.9,
    "currency": "BRL",
    "recurrenceType": "monthly"
  },
  "customer": {
    "id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
    "name": "John Doe",
    "email": "[email protected]"
  },
  "merchant": {
    "id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
    "tradeName": "Loja Exemplo"
  },
  "charges": [
    {
      "id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
      "billingCycle": 1,
      "billingPeriodStart": "2024-01-15T10:30:00.000Z",
      "billingPeriodEnd": "2024-02-15T10:30:00.000Z",
      "amount": 99.9,
      "currency": "BRL",
      "status": "paid",
      "pspTransactionId": "12345",
      "failureReason": null,
      "createdAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "metadata": {
    "referralCode": "PROMO2024"
  }
}

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.

Path Parameters

id
string
required

Unique subscription identifier

Response

Successfully retrieved subscription

id
string

Unique subscription identifier

Example:

"2RhQg9M7ZCg3X3nMb9W1kX8Q"

status
enum<string>

Subscription status

Available options:
pending_activation,
pending_card_activation,
active,
cancelled,
paused,
expired
Example:

"active"

currentPeriodStart
string<date-time> | null

Current billing period start

Example:

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

currentPeriodEnd
string<date-time> | null

Current billing period end

Example:

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

billingDay
integer

Billing day of the month

Example:

15

cancelledAt
string<date-time> | null

Cancellation timestamp

Example:

null

cancellationType
enum<string> | null

Type of cancellation

Available options:
regret,
regular
Example:

null

refunded
boolean

Whether the subscription was refunded

Example:

false

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"

plan
object
customer
object
merchant
object
charges
object[]

Charge history

metadata
object

Additional metadata

Example:
{ "referralCode": "PROMO2024" }