Update subscription item
POSThttps://apis.<domain>/subscriptions/:subscriptionId/item/:itemId
Authorization: http
name: bearerTokentype: httpscheme: bearerin: headerdescription: Authorization Header: `Authorization: Bearer <user_token>`
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
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
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
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
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://apis.<domain>/subscriptions/:subscriptionId/item/:itemId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"price": "string",
"expand": [
"string"
]
}'