For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • API Reference
      • GETGet Current Subscription
      • POSTSubscribe
      • POSTCancel Subscription
      • POSTChange Plan
      • POSTCancel Scheduled Change
      • GETList Payment Methods
      • POSTAdd Payment Method
      • DELDelete Payment Method
      • PUTSet Default Payment Method
      • GETGet My Credits
      • GETGet My Plan Limits
      • GETList Invoices
      • GETGet Current Notification Preferences
      • PATCHUpdate Current Notification Preferences
      • GETList My Templates
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referenceusers

Change Plan

POST
/api/v1/users/me/subscription/change-plan
POST
/api/v1/users/me/subscription/change-plan
$curl -X POST https://api.onepin.ai/api/v1/users/me/subscription/change-plan \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "new_plan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
>}'
1{
2 "data": {
3 "id": "7b9c9f1e-4d3a-4f2a-9a1e-2b8f9c3d7e4f",
4 "plan": {
5 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
6 "name": "Pro Plan",
7 "tier": "paid",
8 "limits": {},
9 "billing_interval": "monthly",
10 "amount": 2999,
11 "currency": "USD",
12 "display_order": 2
13 },
14 "status": "active",
15 "current_period_start": "2024-01-15T09:30:00Z",
16 "current_period_end": "2024-02-15T09:30:00Z",
17 "cancel_at_period_end": false,
18 "canceled_at": "null",
19 "scheduled_plan": {
20 "id": "5d6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
21 "name": "Enterprise Plan",
22 "tier": "custom",
23 "limits": {},
24 "billing_interval": "yearly",
25 "amount": 29999,
26 "currency": "USD",
27 "display_order": 3
28 },
29 "scheduled_at": "2024-02-10T12:00:00Z"
30 },
31 "meta": {
32 "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
33 "timestamp": "2024-01-15T09:30:00Z"
34 }
35}
Switch the current user's subscription to a different plan.
Was this page helpful?
Previous

Cancel Scheduled Change

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token

Request

This endpoint expects an object.
new_plan_idstringRequiredformat: "uuid"

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error