v1

latestOpenAPI 3.1.02026-07-24170121.2 MB

Update a Subscription

This API helps update a subscription.

patch/v1/subscriptions/{id}

Path parameters

idstring required

id here refers to a specific subscription that needs to be updated.

Headers

Acceptstring required

Indicates which content types, expressed as MIME types, the client is able to understand.

Content-Typestring required

Indicates the media type of the resource sent in the HTTP message body. <br /><br /><b>Possible Values:</b><br /> application/json<br />application/x-www-form-urlencoded

Request body

descriptionstring

An arbitrary string that describes the subscription.

tax_percentnumber

A number that represents the percentage of tax that will be applied to a subscription. Decimal values are allowed.

Example request

{
  "tax_percent": 5.8
}

Response

200

Example response

{
  "data": {
    "object": "Subscription",
    "id": "xlRP0jgPl0ljAXog",
    "customer_id": "jDPAnVxA4xPDVpKM",
    "billing_type": 1,
    "current_period_end": 1726490836,
    "current_period_start": 1726145236,
    "plan_ref": "n2pv6j6p2pvj3Ygq",
    "start_at": 1726490836,
    "status": "trial",
    "tax_percent": 5,
    "trial_end": 1726490836,
    "trial_days": 4,
    "trial_start": 1726145236,
    "created_at": 1726145236,
    "updated_at": 1726145913,
    "description": "testr",
    "payment_type": "card",
    "pause_units_allowed": [
      "days"
    ],
    "plan": {
      "data": {
        "object": "Plan",
        "plan_id": "plan_d2b50d00",
        "amount": 99,
        "interval": "day",
        "interval_count": 1,
        "name": "test",
        "statement_descriptor": "dfghdfhg",
        "currency": "usd",
        "created_at": 1724503321,
        "updated_at": 1724505447
      }
    }
  },
  "meta": {
    "include": [
      "plan"
    ]
  }
}