Update subscription item
POST/subscriptions/:subscriptionId/item/:itemId
Update subscription item.
Authorization Action:
pay:subscriptions:update
Request
Path Parameters
- application/json
Body
required
The ID of the new price object.
Specifies which fields in the response should be expanded.
Responses
- 201
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
A date in the future at which the subscription will automatically get canceled
Three-letter ISO currency code, in lowercase. Must be a supported currency.
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
Start of the current period that the subscription has been invoiced for.
customer object
address objectrequired
The customer's address.
Two-letter country code (ISO 3166-1 alpha-2).
Address line 1 (e.g., street, block, PO Box, or company name).
Address line 2 (e.g., apartment, suite, unit, or building).
ZIP or postal code.
State, county, province, prefecture, or region.
When the customer's latest invoice is billed by charging automatically, delinquent
is true
if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent
is true
if the invoice isn't paid by its due date.
The customer's email address.
The customer's full name or business name.
The customer's phone number.
The customer's current subscriptions, if any.
Unique identifier for the object.
Time at which the object was created. Measured in seconds since the Unix epoch.
Number of days a customer has to pay invoices generated by this subscription. This value will be null
for subscriptions where collection_method=charge_automatically
.
If the subscription has ended, the date the subscription ended.
items object[]required
List of subscription items, each with an attached price.
price objectrequired
Unique identifier for the object.
Time at which the object was created. Measured in seconds since the Unix epoch.
Whether the price can be used for new purchases. Defaults to true
.
Three-letter ISO currency code, in lowercase. Must be a supported currency.
Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.
recurring object
Possible values: [day
, week
, month
, year
]
Specifies billing frequency
Possible values: >= 1
The number of intervals between subscription billings. For example, interval=month
and interval_count=3
bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
Default number of trial days when subscribing a customer to this price.
Possible values: [licensed
]
Configures how the quantity per period should be determined. Can be either metered
or licensed
. licensed
automatically bills the quantity
set when adding it to a subscription. metered
aggregates the total usage based on usage records. Defaults to licensed
.
Decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of unit_amount
and unit_amount_decimal
can be set.
The quantity of the plan to which the customer should be subscribed.
The subscription
this subscription_item
belongs to.
Unique identifier for the object.
Time at which the object was created. Measured in seconds since the Unix epoch.
Date when the subscription was first created. The date might differ from the created
date due to backdating.
Possible values: [active
, all
, canceled
, ended
, incomplete
, incomplete_expired
, past_due
, paused
, trialing
, unpaid
]
Status of the subscription.
If the subscription has a trial, the end of that trial.
If the subscription has a trial, the beginning of that trial.
Unique identifier for the object.
Time at which the object was created. Measured in seconds since the Unix epoch.
{
"cancel_at": 0,
"currency": "string",
"current_period_end": 0,
"current_period_start": 0,
"customer": {
"address": {
"city": "string",
"country": "string",
"line1": "string",
"line2": "string",
"postal_code": "string",
"state": "string"
},
"delinquent": true,
"email": "string",
"name": "string",
"phone": "string",
"subscriptions": {},
"id": "string",
"created": 0
},
"days_until_due": 0,
"ended_at": 0,
"items": [
{
"price": {
"id": "string",
"created": 0,
"active": true,
"currency": "string",
"currency_options": {},
"recurring": {
"interval": "day",
"interval_count": 0,
"trial_period_days": 0,
"usage_type": "licensed"
},
"unit_amount_decimal": "string"
},
"quantity": 0,
"subscription": "string",
"id": "string",
"created": 0
}
],
"metadata": {},
"start_date": 0,
"status": "active",
"trial_end": 0,
"trial_start": 0,
"id": "string",
"created": 0
}