Skip to main content
POST
Attach a subscription discount

Authorizations

Authorization
string
header
required

A member credential in the Authorization: Bearer header: a member session JWT, a portal JWT whose login is linked to a membership in that company, or an opaque member token. The credential alone identifies the member and company.

Path Parameters

id
string<uuid>
required

Public UUID of an owned subscription.

Body

application/json

Top-level fields; undeclared fields and query parameters are rejected.

Exactly one discount definition selector and its duration; the bearer supplies all ownership and actor fields.

discount_id
string<uuid>
required

Public UUID of an eligible discount definition from this company.

duration
enum<string>
required

Duration of this attachment.

Available options:
forever,
once,
repeating
discount_code
string

Case-insensitive discount code; use instead of discount_id. Ambiguous codes return 422; select a definition by discount_id instead.

Minimum string length: 1
duration_cycles
integer

Positive cycle count, required only for repeating duration.

Required range: 1 <= x <= 2147483647
notes
string

Optional attachment explanation.

Maximum string length: 2048

Response

Discount attached.

The newly attached discount.

status
integer
required

HTTP response status.

data
object
required

A current or removed subscription discount attachment, identified separately from its discount definition.

meta
object
required

Envelope metadata present on every response.