Get Subscription
GET/subscriptions/:subscriptionIdDescription
Retrieve the details of an existing subscription by its unique identifier. This is useful for checking the current status, billing period, or other details of a subscription.
Headers
| Header | Description | Required |
|---|---|---|
| Authorization | Bearer token with your API key | yes |
Path Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| subscriptionId | string | The unique identifier of the subscription. | yes |
Example Request
const response = await fetch('https://checkout.exodus.com/subscriptions/sub_1234567890abcdef', {
headers: {
Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
},
});Response
SUCCESSFUL RESPONSE
{
"id": "sub_1234567890abcdef",
"object": "subscription",
"amount": 2999,
"currency": "USD",
"interval": "monthly",
"name": "Pro Plan",
"description": "Access to all premium features",
"status": "active",
"checkout_url": "https://checkout.exodus.com/subscribe/sub_1234567890abcdef",
"success_url": "https://yoursite.com/subscription/success",
"customer_id": "cus_0987654321fedcba",
"customer_email": "[email protected]",
"trial_days": 14,
"trial_ends_at": "2024-01-29T12:00:00Z",
"current_period_start": "2024-01-29T12:00:00Z",
"current_period_end": "2024-02-29T12:00:00Z",
"next_payment_at": "2024-02-29T12:00:00Z",
"metadata": {
"plan_id": "pro_monthly",
"user_id": "usr_12345"
},
"created_at": "2024-01-15T12:00:00Z",
"activated_at": "2024-01-15T12:30:00Z"
}Error Responses
NOT FOUND
{
"error": {
"type": "not_found",
"message": "Subscription not found"
}
}