Skip to main content
POST

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

id
string
required

The subscription ID

Body

application/json

One adjustment to attach to the subscription. The type decides which number the body carries: a rate for percentageDiscount, a unit count and one target price for usageDiscount.

type
enum<string>
required

Reduces every discountable charge on the invoice by a rate.

Available options:
percentageDiscount
percentageDiscount
string
required

The discount rate as a decimal fraction between 0 and 1, sent as a string. "0.35" means 35 percent. "1" means 100 percent, not 1 percent. At most 6 decimal places. A value of 0 or above 1 is rejected.

effectiveFrom
string<date-time>
required

The first instant the discount applies. Inclusive.

effectiveTo
string<date-time> | null

The instant the discount stops applying. Exclusive, so a window ending on the same date another begins neither overlaps nor leaves a gap. Null means the discount never stops, and it cannot be ended later — set an instant whenever the deal has a known end date. Must be after effectiveFrom.

description
string | null

The deal's own name, shown on each discount line of the invoice.

Maximum string length: 255
idempotencyKey
string

A key of your choosing that makes a retry safe. Sending the same key against the same subscription returns the adjustment already created and creates no second one. Without a key a retried request creates a second adjustment, and two percentage discounts compound — two of 0.35 bill 57.75 percent off, not 35 percent.

Required string length: 1 - 255
Example:

"adj_fy26_growth_001"

Response

An adjustment already exists for this idempotency key, and is returned unchanged. Nothing was created.

object
enum<string>
required
Available options:
subscriptionAdjustment
id
string
required

The adjustment ID

subscriptionId
string
required

Unique identifier for a subscription

Pattern: ^sub_[a-zA-Z0-9]+$
type
enum<string>
required
Available options:
percentageDiscount,
usageDiscount
percentageDiscount
string | null
required

The discount rate as a decimal fraction between 0 and 1. "0.35" means 35 percent. Null on a usageDiscount, which carries a unit count instead.

usageDiscount
string | null
required

The number of usage units taken off the targeted line's billable quantity. Null on a percentageDiscount, which carries a rate instead.

targetPriceIds
string[]
required

The prices this adjustment reduces. Exactly one metered price on a usageDiscount; empty on a percentageDiscount, which reduces every discountable charge.

effectiveFrom
string<date-time>
required

Opens the window. Read per type: INCLUSIVE on a percentageDiscount, whose window is prorated by day overlap; EXCLUSIVE on a usageDiscount, which corrects a line whose period END falls strictly after this instant.

effectiveTo
string<date-time> | null
required

Closes the window, or null for never. Read per type: EXCLUSIVE on a percentageDiscount; INCLUSIVE on a usageDiscount, which corrects a line whose period END falls on or before this instant.

description
string | null
required

The deal's own name. Shown on each discount line a percentageDiscount emits; a usageDiscount emits no line, so its description is carried here only.

createdAt
string<date-time>
required