Introduction
Endpoints
- Accounts
- Fees
- Invoices
- Meters
- Plans
- Subscriptions
- Credit grants
- Products
- Orders
- Payments
Subscriptions
Retrieve subscription
Retrieves a subscription by ID.
GET
/
subscriptions
/
{id}
Copy
curl --request GET \
--url https://sandbox-api.billingrails.com/v1/subscriptions/{id} \
--header 'Authorization: Bearer <token>'
Copy
{
"subscription": {
"object": "subscription",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"account_id": "<string>",
"payment_method_id": "<string>",
"status": "draft",
"currency": "<string>",
"amount": 123,
"collection_method": "<string>",
"billing_cycle_type": "anniversary",
"has_metered_fees": true,
"multi_interval": true,
"started_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"trial_period_start": "2023-11-07T05:31:56Z",
"trial_period_end": "2023-11-07T05:31:56Z",
"first_billing_at": "2023-11-07T05:31:56Z",
"previous_billing_at": "2023-11-07T05:31:56Z",
"billed_through": "2023-11-07T05:31:56Z",
"items": [
{
"fee_id": "<string>",
"quantity": 123
}
]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Response
200 - application/json
Success
The response is of type object
.
Copy
curl --request GET \
--url https://sandbox-api.billingrails.com/v1/subscriptions/{id} \
--header 'Authorization: Bearer <token>'
Copy
{
"subscription": {
"object": "subscription",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"plan_id": "<string>",
"account_id": "<string>",
"payment_method_id": "<string>",
"status": "draft",
"currency": "<string>",
"amount": 123,
"collection_method": "<string>",
"billing_cycle_type": "anniversary",
"has_metered_fees": true,
"multi_interval": true,
"started_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"trial_period_start": "2023-11-07T05:31:56Z",
"trial_period_end": "2023-11-07T05:31:56Z",
"first_billing_at": "2023-11-07T05:31:56Z",
"previous_billing_at": "2023-11-07T05:31:56Z",
"billed_through": "2023-11-07T05:31:56Z",
"items": [
{
"fee_id": "<string>",
"quantity": 123
}
]
}
}
Assistant
Responses are generated using AI and may contain mistakes.