title: Subscriptions
description: Create, manage, and cancel API subscriptions.
Subscriptions
Subscriptions give your account access to a specific API in the marketplace. Manage them programmatically with these endpoints.
Create a subscription
Subscribe to a marketplace API.
POST
/v1/subscriptions| Parameter | Type | Required | Description |
|---|---|---|---|
api_id | string | Yes | ID of the marketplace API to subscribe to. |
plan_id | string | Yes | ID of the pricing plan. |
metadata | object | No | Arbitrary key-value pairs for your own tracking. |
# cURL
curl https://api.wontopos.com/v1/subscriptions
-X POST
-H "Authorization: Bearer sk_live_your_key_here"
-H "Content-Type: application/json"
-d '{
"api_id": "api_1a2b3c4d",
"plan_id": "plan_pro"
}' // JavaScript
const res = await fetch("https://api.wontopos.com/v1/subscriptions", {
method: "POST",
headers: {
Authorization: "Bearer sk_live_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
api_id: "api_1a2b3c4d",
plan_id: "plan_pro",
}),
}); # Python
import requests
resp = requests.post(
"https://api.wontopos.com/v1/subscriptions",
headers={"Authorization": "Bearer sk_live_your_key_here"},
json={"api_id": "api_1a2b3c4d", "plan_id": "plan_pro"},
) Response:
{
"id": "sub_9x8y7z",
"api_id": "api_1a2b3c4d",
"plan_id": "plan_pro",
"status": "active",
"created_at": "2026-03-30T10:00:00Z",
"current_period_end": "2026-04-30T10:00:00Z"
} Billing
Charges begin immediately when a subscription is created. See [Billing](/docs/pricing/billing) for details.
List subscriptions
Returns all subscriptions for the authenticated account.
GET
/v1/subscriptions| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | — | Filter by status: active, cancelled, past_due. |
api_id | string | — | Filter by a specific API. |
limit | integer | 20 | Maximum number of results. |
offset | integer | 0 | Pagination offset. |
Response:
{
"object": "list",
"data": [
{
"id": "sub_9x8y7z",
"api_id": "api_1a2b3c4d",
"plan_id": "plan_pro",
"status": "active",
"created_at": "2026-03-30T10:00:00Z",
"current_period_end": "2026-04-30T10:00:00Z"
}
],
"total": 3,
"has_more": false
} Cancel a subscription
Cancel an existing subscription by its ID.
DELETE
/v1/subscriptions/:subscription_id| Parameter | Type | Required | Description |
|---|---|---|---|
subscription_id | string | Yes | ID of the subscription to cancel. |
| Parameter | Type | Default | Description |
|---|---|---|---|
cancel_at_period_end | boolean | false | If true, access continues until the current billing period ends. |
curl https://api.wontopos.com/v1/subscriptions/sub_9x8y7z?cancel_at_period_end=true
-X DELETE
-H "Authorization: Bearer sk_live_your_key_here" Response:
{
"id": "sub_9x8y7z",
"status": "cancelled",
"cancelled_at": "2026-03-30T15:00:00Z",
"access_until": "2026-04-30T10:00:00Z"
} Immediate cancellation
When `cancel_at_period_end` is `false` (the default), API access is revoked immediately. This action cannot be undone.