Tamio

Update a subscription plan

POST https://api.tamio.com/v2/subscriptions/update/{uuid}

Switches the billing plan of an existing subscription. Specify the target product and pricing model. Optionally adjust the quantity and enable prorated billing for mid-cycle changes.

Path Parameters

uuid string*

UUID of the subscription to update.

Body Parameters

id string*

UUID of the target product/plan to switch to.

pricing_model_id string*

UUID of the pricing model to apply.

quantity integer

Subscription quantity (seats/licenses).

prorations boolean

Apply prorated billing for mid-cycle changes.

Responses

200 Plan switched successfully

Plan switched successfully

status integer
subscription Subscription
upcoming_invoice object

Preview of the next invoice after the change.

400 Validation or business-logic error.
401 Missing or invalid API key
/subscriptions/update/{uuid}
1const response = await fetch("https://api.tamio.com/v2/subscriptions/update/{uuid}", {
2 method: "POST",
3 headers: {
4 "Authorization": "Bearer YOUR_API_KEY",
5 "Content-Type": "application/json"
6 },
7 body: JSON.stringify({
8 "id": "ddd44567-e89b-12d3-a456-426614174000",
9 "pricing_model_id": "eee54567-e89b-12d3-a456-426614174000",
10 "quantity": 1,
11 "prorations": true
12 })
13});
14const data = await response.json();
Responses
{
  "status": 200,
  "subscription": {
    "id": "999e4567-e89b-12d3-a456-426614174000",
    "object": "subscription",
    "next_billing_date": 1735689600,
    "cancellation_date": null,
    "completion_date": null,
    "resumes_at": null,
    "products": [
      {
        "id": "bbb24567-e89b-12d3-a456-426614174000",
        "name": "Pro Plan"
      }
    ],
    "payment_count": 12,
    "status": "active",
    "has_discount": false,
    "gateway_subscription_id": "sub_1PaBcDeFgHiJkLmN",
    "type": "subscription",
    "gateway": "stripe",
    "billing_cycle": "month",
    "interval": 1,
    "currency": "EUR",
    "invoice_id": "aaa14567-e89b-12d3-a456-426614174000",
    "price": 2990,
    "lifetime_revenue": 35880,
    "management_link": "https://billing.example.com",
    "instalments_count": 0,
    "customer": "...",
    "imported": false,
    "has_notes": false
  },
  "upcoming_invoice": {}
}