Recur Subscription Schedules API
Scheduled switches API - manage pending subscription changes. Downgrades and some period changes are scheduled for the end of the billing period. A subscription can have only one pending schedule at a time.
Scheduled switches API - manage pending subscription changes. Downgrades and some period changes are scheduled for the end of the billing period. A subscription can have only one pending schedule at a time.
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/recur-tw:recur-tw-subscription-schedules-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: Recur Subscription Schedules API
version: 1.0.0
description: 'Recur is a subscription billing REST API for the Taiwan market. Amounts are whole-number TWD: 499 means NT$499, never cents.
## Authentication
Recur uses API keys, in two kinds:
- **Secret key** (`sk_xxx`): server side, full access
- **Publishable key** (`pk_xxx`): client side, limited access
### Environments
| Environment | Key prefix | Use |
|-------------|-----------|-----|
| Sandbox | `sk_test_` / `pk_test_` | testing |
| Production | `sk_live_` / `pk_live_` | live payments |
### Sending the key
Put the key in the request header:
```
Authorization: Bearer sk_test_xxx
```
or use the dedicated headers:
```
X-Recur-Secret-Key: sk_test_xxx
X-Recur-Publishable-Key: pk_test_xxx
```
## Field naming
Every REST response is snake_case: the v1 app runs the whole response through a conversion step, so `expires_at`, not `expiresAt`. Requests accept either case and are normalized on the way in; the request examples below use camelCase. The official SDK converts responses back to camelCase, so its types are camelCase and this spec is not.'
contact:
name: Recur Support
email: support@recur.tw
url: https://recur.tw
license:
name: Elastic License 2.0
url: https://www.elastic.co/licensing/elastic-license
servers:
- url: https://api.recur.tw/v1
description: Production
- url: http://localhost:3000/api/v1
description: Development
security:
- SecretKey: []
- SecretKeyHeader: []
- PublishableKey: []
- OAuth2:
- openid
- products:read
- orders:read
- subscriptions:read
- customers:read
- analytics:read
tags:
- name: Subscription Schedules
description: 'Scheduled switches API - manage pending subscription changes.
Downgrades and some period changes are scheduled for the end of the billing period.
A subscription can have only one pending schedule at a time.'
paths:
/subscriptions/{subscriptionId}/schedule:
get:
summary: Retrieve the pending schedule
description: 'Retrieve the subscription''s pending schedule, if it has one.
A subscription can have only one pending schedule at a time.'
operationId: getSchedule
tags:
- Subscription Schedules
security:
- SecretKey: []
- SecretKeyHeader: []
parameters:
- name: subscriptionId
in: path
required: true
description: Subscription ID
schema:
type: string
example: sub_abc123
responses:
'200':
description: Schedule details
content:
application/json:
schema:
$ref: '#/components/schemas/GetScheduleResponse'
examples:
has_schedule:
summary: A schedule is pending
value:
object: schedule
has_pending_schedule: true
schedule:
id: sched_abc123
subscription_id: sub_abc123
target_product_id: cmfxq8n2a0003l8yzc9p1n5rt
target_product_name: 基本版
switch_type: DOWNGRADE
effective_at: '2025-02-01T00:00:00Z'
status: PENDING
created_at: '2025-01-15T10:30:00Z'
no_schedule:
summary: No pending schedule
value:
object: schedule
has_pending_schedule: false
schedule: null
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Subscription not found
content:
application/json:
schema:
$ref: '#/components/schemas/SwitchErrorResponse'
delete:
summary: Cancel the pending schedule
description: 'Cancel the subscription''s pending schedule.
Only a schedule in `PENDING` status can be cancelled;
one that already executed or was cancelled cannot.'
operationId: cancelSchedule
tags:
- Subscription Schedules
security:
- SecretKey: []
- SecretKeyHeader: []
parameters:
- name: subscriptionId
in: path
required: true
description: Subscription ID
schema:
type: string
example: sub_abc123
responses:
'200':
description: Schedule cancelled
content:
application/json:
schema:
$ref: '#/components/schemas/CancelScheduleResponse'
example:
object: schedule_cancellation
cancelled: true
subscription_id: sub_abc123
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Subscription not found, or it has no pending schedule
content:
application/json:
schema:
$ref: '#/components/schemas/SwitchErrorResponse'
components:
schemas:
ScheduleStatus:
type: string
enum:
- PENDING
- EXECUTED
- CANCELLED
description: 'Schedule status:
- `PENDING`: waiting to run
- `EXECUTED`: already run
- `CANCELLED`: cancelled
'
SwitchErrorResponse:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
enum:
- subscription_not_found
- product_not_found
- product_not_available
- same_product
- subscription_not_active
- past_due_blocks_switch
- trial_period_active
- payment_failed
- payment_required
- schedule_already_exists
- schedule_not_found
- schedule_already_executed
- schedule_already_cancelled
- insufficient_permissions
- no_pending_schedule
- validation_error
description: Switch error code
message:
type: string
description: Error message
details:
type: object
additionalProperties: true
description: Additional error details
CancelScheduleResponse:
type: object
required:
- object
- cancelled
- subscription_id
properties:
object:
type: string
enum:
- schedule_cancellation
cancelled:
type: boolean
subscription_id:
type: string
ErrorResponse:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
enum:
- invalid_request
- resource_not_found
- unauthorized
- forbidden
- internal_error
description: Error code
message:
type: string
description: Error message
details:
type: object
additionalProperties: true
description: Additional error details
SwitchType:
type: string
enum:
- UPGRADE
- DOWNGRADE
- PERIOD_CHANGE
- CROSSGRADE
description: 'Switch type:
- `UPGRADE`: to a higher-priced plan
- `DOWNGRADE`: to a lower-priced plan
- `PERIOD_CHANGE`: change the billing period, for example monthly to yearly
- `CROSSGRADE`: to a different plan at the same price
'
GetScheduleResponse:
type: object
required:
- object
- has_pending_schedule
properties:
object:
type: string
enum:
- schedule
has_pending_schedule:
type: boolean
schedule:
type: object
nullable: true
properties:
id:
type: string
subscription_id:
type: string
target_product_id:
type: string
target_product_name:
type: string
nullable: true
switch_type:
$ref: '#/components/schemas/SwitchType'
effective_at:
type: string
format: date-time
status:
$ref: '#/components/schemas/ScheduleStatus'
created_at:
type: string
format: date-time
securitySchemes:
SecretKey:
type: http
scheme: bearer
description: 'Secret API key (`sk_xxx`) - server side, full access. Can set metadata.
'
PublishableKey:
type: apiKey
in: header
name: X-Recur-Publishable-Key
description: 'Publishable API key (`pk_xxx`) - client side, limited access. Cannot set metadata.
'
OAuth2:
type: oauth2
description: 'OAuth 2.1 (Authorization Code + PKCE) for AI agents and MCP clients.
Used by the Recur MCP server (https://mcp.recur.tw) so agents can request
least-privilege, scoped access on behalf of a user. Human-facing API
integrations should use `SecretKey`/`PublishableKey` instead.
Discovery: https://app.recur.tw/.well-known/openid-configuration
'
flows:
authorizationCode:
authorizationUrl: https://app.recur.tw/api/auth/oauth2/authorize
tokenUrl: https://app.recur.tw/api/auth/oauth2/token
refreshUrl: https://app.recur.tw/api/auth/oauth2/token
scopes:
openid: OpenID Connect authentication.
profile: Read the user's basic profile.
email: Read the user's email address.
org:read: Read organization details.
api-keys:read: List and read API keys.
api-keys:write: Create and revoke API keys.
products:read: Read products and pricing.
products:write: Create and update products.
integration:verify: Verify integration and connection status.
orders:read: Read orders and payment history.
subscriptions:read: Read subscriptions and their schedules.
customers:read: Read customer records.
analytics:read: Read revenue analytics (MRR, ARR, churn, LTV).
SecretKeyHeader:
type: apiKey
in: header
name: X-Recur-Secret-Key
description: 'Header form of the secret API key (`sk_xxx`); equivalent to `Authorization: Bearer sk_xxx`.
'