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. 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 (required when duration is repeating).

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 // ... request body
9 })
10});
11const data = await response.json();
Responses
{
  "status": 200,
  "subscription": {
    "id": "string",
    "object": "subscription",
    "next_billing_date": 0,
    "cancellation_date": 0,
    "completion_date": 0,
    "resumes_at": 0,
    "products": [],
    "payment_count": 0,
    "status": "string",
    "has_discount": false,
    "gateway_subscription_id": "string",
    "type": "subscription",
    "gateway": "string",
    "billing_cycle": "string",
    "interval": 0,
    "currency": "string",
    "invoice_id": "string",
    "price": 0,
    "lifetime_revenue": 0,
    "management_link": "string",
    "instalments_count": 0,
    "customer": "...",
    "imported": false,
    "has_notes": false
  },
  "upcoming_invoice": {}
}