Skip to main content

Update subscription item

POST 

/subscriptions/:subscriptionId/item/:itemId

Update subscription item.

Authorization Action:

pay:subscriptions:update

Request

Path Parameters

    subscriptionId stringrequired
    itemId stringrequired

Bodyrequired

    pricestringrequired

    The ID of the new price object.

    expandstring[]

    Specifies which fields in the response should be expanded.

Responses

Schema
    cancel_atnumber

    A date in the future at which the subscription will automatically get canceled

    currencystringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    current_period_endnumberrequired

    End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.

    current_period_startnumberrequired

    Start of the current period that the subscription has been invoiced for.

    customer object

    The customer who owns the subscription.

    address objectrequired

    The customer's address.

    citystring
    countrystring

    Two-letter country code (ISO 3166-1 alpha-2).

    line1string

    Address line 1 (e.g., street, block, PO Box, or company name).

    line2string

    Address line 2 (e.g., apartment, suite, unit, or building).

    postal_codestring

    ZIP or postal code.

    statestring

    State, county, province, prefecture, or region.

    delinquentbooleanrequired

    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.

    emailstring

    The customer's email address.

    namestring

    The customer's full name or business name.

    phonestring

    The customer's phone number.

    subscriptionsobject

    The customer's current subscriptions, if any.

    idstringrequired

    Unique identifier for the object.

    creatednumberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    days_until_duenumberrequired

    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.

    ended_atnumber

    If the subscription has ended, the date the subscription ended.

    items object[]required

    List of subscription items, each with an attached price.

  • Array [
  • price objectrequired
    idstringrequired

    Unique identifier for the object.

    creatednumberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    activeboolean

    Whether the price can be used for new purchases. Defaults to true.

    currencystringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    currency_optionsobject

    Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.

    recurring object

    The recurring components of a price such as interval.

    intervalstringrequired

    Specifies billing frequency

    Possible values: [day, week, month, year]

    interval_countnumber

    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).

    Possible values: >= 1

    trial_period_daysnumber

    Default number of trial days when subscribing a customer to this price.

    usage_typestring

    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.

    Possible values: [licensed]

    unit_amount_decimalstringrequired

    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.

    quantitynumber

    The quantity of the plan to which the customer should be subscribed.

    subscriptionstringrequired

    The subscription this subscription_item belongs to.

    idstringrequired

    Unique identifier for the object.

    creatednumberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

  • ]
  • metadataobject
    start_datenumberrequired

    Date when the subscription was first created. The date might differ from the created date due to backdating.

    statusstringrequired

    Status of the subscription.

    Possible values: [active, all, canceled, ended, incomplete, incomplete_expired, past_due, paused, trialing, unpaid]

    trial_endnumber

    If the subscription has a trial, the end of that trial.

    trial_startnumber

    If the subscription has a trial, the beginning of that trial.

    idstringrequired

    Unique identifier for the object.

    creatednumberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

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());
Request Collapse all
Parameters
— pathrequired
— pathrequired
Body required
{
  "price": "string",
  "expand": [
    "string"
  ]
}