Update subscription item
POST/subscriptions/:subscriptionId/item/:itemId
Update subscription item.
Authorization Action:
pay:subscriptions:update
Request
Path Parameters
- application/json
Bodyrequired
The ID of the new price object.
Specifies which fields in the response should be expanded.
Responses
- 201
- application/json
- Schema
- Example (auto)
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.
Status of the subscription.
Possible values: [active, all, canceled, ended, incomplete, incomplete_expired, past_due, paused, trialing, unpaid]
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
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://connhex.com/subscriptions/:subscriptionId/item/:itemId");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"price\": \"string\",\n \"expand\": [\n \"string\"\n ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());