Skip to main content

Get subscription

GET 

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

Get subscription

Request

Path Parameters

    subscription_uuid UUIDrequired

    The unique identifier of the subscription.

Query Parameters

    include string[]

    Possible values: [products, plans]

Responses

Success. The details of a subscription are returned.

Schema
    data Subscription
    idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionType (string)required

    Possible values: [subscription]

    Example: subscription
    attributes SubscriptionAttributesrequired
    external_refExternalRef (string)

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

    Possible values: <= 2048 characters

    Example: abc123
    account_idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    address_idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    offering Offeringrequired
    idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionOfferingType (string)required

    Possible values: [subscription_offering]

    Example: subscription_offering
    attributes OfferingResponseAttributes
    external_refExternalRef (string)

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

    Possible values: <= 2048 characters

    Example: abc123
    namestringrequired

    The name of the offering.

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

    Example: Magazine
    descriptionstring

    The offering description to display to customers.

    Possible values: <= 1024 characters

    Example: A lovely magazine that is published every month.
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    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.

    property name* Relationship
    anyOf
    meta OfferingMetarequired
    external_product_refsstring[]required
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps Timestampsrequired
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    plan_idUUID (string)required

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    currencyCurrencyIdentifier (string)required

    The three-letter ISO currency code in uppercase.

    Possible values: <= 1024 characters

    Example: USD
    payment_authority object
    type stringrequired

    Possible values: [elastic_path_payments_stripe, authorize_net]

    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.

    property name* Relationship
    anyOf
    meta SubscriptionMetarequired
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps SubscriptionTimestamps
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    canceled_atstring

    The date and time a subscription was cancelled.

    Example: 2017-01-10T11:41:19.244842Z
    paused_atstring

    The date and time a subscription was paused.

    Example: 2017-01-10T11:41:19.244842Z
    resumed_atstring

    The date and time a subscription was resumed.

    Example: 2017-01-10T11:41:19.244842Z
    end_datestring

    The date and time a subscription will end.

    Example: 2017-01-10T11:41:19.244842Z
    go_live_afterstring

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

    Example: 2017-01-10T11:41:19.244842Z
    go_livestring

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

    Example: 2017-01-10T11:41:19.244842Z
    statusStatus (string)required

    The status of a subscription, either active or inactive.

    Possible values: [active, inactive]

    Example: active
    state SubscriptionState
    idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionStateType (string)required

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

    Possible values: [subscription_state]

    Example: subscription_state
    attributes SubscriptionStateAttributesrequired
    actionSubscriptionStateAction (string)required

    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.

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

    Example: cancel
    meta StateMetarequired
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    manual_paymentsManualPayments (boolean)required

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

    Default value: false
    Example: false
    first_invoice_prepaidbooleanrequired

    Indicates that the first billing period of this subscription was paid for outside of the subscriptions service.

    Example: false
    canceledbooleanrequired

    Whether a subscription is canceled or not.

    Example: true
    pausedbooleanrequired

    Whether a subscription is paused or not.

    Example: true
    closedbooleanrequired

    Whether a subscription is closed or not.

    Example: true
    suspendedbooleanrequired

    Whether a subscription is suspended or not.

    Example: false
    pendingbooleanrequired

    Whether a subscription is pending activation or not.

    Example: false
    invoice_afterstringrequired

    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.

    Example: 2017-01-10T11:41:19.244842Z
    included SubscriptionIncludes
    products OfferingProduct[]
  • Array [
  • idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionOfferingProductType (string)required

    Possible values: [subscription_offering_product]

    Example: subscription_offering_product
    attributes OfferingProductResponseAttributes
    external_refExternalRef (string)

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

    Possible values: <= 2048 characters

    Example: abc123
    namestringrequired

    The name of the product.

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

    Example: Magazine
    descriptionstring

    The product or service description to display to customers.

    Possible values: <= 1024 characters

    Example: A lovely magazine that is published every month.
    skustring

    A stock keeping unit for the product, if appropriate.

    Possible values: <= 1024 characters

    Example: MAGAZINE1
    main_imageuri

    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.

    Possible values: <= 1024 characters

    Example: https://magazine.com/cover.jpg
    price Price
    property name* object

    The base price.

    amountint64required

    The value as a whole number of the currency's smallest subdivision.

    Example: 100
    includes_taxboolean

    Indicates whether the amount includes any taxes.

    Example: true
    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.

    unitstringrequired

    A unit of time.

    Possible values: [day, month]

    Example: day
    amountintegerrequired

    The number of days or months the period covers.

    Possible values: >= 1

    Example: 7
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    feature_configurations objectrequired

    A map of configurations indicating which features are available for the product

    property name* FeatureProductConfiguration
    typerequired

    Possible values: [access, promotion, usage]

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

    property name* Relationship
    anyOf
    meta ProductMetarequired
    display_price DisplayPrice
    without_tax PriceFormatting
    amountint64required

    The unformatted amount for the objects.

    Example: 100
    currencystringrequired

    The three-letter ISO currency code in uppercase, associated with a price.

    Example: USD
    formattedstringrequired

    The formatted amount for the objects.

    Example: $1.00
    with_tax PriceFormatting
    amountint64required

    The unformatted amount for the objects.

    Example: 100
    currencystringrequired

    The three-letter ISO currency code in uppercase, associated with a price.

    Example: USD
    formattedstringrequired

    The formatted amount for the objects.

    Example: $1.00
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps Timestampsrequired
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
  • ]
  • plans OfferingPlan[]
  • Array [
  • idUUID (string)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionOfferingPlanType (string)required

    Possible values: [subscription_offering_plan]

    Example: subscription_offering_plan
    attributes PlanResponseAttributes
    external_refExternalRef (string)

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

    Possible values: <= 2048 characters

    Example: abc123
    namestringrequired

    A name for the plan.

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

    Example: Monthly
    descriptionstring

    The plan description to display to customers.

    Possible values: <= 1024 characters

    Example: A monthly subscription.
    billing_interval_typestringrequired

    The unit of time that billing intervals are measured.

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

    Example: month
    billing_frequencyintegerrequired

    The number of intervals between issuing bills.

    Possible values: >= 1

    Example: 1
    trial_periodinteger

    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.

    Example: 7
    plan_lengthintegerrequired

    The number of intervals that the subscription runs for.

    Possible values: >= 1

    Example: 12
    end_behaviorstringrequired

    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.

    Possible values: [close, roll]

    Example: close
    can_pausebooleanrequired

    The subscriber can pause a subscription.

    Example: false
    can_resumebooleanrequired

    The subscriber can resume a paused subscription.

    Example: false
    can_cancelbooleanrequired

    The subscriber can cancel a subscription.

    Example: false
    base_price_percentagedouble

    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.

    Possible values: <= 100

    Example: 90
    fixed_price Price
    property name* object

    The base price.

    amountint64required

    The value as a whole number of the currency's smallest subdivision.

    Example: 100
    includes_taxboolean

    Indicates whether the amount includes any taxes.

    Example: true
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    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.

    property name* Relationship
    anyOf
    meta OfferingPlanMetarequired
    price Price
    property name* object

    The base price.

    amountint64required

    The value as a whole number of the currency's smallest subdivision.

    Example: 100
    includes_taxboolean

    Indicates whether the amount includes any taxes.

    Example: true
    display_price DisplayPrice
    without_tax PriceFormatting
    amountint64required

    The unformatted amount for the objects.

    Example: 100
    currencystringrequired

    The three-letter ISO currency code in uppercase, associated with a price.

    Example: USD
    formattedstringrequired

    The formatted amount for the objects.

    Example: $1.00
    with_tax PriceFormatting
    amountint64required

    The unformatted amount for the objects.

    Example: 100
    currencystringrequired

    The three-letter ISO currency code in uppercase, associated with a price.

    Example: USD
    formattedstringrequired

    The formatted amount for the objects.

    Example: $1.00
    active_planActivePlan (boolean)

    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.

    Example: true
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps Timestampsrequired
    updated_atstringrequired

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
  • ]

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://euwest.api.elasticpath.com/v2/subscriptions/subscriptions/:subscription_uuid");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com/v2
Auth
Parameters
— pathrequired
— query
ResponseClear

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

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.