List subscriptions
GET/subscriptions/subscriptions
Retrieves a list of all subscriptions.
Filtering
This endpoint supports filtering. For the general syntax, see Filtering.
The following attributes and operators are supported.
Operator | Attribute | Description |
---|---|---|
eq | account_id , name , email , external_ref | Equals. Checks if the values of two operands are equal. If they are, the condition is true. |
Including Resources
You can use the include
parameter to include the following resources with this endpoint.
Resource | Required | Description |
---|---|---|
plans, products | Optional | Retrieves all plans and products associated with a subscription. |
products | Optional | Retrieves all products associated with a subscription. |
plans | Optional | Retrieves all plans associated with a subscription. |
See Characteristics of Include Parameter.
Request
Query Parameters
Possible values: <= 10000
The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the page length store setting is used.
The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the page length store setting is used.
Responses
- 200
- 400
- 500
Success. A list of subscriptions is returned.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- PaymentAuthorityStripe
- PaymentAuthorityAuthorizeNet
- ]
- Array [
- ]
- Array [
- ]
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.
included SubscriptionIncludes
products OfferingProduct[]
The unique identifier.
Possible values: [subscription_offering_product
]
attributes ProductAttributesrequired
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 product.
Possible values: <= 1024 characters
The product or service description to display to customers.
Possible values: <= 1024 characters
A stock keeping unit for the product, if appropriate.
Possible values: <= 1024 characters
A URL from which an image or file for the product can be fetched. You can either upload your images and files to Commerce using the Commerce Files API or you can use your own content delivery network. If you are using the Commerce Files API, use Create a File to upload your file and return an HREF link in the response. An extensive range of media and file extensions are supported.
price Price
property name* object
The base price.
The value as a whole number of the currency's smallest subdivision.
Indicates whether the amount includes any taxes.
price_units object
The timeframe during which the product price is applicable. For example, for a streaming service, the price is $12.99 and the unit
is months
and the amount
is 1
. In other words, the streaming service is available for $12.99 a month. You may want to specify a unit price if you have many products that all have different prices. Rather than having to create separate plans for each product, you can specify the timeframe during which the product price is applicable and then create one plan that determines the billing frequency for those products.
Possible values: [day
, month
]
A unit of time.
Possible values: >= 1
The number of days or months the period covers.
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 ProductMetarequired
display_price DisplayPrice
without_tax PriceFormatting
The unformatted amount for the objects.
The three-letter ISO currency code in uppercase, associated with a price.
The formatted amount for the objects.
with_tax PriceFormatting
The unformatted amount for the objects.
The three-letter ISO currency code in uppercase, associated with a price.
The formatted amount for the objects.
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.
plans OfferingPlan[]
The unique identifier.
Possible values: [subscription_offering_plan
]
attributes PlanAttributesrequired
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
A name for the plan.
Possible values: <= 1024 characters
The plan description to display to customers.
Possible values: [day
, week
, month
, year
]
The unit of time that billing intervals are measured.
Possible values: >= 1
The number of intervals between issuing bills.
The number of intervals from the start of the subscription before billing starts. Used with billing_interval_type
. For example, if billing_interval_type
is months
, and trial_period
is 1
, the trial period is 1 month.
Possible values: >= 1
The number of intervals that the subscription runs for.
Possible values: [close
, roll
]
Enables you to specify recurring payments. If end_behavior
is roll
, customers pay regularly and repeatedly. If end_behavior
is close
, customers pay a total amount in a limited number of partial payments.
The subscriber can pause a subscription.
The subscriber can resume a paused subscription.
The subscriber can cancel a subscription.
Possible values: <= 100
A percentage discount on the total cost of any products within an offering. For example, you can configure a percentage that equates the cost of a plan to the total value of all products within the offering, reduced by a percentage. For example, if you specify 10
, a 10% discount is applied to the total value of all repeat products in an offering.
fixed_price Price
property name* object
The base price.
The value as a whole number of the currency's smallest subdivision.
Indicates whether the amount includes any taxes.
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 OfferingPlanMetarequired
price Price
property name* object
The base price.
The value as a whole number of the currency's smallest subdivision.
Indicates whether the amount includes any taxes.
display_price DisplayPrice
without_tax PriceFormatting
The unformatted amount for the objects.
The three-letter ISO currency code in uppercase, associated with a price.
The formatted amount for the objects.
with_tax PriceFormatting
The unformatted amount for the objects.
The three-letter ISO currency code in uppercase, associated with a price.
The formatted amount for the objects.
Whether a plan is active on a subscription using that offering. The active_plan
attribute is null if a plan is not active in a subscription.
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.
links object
{
"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"
}
}
],
"included": {
"products": [
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription_offering_product",
"attributes": {
"external_ref": "abc123",
"name": "Magazine",
"description": "A lovely magazine that is published every month.",
"sku": "MAGAZINE1",
"main_image": "https://magazine.com/cover.jpg",
"price": {
"USD": {
"amount": 100,
"includes_tax": false
},
"GBP": {
"amount": 90,
"includes_tax": true
}
},
"price_units": {
"unit": "day",
"amount": 7
},
"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": {
"display_price": {
"without_tax": {
"amount": 100,
"currency": "USD",
"formatted": "$1.00"
},
"with_tax": {
"amount": 110,
"currency": "USD",
"formatted": "$1.10"
}
},
"owner": "store",
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
}
}
}
],
"plans": [
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "subscription_offering_plan",
"attributes": {
"external_ref": "abc123",
"name": "Monthly",
"description": "A monthly subscription.",
"billing_interval_type": "month",
"billing_frequency": 1,
"trial_period": 7,
"plan_length": 12,
"end_behavior": "close",
"can_pause": false,
"can_resume": false,
"can_cancel": false,
"base_price_percentage": 90,
"fixed_price": {
"USD": {
"amount": 100,
"includes_tax": false
},
"GBP": {
"amount": 90,
"includes_tax": true
}
},
"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": {
"price": {
"USD": {
"amount": 100,
"includes_tax": false
},
"GBP": {
"amount": 90,
"includes_tax": true
}
},
"display_price": {
"without_tax": {
"amount": 100,
"currency": "USD",
"formatted": "$1.00"
},
"with_tax": {
"amount": 110,
"currency": "USD",
"formatted": "$1.10"
}
},
"active_plan": true,
"owner": "store",
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
}
}
}
]
},
"links": {}
}
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"
}
]
}
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"
}
]
}