smplkit Subscription API
The Subscription API from smplkit — 3 operation(s) for subscription.
The Subscription API from smplkit — 3 operation(s) for subscription.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/smplkit-com:smplkit-com-subscription-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: smplkit Subscription API
description: API for the smplkit platform.
version: 0.1.0
tags:
- name: Subscription
paths:
/api/v1/accounts/current/subscription:
get:
tags:
- Subscription
summary: Get Current Subscription
description: Return the authenticated account's subscription, or 404 if none exists.
operationId: get_current_subscription
responses:
'200':
description: Successful Response
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/SubscriptionResponse'
'400':
description: Validation error or malformed request
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid authentication
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Resource not found
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- HTTPBearer: []
put:
tags:
- Subscription
summary: Replace Current Subscription
description: Replace the authenticated account's subscription with the desired state.
operationId: put_current_subscription
requestBody:
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/SubscriptionRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/SubscriptionResponse'
'400':
description: Validation error or malformed request
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid authentication
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Resource not found
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- HTTPBearer: []
/api/v1/accounts/current/subscription/actions/preview:
post:
tags:
- Subscription
summary: Preview Subscription Change
description: 'Project the result of replacing the subscription with the desired state.
No database or billing-provider changes are made; safe to call as the
customer iterates on a plan picker.'
operationId: preview_current_subscription
requestBody:
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/SubscriptionRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/SubscriptionPreviewResponse'
'400':
description: Validation error or malformed request
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid authentication
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Resource not found
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- HTTPBearer: []
/api/v1/accounts/{account_id}/subscription:
put:
tags:
- Subscription
summary: Replace Account Subscription (admin)
description: 'Admin replacement of a specific account''s subscription.
Accepts the same body shape as the customer endpoint plus
``discount_override_pct``. Setting the override to 100 skips the billing
provider entirely; lowering it below 100 requires a payment method on
file for the target account.'
operationId: admin_put_account_subscription
security:
- HTTPBearer: []
parameters:
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
requestBody:
required: true
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/AdminSubscriptionRequest'
responses:
'200':
description: Successful Response
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/SubscriptionResponse'
'400':
description: Validation error or malformed request
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid authentication
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Resource not found
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
description: Rate limit exceeded
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
AdminSubscriptionRequest:
properties:
data:
$ref: '#/components/schemas/AdminSubscriptionRequestResource'
type: object
required:
- data
title: AdminSubscriptionRequest
description: Admin-scope request envelope for replacing a subscription.
SubscriptionRequestResource:
properties:
id:
type:
- string
- 'null'
title: Id
description: Subscription identifier; the server ignores this and uses the auth context.
type:
type: string
enum:
- subscription
title: Type
description: JSON:API resource type.
attributes:
$ref: '#/components/schemas/SubscriptionRequestAttributes'
type: object
required:
- type
- attributes
title: SubscriptionRequestResource
description: JSON:API resource object for a subscription update request.
example:
attributes:
items:
- plan: pro
product: audit
- plan: pro
product: config
payment_method: p1q2r3s4-5678-90ab-cdef-1234567890ab
type: subscription
ErrorResponse:
properties:
errors:
items:
$ref: '#/components/schemas/Error'
type: array
title: Errors
type: object
required:
- errors
title: ErrorResponse
description: JSON:API error response envelope.
AdminSubscriptionRequestResource:
properties:
id:
type:
- string
- 'null'
title: Id
type:
type: string
enum:
- subscription
title: Type
description: JSON:API resource type.
attributes:
$ref: '#/components/schemas/AdminSubscriptionRequestAttributes'
type: object
required:
- type
- attributes
title: AdminSubscriptionRequestResource
description: Admin-scope resource object for a subscription update request.
example:
attributes:
discount_override_pct: 100
items:
- plan: pro
product: audit
type: subscription
NextTierResponse:
properties:
products_needed:
type: integer
title: Products Needed
description: Number of additional paid products required to reach the next discount tier.
discount_pct:
type: integer
title: Discount Pct
description: Discount percentage that would apply at the next tier.
additional_savings_cents:
type: integer
title: Additional Savings Cents
description: Estimated additional monthly savings (in cents) at the next tier, compared to paying full list price for the added product.
type: object
required:
- products_needed
- discount_pct
- additional_savings_cents
title: NextTierResponse
description: Hint describing how the customer could unlock a better discount.
SubscriptionPreviewResponse:
properties:
data:
$ref: '#/components/schemas/SubscriptionPreviewResource'
type: object
required:
- data
title: SubscriptionPreviewResponse
description: Response envelope for the preview action.
SubscriptionPreviewAttributes:
properties:
projected_subtotal_cents:
type: integer
title: Projected Subtotal Cents
description: Projected sum of item monthly list prices after the change.
projected_discount_pct:
type: integer
title: Projected Discount Pct
description: Projected discount percentage that will apply after the change.
projected_discount_source:
type: string
enum:
- VOLUME
- OVERRIDE
title: Projected Discount Source
description: '`VOLUME` when the projected discount comes from the multi-product schedule; `OVERRIDE` when an administrator''s discount applies.'
projected_discount_amount_cents:
type: integer
title: Projected Discount Amount Cents
description: Projected discount amount in cents after the change.
projected_total_cents:
type: integer
title: Projected Total Cents
description: Projected final monthly total in cents after the change.
projected_next_tier:
$ref: '#/components/schemas/NextTierResponse'
description: Hint describing additional savings available by subscribing to another product after the change is applied. `null` when no better tier is reachable.
changes:
items:
$ref: '#/components/schemas/SubscriptionChangeProjection'
type: array
title: Changes
description: Per-product breakdown of changes the desired state would produce. Products that would remain unchanged are omitted.
total_charge_today_cents:
type: integer
title: Total Charge Today Cents
description: Total amount in cents that would be charged at confirmation time — the sum of `prorated_charge_today_cents` across all changes. `0` when there is no immediate charge (for example when changes apply to an already-active subscription and the prorated amounts are carried onto the next invoice instead).
next_invoice_total_cents:
type: integer
title: Next Invoice Total Cents
description: Projected total of the next monthly invoice in cents, after all scheduled changes have taken effect.
type: object
required:
- projected_subtotal_cents
- projected_discount_pct
- projected_discount_source
- projected_discount_amount_cents
- projected_total_cents
- changes
- total_charge_today_cents
- next_invoice_total_cents
title: SubscriptionPreviewAttributes
description: Projected totals and per-change breakdown for a hypothetical change.
SubscriptionChangeProjection:
properties:
product:
type: string
title: Product
description: Product key affected by this change.
from_plan:
type: string
title: From Plan
description: Current plan for this product, or `free` if it is being added.
to_plan:
type: string
title: To Plan
description: Plan the product will be on after the change. `free` indicates the enrollment will be dropped.
monthly_cents:
type: integer
title: Monthly Cents
description: Monthly cost in cents of this enrollment after the change. `0` when the enrollment will be dropped.
effect:
type: string
enum:
- IMMEDIATE
- NEXT_PERIOD
title: Effect
description: '`IMMEDIATE` when the change takes effect at confirmation time (and a prorated charge may apply today). `NEXT_PERIOD` when the change takes effect at the end of the current billing period.'
prorated_charge_today_cents:
type: integer
title: Prorated Charge Today Cents
description: Amount in cents that confirming this change would charge at confirmation time for this product. Reflects the discounted, prorated charge for the remainder of the current billing period. May be `0` even when `effect` is `IMMEDIATE` — when the product is being added to an already-active subscription the prorated amount is carried onto the next invoice rather than charged immediately. Always `0` when `effect` is `NEXT_PERIOD`.
default: 0
starts_at:
type:
- string
- 'null'
title: Starts At
description: When `effect` is `NEXT_PERIOD`, the ISO-8601 timestamp at which the change takes effect. `null` when `effect` is `IMMEDIATE` (the change applies on confirmation).
type: object
required:
- product
- from_plan
- to_plan
- monthly_cents
- effect
title: SubscriptionChangeProjection
description: Per-item projected effect of a subscription change.
SubscriptionResource:
properties:
id:
type:
- string
- 'null'
title: Id
description: Subscription identifier. Always `current` on response; absent on create-style requests.
type:
type: string
enum:
- subscription
title: Type
description: JSON:API resource type.
attributes:
$ref: '#/components/schemas/SubscriptionResponseAttributes'
type: object
required:
- type
- attributes
title: SubscriptionResource
description: JSON:API resource object for a subscription.
example:
attributes:
current_period_end: '2026-06-01T00:00:00Z'
current_period_start: '2026-05-01T00:00:00Z'
discount_amount_cents: 2220
discount_pct: 15
discount_source: VOLUME
items:
- id: i1j2k3l4-5678-90ab-cdef-1234567890ab
plan: pro
price_monthly_cents: 9900
product: audit
next_tier:
additional_savings_cents: 4281
discount_pct: 33
products_needed: 1
payment_method: p1q2r3s4-5678-90ab-cdef-1234567890ab
status: ACTIVE
subtotal_cents: 14800
total_cents: 12580
id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
type: subscription
SubscriptionResponseAttributes:
properties:
status:
type:
- string
- 'null'
title: Status
description: Lifecycle state of the subscription. `ACTIVE` while billing is current; `PAST_DUE` after a failed charge; `CANCELED` once the subscription has ended; `null` when the subscription is fully discounted (`discount_override_pct` of 100) and has no billing-provider object.
current_period_start:
type:
- string
- 'null'
title: Current Period Start
description: ISO-8601 timestamp of the current billing period's start.
current_period_end:
type:
- string
- 'null'
title: Current Period End
description: ISO-8601 timestamp of the current billing period's end. Scheduled plan changes take effect at this moment.
discount_pct:
type: integer
title: Discount Pct
description: Effective discount percentage applied to the subscription's monthly invoice. This is the value locked at the time of the customer's last subscription change; subsequent changes to the public discount schedule do not affect this customer until they themselves change their subscription.
discount_source:
type: string
enum:
- VOLUME
- OVERRIDE
title: Discount Source
description: '`VOLUME` when the discount comes from the multi-product discount schedule; `OVERRIDE` when an administrator has applied a custom discount.'
subtotal_cents:
type: integer
title: Subtotal Cents
description: Sum of all item list prices in cents, before discount.
discount_amount_cents:
type: integer
title: Discount Amount Cents
description: Amount discounted from the subtotal in cents.
total_cents:
type: integer
title: Total Cents
description: Final monthly total in cents after the discount is applied.
next_tier:
$ref: '#/components/schemas/NextTierResponse'
description: When `discount_source` is `VOLUME` and the customer is below the top tier, describes the additional savings available by subscribing to another product. `null` otherwise.
payment_method:
type:
- string
- 'null'
format: uuid
title: Payment Method
description: Identifier of the default payment method used to bill this subscription. `null` when the subscription has no associated payment method (e.g. fully discounted via `discount_override_pct` of 100).
items:
items:
$ref: '#/components/schemas/SubscriptionItemResponse'
type: array
title: Items
description: One entry per product currently enrolled on the subscription.
type: object
required:
- discount_pct
- discount_source
- subtotal_cents
- discount_amount_cents
- total_cents
- items
title: SubscriptionResponseAttributes
description: Customer's subscription as returned by the API.
SubscriptionRequest:
properties:
data:
$ref: '#/components/schemas/SubscriptionRequestResource'
type: object
required:
- data
title: SubscriptionRequest
description: Single-resource request envelope for replacing the subscription.
Error:
properties:
status:
type: string
title: Status
title:
type: string
title: Title
detail:
type:
- string
- 'null'
title: Detail
source:
additionalProperties: true
type:
- object
- 'null'
title: Source
type: object
required:
- status
- title
title: Error
description: Single JSON:API error object.
SubscriptionPreviewResource:
properties:
id:
type:
- string
- 'null'
enum:
- preview
- null
title: Id
description: Always `preview`.
default: preview
type:
type: string
enum:
- subscription_preview
title: Type
description: JSON:API resource type.
attributes:
$ref: '#/components/schemas/SubscriptionPreviewAttributes'
type: object
required:
- type
- attributes
title: SubscriptionPreviewResource
description: JSON:API resource object for a subscription preview.
example:
attributes:
changes:
- effect: IMMEDIATE
from_plan: free
monthly_cents: 9900
product: audit
prorated_charge_today_cents: 4521
to_plan: pro
next_invoice_total_cents: 12580
projected_discount_amount_cents: 2220
projected_discount_pct: 15
projected_discount_source: VOLUME
projected_subtotal_cents: 14800
projected_total_cents: 12580
total_charge_today_cents: 4521
id: preview
type: subscription_preview
SubscriptionResponse:
properties:
data:
$ref: '#/components/schemas/SubscriptionResource'
type: object
required:
- data
title: SubscriptionResponse
description: Single-resource response envelope for a subscription.
AdminSubscriptionRequestAttributes:
properties:
items:
items:
$ref: '#/components/schemas/SubscriptionItemRequest'
type: array
title: Items
description: Desired enrollments. Products listed are scheduled to be on the specified plan immediately (for upgrades and new enrollments) or at the end of the current billing period (for downgrades). Products not listed are scheduled to be dropped at the end of the current billing period.
payment_method:
type:
- string
- 'null'
format: uuid
title: Payment Method
description: Optional identifier of the payment method to bill against. If omitted, the account's default payment method is used.
discount_override_pct:
type:
- integer
- 'null'
title: Discount Override Pct
description: Administrator-set discount percentage (0–100). When set, the multi-product discount schedule is bypassed and this value is used directly. Setting `100` skips the billing provider entirely — the customer pays nothing. Pass `null` to clear any existing override and revert to the multi-product discount schedule.
type: object
required:
- items
title: AdminSubscriptionRequestAttributes
description: Same as the customer request body plus the admin-only override field.
SubscriptionItemRequest:
properties:
product:
type: string
title: Product
description: Product key (e.g. `audit`, `config`, `flags`, `logging`).
plan:
type: string
title: Plan
description: Target plan for this product. Must be a paid plan such as `standard` or `pro`; the free plan is implicit when a product is not listed.
additionalProperties: false
type: object
required:
- product
- plan
title: SubscriptionItemRequest
description: 'One product enrollment as supplied by the caller.
The caller supplies the *desired* (product, plan) pair for each product
they want enrolled. Products absent from the request are interpreted as
scheduled-for-drop at the end of the current billing period.'
SubscriptionRequestAttributes:
properties:
items:
items:
$ref: '#/components/schemas/SubscriptionItemRequest'
type: array
title: Items
description: Desired enrollments. Products listed are scheduled to be on the specified plan immediately (for upgrades and new enrollments) or at the end of the current billing period (for downgrades). Products not listed are scheduled to be dropped at the end of the current billing period.
payment_method:
type:
- string
- 'null'
format: uuid
title: Payment Method
description: Optional identifier of the payment method to bill against. If omitted, the account's default payment method is used.
type: object
required:
- items
title: SubscriptionRequestAttributes
description: Customer's desired subscription state.
SubscriptionItemResponse:
properties:
id:
type: string
format: uuid
title: Id
description: Unique identifier for this enrollment.
product:
type: string
title: Product
description: Product key (e.g. `audit`, `config`, `flags`, `logging`).
plan:
type: string
title: Plan
description: Current plan for this product (e.g. `standard`, `pro`).
price_monthly_cents:
type: integer
title: Price Monthly Cents
description: Monthly list price for this enrollment, in cents. This value is locked at the time the enrollment was created or last had its plan changed; subsequent changes to the public price list do not affect this enrollment until the customer themselves changes their plan.
pending_plan_change:
type:
- string
- 'null'
title: Pending Plan Change
description: When a plan change is scheduled for the end of the current billing period, this is the plan that will take effect. Otherwise `null`. The value `free` indicates the enrollment will be dropped.
scheduled_change_effective_at:
type:
- string
- 'null'
title: Scheduled Change Effective At
description: ISO-8601 timestamp at which the pending plan change takes effect. Matches the subscription's `current_period_end`.
type: object
required:
- id
- product
- plan
- price_monthly_cents
title: SubscriptionItemResponse
description: One product enrollment as exposed in subscription responses.
securitySchemes:
HTTPBearer:
type: http
description: JWT access token or API key (sk_api_*)
scheme: bearer