Skip to main content

Create a subscription state

POST 

https://euwest.api.elasticpath.com/v2/subscriptions/subscriptions/:subscription_uuid/states

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:

Request

Path Parameters

    subscription_uuid UUIDrequired

    The unique identifier of the subscription.

Body

    data ChangeStaterequired
    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.

Responses

Success. The subscription's state has changed.

Authorization: http

name: BearerTokentype: httpscheme: bearer
curl -L -X POST 'https://euwest.api.elasticpath.com/v2/subscriptions/subscriptions/:subscription_uuid/states' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"data": {
"type": "subscription_state",
"attributes": {
"action": "cancel"
}
}
}'
Request Collapse all
Base URL
https://euwest.api.elasticpath.com/v2
Auth
Parameters
— pathrequired
Body
{
  "data": {
    "type": "subscription_state",
    "attributes": {
      "action": "cancel"
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!