Update a Subscription Item

PATCH

/v1/subscription-items/:id

Updates the subscription with the given ID and provided attributes.


Attributes

quantity

The unit quantity of the subscription.

invoice_immediately

If true, any updates to the subscription will be charged immediately. A new prorated invoice will be generated and payment attempted. Defaults to false. Note that this will be overridden by the disable_prorations option if used.

disable_prorations

If true, no proration will be charged and the customer will simply be charged the new price at the next renewal. Defaults to false. Note that this will override the invoice_immediately option if used.

Read about proration in the Developer Guide.


curl -X "PATCH" "https://api.lemonsqueezy.com/v1/subscription-items/1" \
  -H "Accept: application/vnd.api+json" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Authorization: Bearer {api_key}" \
  -d '{
    "data": {
      "type": "subscription-items",
      "id": "1",
      "attributes": {
        "quantity": 10
      }
    }
  }'

Returns

Returns the updated Subscription Item object.

{
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://api.lemonsqueezy.com/v1/subscription-item/1"
  },
  "data": {
    "type": "subscription-items",
    "id": "1",
    "attributes": {
      "subscription_id": 1,
      "price_id": 1,
      "quantity": 10,
      "is_usage_based": false,
      "created_at": "2023-07-18T12:16:24.000000Z",
      "updated_at": "2023-07-18T12:23:18.000000Z"
    },
    "relationships": {
      "subscription": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/subscription-items/1/subscription",
          "self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/subscription"
        }
      },
      "price": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/subscription-items/1/price",
          "self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/price"
        }
      },
      "usage-records": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/subscription-items/1/usage-records",
          "self": "https://api.lemonsqueezy.com/v1/subscription-items/1/relationships/usage-records"
        }
      }
    },
    "links": {
      "self": "https://api.lemonsqueezy.com/v1/subscription-items/1"
    }
  }
}

Was this page helpful?