API Reference
Preview Subscription Swap
Calculates the prorated cost of swapping an active subscription to a new product or variant.
GET
Preview Subscription Swap
Calculates the prorated cost of swapping an active subscription to a new product or variant.
This endpoint generates an upcoming invoice preview from Stripe, allowing you to show the customer exactly how much they will be charged or credited before they confirm the upgrade or downgrade.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the subscription
Query Parameters
The target variant ID for the swap.
The target product ID for the swap.
Response
200 - application/json
Successfully calculated proration
Previous
List subscriptionsRetrieves a list of all subscriptions for a given store. Supports filtering by status, customer ID, and product ID. Includes pagination.
**Business Use-case:** Useful for managing and analyzing all active and past subscriptions.
**Query Parameters:**
- `x-store-id`: Store identifier (header, required).
- `limit`: Limit the number of subscriptions retrieved.
- `status`: Filter by subscription status.
- `customer_id`: Filter by customer ID.
- `product_id`: Filter by product ID.
**Responses:**
- `200`: Subscriptions retrieved successfully.
- `401`: Unauthorized if `x-store-id` is missing.
Next
Preview Subscription Swap