Attach Discount To Subscription

View as Markdown

Attach a discount to a subscription.

This will remove any existing subscription-level discount before attaching the new one.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

subscription_external_idstringRequired
account_idstringRequired

Request

This endpoint expects an object.
coupon_idstringRequired
ID of the coupon to apply
promotion_codestring or nullOptional
Optional promotion code used to apply this coupon
start_datedatetime or nullOptional

When the discount becomes active (defaults to now)

end_datedatetime or nullOptional

When the discount expires (based on coupon duration if not set)

metadatamap from strings to any or nullOptional
Arbitrary metadata

Response

Successful Response
idstring
coupon_idstring
promotion_code_idstring or null
attachment_levelstring
customer_idstring or null
subscription_idstring or null
invoice_idstring or null
invoice_item_idstring or null
start_datedatetime
end_datedatetime or null
is_activeboolean
metadatamap from strings to any or null
created_atdatetime
updated_atdatetime

Errors

422
Unprocessable Entity Error