API reference
Subscriptions
Buyers of a variation billed per period (weekly to yearly). Renewals are fresh orders the buyer pays from the renewal email or the order page, or from their store balance; after the grace period access ends by itself. The subscription.* webhook events carry the same shape.
Endpoints
GET/subscriptionssubscriptions:read
List subscriptions.
| Query parameters | Type | Description |
|---|---|---|
| status | Type: trialing | active | past_due | cancelled | expired | Only this status. |
| Type: string | Buyer email contains this text. | |
| product | Type: string | Product id. |
| limit | Type: 1..100 | Page size. Default 25. |
| cursor | Type: string | nextCursor from the previous page. |
curl https://api.sellhidden.com/v1/subscriptions \
-H "Authorization: Bearer hsk_live_…"{ "ok": true, "subscriptions": [ { "subscriptionId": "clx…", "status": "active", "buyerEmail": "jo@example.com", "productId": "clx…", "productTitle": "Pro plan", "variantId": "clx…", "quantity": 1, "priceUsd": 9, "interval": "month", "currentPeriodStart": "…", "currentPeriodEnd": "…", "graceEndsAt": "…", "cancelAtPeriodEnd": false, "autoRenewFromBalance": false, "initialOrderId": "clx…", "renewalOrderId": null, "renewals": 2, "endedAt": null, "createdAt": "…" } ], "nextCursor": null, "hasMore": false }GET/subscriptions/{id}subscriptions:read
Get a subscription.
curl https://api.sellhidden.com/v1/subscriptions/ID \
-H "Authorization: Bearer hsk_live_…"POST/subscriptions/{id}/cancelsubscriptions:writeIdempotency-Key
Cancel a subscription. By default the buyer keeps access until the period end and nothing more is charged (cancelAtPeriodEnd). With immediate: true access ends now: Discord roles are removed, the pending renewal order is cancelled and subscription.expired is sent with the keys it delivered.
| Body | Type | Description |
|---|---|---|
| immediate | Type: boolean | End now instead of at the period end. Default false. |
curl -X POST \
https://api.sellhidden.com/v1/subscriptions/ID/cancel \
-H "Authorization: Bearer hsk_live_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'POST/subscriptions/{id}/extendsubscriptions:writeIdempotency-Key
Extend by one period. Adds one billing period for free from the current end (or from now when it already ended) and brings an expired or cancelled subscription back, Discord roles included.
curl -X POST \
https://api.sellhidden.com/v1/subscriptions/ID/extend \
-H "Authorization: Bearer hsk_live_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'Get help
Send us the endpoint, the request or delivery id and the response you got. Security findings go through responsible disclosure. Live platform status is on the support page.
See also