Skip to main content
PATCH
/
update-subscription
/
{id}
Update Subscription
curl --request PATCH \
  --url https://app.closerx.ai/api/update-subscription/{id} \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "user_id": "user_12345",
  "auto_renew": false,
  "billing_cycle": "monthly",
  "status": "paused"
}
'
{
  "status": "success",
  "subscription_id": "sub_67890",
  "updated_fields": {
    "auto_renew": false,
    "billing_cycle": "monthly"
  }
}

Authorizations

api_key
string
header
required

Path Parameters

id
string
required

The unique ID of the subscription to update.

Example:

"sub_67890"

Body

application/json
user_id
string
required

The ID of the user whose subscription is being updated.

Example:

"user_12345"

auto_renew
boolean

Toggle for auto-renewal setting.

Example:

false

billing_cycle
string

New billing cycle if being changed. Accepted values: 'monthly', 'yearly'.

Example:

"monthly"

status
string

Set subscription status. Example values: 'active', 'paused', 'cancelled'.

Example:

"paused"

Response

Subscription successfully updated

status
string

Status of the subscription update operation.

Example:

"success"

subscription_id
string

ID of the updated subscription.

Example:

"sub_67890"

updated_fields
object

The fields that were updated in the subscription.

Example:
{
"auto_renew": false,
"billing_cycle": "monthly"
}