v1

latestOpenAPI 3.1.02026-07-241080412.6 KB

Update subscription

Use this endpoint to update an existing subscription, for example apply a coupon or to update payment details.

patch/subscriptions/{subscriptionId}

Path parameters

subscriptionIdstring required

Subscription identifier at Cleeng.

Headers

Content-Typestring

Request body

status'active' | 'stopped' | 'terminated'

Subscription status. <span style="color:red">Deprecated</span> <br> To change subscription status, use the following endpoints: <br> - Activate subscription <br> - Cancel subscription <br> - Terminate subscription

couponCodestring

Coupon code

expiresAtinteger

Expiration time in unix timestamp. <br><br> For <<glossary:Cleeng-managed subscriptions>> this value can't be in the past and it can't be earlier than the originally set value. (You can't shorten a Cleeng-managed subscription.) <br><br> For <<glossary:externally-managed subscriptions>>, these restrictions do not apply, and external systems that manage such subscriptions have full control over the expiration date.

paymentDetailsIdinteger

The identifier of Cleeng payment details connected to Cleeng customer. If you change this parameter, next renewals will be done with the new payment details ID.

inTrialboolean

Subscription trial status.

subscriptionExternalIdstring

An external identifier of an externally-managed subscription.

  • Max length: 512 characters
  • Must not be empty string
  • Must be unique per customer and platform - cannot duplicate an external ID already used by another active, stopped or paused subscription of the same customer on the same platform (terminated subscriptions are not considered)
  • Nullable: no

Response

200