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

Subscribe

POST
/api/v1/users/me/subscription
POST
/api/v1/users/me/subscription
$curl -X POST https://api.onepin.ai/api/v1/users/me/subscription \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "plan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
>}'
1{
2 "data": {
3 "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
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": "4b825dc6-8a0a-4f3a-9f3a-1a2b3c4d5e6f",
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-03-01T00:00:00Z"
30 },
31 "meta": {
32 "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
33 "timestamp": "2024-01-15T09:30:00Z"
34 }
35}
Create a subscription using the default payment method.
Was this page helpful?
Previous

Cancel Subscription

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token

Request

This endpoint expects an object.
plan_idstringRequiredformat: "uuid"

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error