Tamio

Add a discount

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

Applies a promotional discount to a subscription. The discount can be a fixed amount or a percentage, and can last for one cycle, forever, or a specified number of billing cycles.

Path Parameters

uuid string*

UUID of the subscription.

Body Parameters

duration string*

once — single billing cycle; forever — permanent; repeating — limited number of cycles (requires number_of_months).

onceforeverrepeating
amount integer*

Fixed discount in smallest currency unit (e.g. cents). At least one of amount or percent must be > 0.

percent number*

Percentage discount (0–100). At least one of amount or percent must be > 0.

number_of_months integer

Number of billing cycles the discount lasts (required when duration is repeating, minimum 1).

Responses

200 Discount applied

Discount applied

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/discount/create/{uuid}
1const response = await fetch("https://api.tamio.com/v2/subscriptions/discount/create/{uuid}", {
2 method: "POST",
3 headers: {
4 "Authorization": "Bearer YOUR_API_KEY",
5 "Content-Type": "application/json"
6 },
7 body: JSON.stringify({
8 "duration": "repeating",
9 "amount": 500,
10 "percent": 0,
11 "number_of_months": 3
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": {}
}