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
The unique identifier of the subscription.
- application/json
Body
- PaymentAuthorityStripe
- PaymentAuthorityAuthorizeNet
data SubscriptionUpdaterequired
The unique identifier.
Possible values: [subscription
]
attributes SubscriptionUpdateAttributesrequired
payment_authority object
Possible values: [elastic_path_payments_stripe
]
The name of the payment gateway facilitating the secure transmission of payment data.
Possible values: >= 3 characters
and <= 1024 characters
The unique identifier for a customer.
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.
Possible values: [authorize_net
]
The name of the payment gateway facilitating the secure transmission of payment data.
Possible values: >= 3 characters
and <= 1024 characters
The customer's payment profile id, unique to Authorize.net, used to facilitate payment of the subscription.
Possible values: >= 3 characters
and <= 1024 characters
The customer's profile id, unique to Authorize.net, used to facilitate payment of the subscription.
The date and time a pending
subscription goes live and becomes active. See Creating a pending subscription.
Responses
- 200
- 400
- 403
- 404
- 500
Success. The subscription is updated.
- application/json
- Schema
- Example (from schema)
Schema
- PaymentAuthorityStripe
- PaymentAuthorityAuthorizeNet
data Subscription
The unique identifier.
Possible values: [subscription
]
attributes SubscriptionAttributesrequired
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.
The unique identifier.
The unique identifier.
offering Offeringrequired
The unique identifier.
Possible values: [subscription_offering
]
attributes OfferingAttributesrequired
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.
Possible values: >= 3 characters
and <= 1024 characters
The name of the offering.
Possible values: <= 1024 characters
The offering description to display to customers.
The date and time a resource was updated.
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.
meta OfferingMetarequired
The owner of a resource, either store
or organization
.
timestamps Timestampsrequired
The date and time a resource was updated.
The date and time a resource was created.
The unique identifier.
Possible values: <= 1024 characters
The three-letter ISO currency code in uppercase.
payment_authority object
Possible values: [elastic_path_payments_stripe
]
The name of the payment gateway facilitating the secure transmission of payment data.
Possible values: >= 3 characters
and <= 1024 characters
The unique identifier for a customer.
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.
Possible values: [authorize_net
]
The name of the payment gateway facilitating the secure transmission of payment data.
Possible values: >= 3 characters
and <= 1024 characters
The customer's payment profile id, unique to Authorize.net, used to facilitate payment of the subscription.
Possible values: >= 3 characters
and <= 1024 characters
The customer's profile id, unique to Authorize.net, used to facilitate payment of the subscription.
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.
meta SubscriptionMetarequired
The owner of a resource, either store
or organization
.
timestamps Timestampsrequired
The date and time a resource was updated.
The date and time a resource was created.
The date and time a subscription was cancelled.
The date and time a subscription was paused.
The date and time a subscription was resumed.
The date and time a subscription will end.
The date and time a subscription will go live and become active.
The date and time a subscription was released from the pending state and made active.
Possible values: [active
, inactive
]
The status of a subscription, either active
or inactive
.
state SubscriptionState
The unique identifier.
Possible values: [subscription_state
]
This represents the type of resource object being returned. Always subscription_state
.
attributes SubscriptionStateAttributesrequired
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
.
meta StateMetarequired
The date and time a resource was created.
When configured to true, no payment gateway is used and a pending payment is created. See External Payments.
Whether a subscription is canceled or not.
Whether a subscription is paused or not.
Whether a subscription is closed or not.
Whether a subscription is suspended or not.
Whether a subscription is pending activation or not.
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.
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription",
"attributes": {
"external_ref": "abc123",
"account_id": "00000000-0000-0000-0000-000000000000",
"address_id": "00000000-0000-0000-0000-000000000000",
"offering": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription_offering",
"attributes": {
"external_ref": "abc123",
"name": "Magazine",
"description": "A lovely magazine that is published every month.",
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
},
"relationships": {
"plans": {
"links": {
"related": "/offerings/:offering-id/plans",
"self": "/offerings/:offering-id"
},
"data": {
"type": "offering-plan",
"id": "625fe958-7b4b-40a0-a2c0-dbb8f31eec0d"
}
}
},
"meta": {
"external_product_refs": [
"97dddc65-eabd-45d8-b45b-2ece5cfc8c50"
],
"owner": "store",
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
}
}
},
"plan_id": "00000000-0000-0000-0000-000000000000",
"currency": "USD",
"payment_authority": {}
},
"relationships": {
"plans": {
"links": {
"related": "/offerings/:offering-id/plans",
"self": "/offerings/:offering-id"
},
"data": {
"type": "offering-plan",
"id": "625fe958-7b4b-40a0-a2c0-dbb8f31eec0d"
}
}
},
"meta": {
"owner": "store",
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z",
"canceled_at": "2017-01-10T11:41:19.244842Z",
"paused_at": "2017-01-10T11:41:19.244842Z",
"resumed_at": "2017-01-10T11:41:19.244842Z",
"end_date": "2017-01-10T11:41:19.244842Z",
"go_live_after": "2017-01-10T11:41:19.244842Z",
"go_live": "2017-01-10T11:41:19.244842Z"
},
"status": "active",
"state": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription_state",
"attributes": {
"action": "cancel"
},
"meta": {
"created_at": "2017-01-10T11:41:19.244842Z"
}
},
"manual_payments": false,
"canceled": true,
"paused": true,
"closed": true,
"suspended": false,
"pending": false,
"invoice_after": "2017-01-10T11:41:19.244842Z"
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- missing-name
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Validation Error",
"status": "400",
"detail": "data.attributes.name: \"name\" is required"
}
]
}
Forbidden. The operation is forbidden on this entity.
- application/json
- Schema
- Example (from schema)
- not-found
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Permission denied",
"status": "404",
"detail": "Permission denied: plan tenancy mismatch"
}
]
}
Not found. The requested entity does not exist.
- application/json
- Schema
- Example (from schema)
- not-found
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Not Found",
"status": "404",
"detail": "No plan found"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
- Array [
- ]
errors Error[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Additional supporting meta data for the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Internal Server Error",
"status": "500"
}
]
}