Preview. This site is still being built. Features, prices and terms may change, and nothing here is a binding offer. Read the preview notice

Preview. Still being built; nothing here is a binding offer. Details

Subscriptions

9 routes. Paths are relative to https://api.intersink.com/v1.

All groups

Subscribe

POST/subscriptions

Needs a signed-in user (Bearer token or access_token cookie).

Subscribe (creates the single row OR reactivates/reuses it). A paid plan needs payment_id of the caller's successful, unused payment for the plan price (402 otherwise; 409 when already used).

Parameters

NameTypeDescription
Idempotency-Keystring, headerOptional client-generated key (8-128 chars, [A-Za-z0-9_-]). A retry with the same key and body replays the first response (Idempotent-Replayed: true); 409 while the first is in flight; 422 if the body differs.

Request body application/json

FieldTypeDescription
plan_idrequirednumberMinimum 1.
payment_idstringRequired for a plan with price > 0: a payments row of the caller with status "success" and amount = the plan price, not used before.

Response

201. The payload in data is not described in the spec yet.

Get one

GET/subscriptions/{id}

Needs a signed-in user (Bearer token or access_token cookie).

One subscription (subscriber or creator).

Parameters

NameTypeDescription
idrequirednumber, path

Response

200. The payload in data is not described in the spec yet.

Cancel

PATCH/subscriptions/{id}/cancel

Needs a signed-in user (Bearer token or access_token cookie).

Cancel (Option A): immediate status → archived; access remains until period_end.

Parameters

NameTypeDescription
idrequirednumber, path

Response

200. The payload in data is not described in the spec yet.

Change plan

PATCH/subscriptions/{id}/change-plan

Needs a signed-in user (Bearer token or access_token cookie).

Change plan (upgrade or downgrade). Mutates plan_id on the SAME row. When the proration amount is > 0 it needs payment_id for exactly that amount.

Parameters

NameTypeDescription
idrequirednumber, path
Idempotency-Keystring, headerOptional client-generated key (8-128 chars, [A-Za-z0-9_-]). A retry with the same key and body replays the first response (Idempotent-Replayed: true); 409 while the first is in flight; 422 if the body differs.

Request body application/json

FieldTypeDescription
new_plan_idrequirednumberMinimum 1.
payment_idstringRequired when the change costs money (proration amount > 0): a successful, unused payment of the caller for exactly that amount.

Response

200. The payload in data is not described in the spec yet.

Preview

GET/subscriptions/{id}/change-plan-preview

Needs a signed-in user (Bearer token or access_token cookie).

Proration preview for a plan change (read-only; matches change-plan).

Parameters

NameTypeDescription
idrequirednumber, path
new_plan_idrequirednumber, queryMinimum 1.

Response

200. The payload in data is not described in the spec yet.

History

GET/subscriptions/{id}/history

Needs a signed-in user (Bearer token or access_token cookie).

The subscription's event timeline.

Parameters

NameTypeDescription
idrequirednumber, path
pagenumber, queryMinimum 1.
limitnumber, queryMinimum 1.

Response

200. The payload in data is not described in the spec yet.

Check

GET/subscriptions/check

Needs a signed-in user (Bearer token or access_token cookie).

Am I subscribed to a creator? ?creator_user_id=<uuid>.

Parameters

NameTypeDescription
creator_user_idrequiredstring, query

Response

200. The payload in data is not described in the spec yet.

Me

GET/subscriptions/me

Needs a signed-in user (Bearer token or access_token cookie).

The caller's single subscription (+ plan), or null.

Response

200. The payload in data is not described in the spec yet.

Subscribers

GET/subscriptions/subscribers

Needs a signed-in user (Bearer token or access_token cookie).

My subscribers (as a creator).

Parameters

NameTypeDescription
pagenumber, queryMinimum 1.
limitnumber, queryMinimum 1.

Response

200. The payload in data is not described in the spec yet.