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
      • GETList Plans
      • GETPreview Plan Change
      • POSTCreate Checkout
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referencebilling

Preview Plan Change

GET
/api/v1/billing/plans/:plan_id/preview
GET
/api/v1/billing/plans/:plan_id/preview
$curl https://api.onepin.ai/api/v1/billing/plans/plan_id/preview \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json"
1{
2 "data": {
3 "current_plan": {
4 "id": "a3f1c9e2-4b7d-4f8a-9c2e-1d2f3b4a5c6d",
5 "name": "Basic Plan",
6 "tier": "free",
7 "limits": {
8 "projects": 3,
9 "storage_gb": 5
10 },
11 "billing_interval": "monthly",
12 "amount": 0,
13 "currency": "USD",
14 "display_order": 1
15 },
16 "new_plan": {
17 "id": "b7d2e4f9-8c3a-4e5b-9f1d-7a6c5b4e3d2f",
18 "name": "Pro Plan",
19 "tier": "paid",
20 "limits": {
21 "projects": 50,
22 "storage_gb": 100,
23 "support": "priority"
24 },
25 "billing_interval": "monthly",
26 "amount": 2999,
27 "currency": "USD",
28 "display_order": 2
29 },
30 "type": "upgrade",
31 "proration_amount": 1500,
32 "effective_at": "2024-06-01T00:00:00Z",
33 "currency": "USD"
34 },
35 "meta": {
36 "request_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
37 "timestamp": "2024-01-15T09:30:00Z"
38 }
39}
Preview the cost of changing to the given plan.
Was this page helpful?
Previous

Create Checkout

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token

Path parameters

plan_idstringRequiredformat: "uuid"

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error