Subscriptions
Client subscriptions, with the price copied from the plan and the state (pending = bought on the site and unpaid, trialing, active, past_due, suspended, paused, cancelled). Actions: pause, resume, cancel, keep, change_plan, run. They are not deleted, they are cancelled.
Module: Subscriptions (subscriptions).
Endpoints
Section titled “Endpoints”GET /api/v1/subscriptions- List with filters, sorting and pagination (scopesubscriptions:read)GET /api/v1/subscriptions/{id}- A record by id (scopesubscriptions:read)POST /api/v1/subscriptions- Create a record (scopesubscriptions:write)PATCH /api/v1/subscriptions/{id}- Modify the submitted fields (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/pause- Pauses the subscription: no new periods appear. (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/resume- Restarts a paused subscription; the paused time is not billed. (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/cancel- Cancels now or at the end of the period. Unpaid periods remain due. (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/change_plan- Moves to another plan from the next period, without proration; withoutplan_idit drops the scheduled change. (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/keep- Drops the scheduled cancellation. (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/run- Brings the subscription up to date now: money received, state, new periods, charges and their invoices. (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/card_link- Returns the client’s link to save or change the card and pay what is due. (scopesubscriptions:write)POST /api/v1/subscriptions/{id}/remove_card- Forgets the saved card and switches the subscription to manual payment. (scopesubscriptions:write)
Fields
Section titled “Fields”id(string, uuid; read): Unique identifier (UUID).party_id(string, uuid; write, required)plan_id(string; write, required)plan_name(string; read)price(number; write)currency(string; read): Currency (ISO code, e.g. RON).vat_rate(number; read)interval_unit(string; read)interval_count(integer; read)setup_fee(number; read)min_cycles(integer; read)status(string; read)payment_mode(string; read)starts_on(string; write)trial_ends_on(string, date; read)anchor_day(integer; read)next_period_start(string, date; read)cancel_at_period_end(boolean; read)cancelled_at(string, date-time; read)cancel_reason(string; read)paused_at(string, date-time; read)note(string; write)version(integer; read)created_by(string; read)created_at(string, date-time; read): Creation date (ISO 8601).updated_at(string, date-time; read): Last modification date (ISO 8601).card_brand(string; read)card_last4(string; read)card_exp_month(integer; read)card_exp_year(integer; read)card_saved_at(string, date-time; read)next_plan_id(string, uuid; read)next_price(number; read)trial_days(number; write)
Events
Section titled “Events”subscriptions.createdsubscriptions.updatedsubscriptions.deleted