Skip to main content

Update a subscription

PUT 

/subscriptions/subscriptions/:subscription_uuid

Updates a subscription. For example, a subscriber can switch from one plan to another in a subscription.

Request

Path Parameters

    subscription_uuid UUIDrequired

    The unique identifier of the subscription.

Body

    data SubscriptionUpdaterequired
    id UUID (string)required

    The unique identifier.

    type SubscriptionType (string)required

    Possible values: [subscription]

    attributes SubscriptionUpdateAttributesrequired
    plan_id
    address_id UUIDnullable
    payment_authority object
    oneOf
    type stringrequired

    Possible values: [elastic_path_payments_stripe]

    The name of the payment gateway facilitating the secure transmission of payment data.

    customer_id string

    Possible values: >= 3 characters and <= 1024 characters

    The unique identifier for a customer.

    card_id string

    Possible values: >= 3 characters and <= 1024 characters

    The unique identifier of the card used to facilitate payment of the subscription. If a card payment fails, you can use the card_id and customer_id attributes to program your front-end implementation to allow your preferred payment service provider to update a subscription with new card details. See Card declines.

    go_live_after stringnullable

    The date and time a pending subscription goes live and becomes active. See Creating a pending subscription.

Responses

Success. The subscription is updated.

Schema
    data Subscription
    id UUID (string)

    The unique identifier.

    type SubscriptionType (string)required

    Possible values: [subscription]

    attributes SubscriptionAttributesrequired
    external_ref ExternalRef (string)

    Possible values: <= 2048 characters

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    account_id UUID (string)required

    The unique identifier.

    address_id UUID (string)

    The unique identifier.

    offering Offeringrequired
    id UUID (string)

    The unique identifier.

    type SubscriptionOfferingType (string)required

    Possible values: [subscription_offering]

    attributes OfferingAttributesrequired
    external_ref ExternalRef (string)

    Possible values: <= 2048 characters

    A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.

    name stringrequired

    Possible values: >= 3 characters and <= 1024 characters

    The name of the offering.

    description string

    Possible values: <= 1024 characters

    The offering description to display to customers.

    updated_at stringrequired

    The date and time a resource was updated.

    created_at stringrequired

    The date and time a resource was created.

    relationships Relationships

    Relationships are established between different subscription entities. For example, a product and a plan are related to an offering, as both are attached to it.

    anyOf
    title
    meta OfferingMetarequired
    external_product_refs string[]required
    owner stringrequired

    The owner of a resource, either store or organization.

    timestamps Timestampsrequired
    updated_at stringrequired

    The date and time a resource was updated.

    created_at stringrequired

    The date and time a resource was created.

    plan_id UUID (string)required

    The unique identifier.

    currency CurrencyIdentifier (string)required

    Possible values: <= 1024 characters

    The three-letter ISO currency code in uppercase.

    payment_authority object
    oneOf
    type stringrequired

    Possible values: [elastic_path_payments_stripe]

    The name of the payment gateway facilitating the secure transmission of payment data.

    customer_id string

    Possible values: >= 3 characters and <= 1024 characters

    The unique identifier for a customer.

    card_id string

    Possible values: >= 3 characters and <= 1024 characters

    The unique identifier of the card used to facilitate payment of the subscription. If a card payment fails, you can use the card_id and customer_id attributes to program your front-end implementation to allow your preferred payment service provider to update a subscription with new card details. See Card declines.

    relationships Relationships

    Relationships are established between different subscription entities. For example, a product and a plan are related to an offering, as both are attached to it.

    anyOf
    title
    meta SubscriptionMetarequired
    owner stringrequired

    The owner of a resource, either store or organization.

    timestamps Timestampsrequired
    updated_at stringrequired

    The date and time a resource was updated.

    created_at stringrequired

    The date and time a resource was created.

    canceled_at string

    The date and time a subscription was cancelled.

    paused_at string

    The date and time a subscription was paused.

    resumed_at string

    The date and time a subscription was resumed.

    end_date string

    The date and time a subscription will end.

    go_live_after string

    The date and time a subscription will go live and become active.

    go_live string

    The date and time a subscription was released from the pending state and made active.

    status Status (string)required

    Possible values: [active, inactive]

    The status of a subscription, either active or inactive.

    state SubscriptionState
    id UUID (string)

    The unique identifier.

    type SubscriptionStateType (string)required

    Possible values: [subscription_state]

    This represents the type of resource object being returned. Always subscription_state.

    attributes SubscriptionStateAttributesrequired
    action SubscriptionStateAction (string)required

    Possible values: [cancel, pause, resume, pending]

    The subscription lifecycle is the states that a subscription can go through when a customer subscribes to a service or a product.

    A subscription can have the following states; canceled, paused, or resumed.

    See Managing the subscription lifecycle.

    meta StateMetarequired
    created_at stringrequired

    The date and time a resource was created.

    manual_payments ManualPayments (boolean)required

    When configured to true, no payment gateway is used and a pending payment is created. See External Payments.

    canceled booleanrequired

    Whether a subscription is canceled or not.

    paused booleanrequired

    Whether a subscription is paused or not.

    closed booleanrequired

    Whether a subscription is closed or not.

    suspended booleanrequired

    Whether a subscription is suspended or not.

    pending booleanrequired

    Whether a subscription is pending activation or not.

    invoice_after stringrequired

    The time when the subscription becomes eligible for a new invoice. The next invoice will be generated at the next billing run after this point.

Loading...