Elastic Path Subscriptions API

Elastic Path Subscriptions enables you to manage your subscriptions plans and pricing options, using offerings. Offerings can contain any combination of pricing options and a plan. When a customer chooses a pricing option, a subscription is created. ### Managing the Subscription Lifecycle The subscription lifecycle is the states that a subscription can go through when a customer subscribes to a service or a plan. A subscription can have the following states: - `pending` - `canceled` - `paused` - `resumed` #### Creating a pending subscription A subscription can be created in a `pending` state. This is useful for several reasons. - If there are subscriptions that require user setup or onboarding, for example, installing software or setting up preferences. This helps reduce shopper frustration during the onboarding process, as the shopper is not paying for a service that they cannot use yet. - When offering a free trial or promotion, keeping the subscription in a pending state until the trial or promotion starts or ends allows you to manage transitions more smoothly. - Before a subscription becomes active, you may need to verify the payment method or authorize the first payment. Keeping the subscription in a pending state allows time to complete these steps without activating the subscription. For a subscription with a `pending` state, you can also configure a `go_live_after` date. The subscription starts from the `go_live_after` date. This is useful as it ensures both the subscription provider and subscriber are clear about when a subscription officially begins. Once the `go_live_after` date is passed, the subscription becomes `active`, initiating the billing and payment runs. If a subscription is activated this way, you can see this in the `timestamp` meta. You can configure a `go_live_after` date to be a past date. This is useful, for example, for backdating a subscription or managing a delay in activating a subscription. Setting the `go_live_after` date in the past ensures the subscriptions timeline correctly aligns with the agreed-upon service start date. :::caution Although, billing runs generate one invoice per subscription, if a `go_live_date` is set far in the past, multiple invoices could be generated over the course of several billing runs, which could be frustrating and confusing to your subscribers. ::: See [create a subscription](/docs/api/subscriptions/create-subscription). #### Cancelling or pausing and resuming subscriptions A subscriber can decide to cancel or pause and/or resume a subscription. The following example describes pausing or canceling and resuming a subscription. 1. The subscriber pauses or cancels the subscription. - The subscription status is `active`. - either `paused` or `cancelled` is set to `true`. - either the `paused_at` or `cancelled_at` timestamp is populated with the date and time the subscription is paused or cancelled. - for cancelled subscriptions, `end_date` indicates when the subscription will expire and end. 2. When the next billing run is due, the billing run checks the subscription state. If the subscription state is paused or cancelled then no invoice is created and the subscription status is updated to `inactive`. 3. Subsequent billing runs skip that subscription completely as the subscription status is `inactive`. 4. If the subscriber resumes the subscription: - either `paused` or `cancelled` is set to `false`. - the `resumed_at` timestamp is populated with the date and time the subscription is resumed. 5. When the next billing run is due, the billing run checks the subscription state. If the `paused` or `cancelled` is set to `false` then the billing run creates an invoice. 6. The payment run processes the invoice. Once the payment succeeds then the payment run updates the status of the subscription to `active`. ### Orders When a customer chooses a subscription, they need to add the subscription to a cart, checkout the cart and then pay for the order. 1. When a customer adds a subscription to cart, this is handled using the `Add subscription to cart` endpoint. 2. Once a subscription has been added to a cart, the [**Checkout API**](/docs/api/carts/checkout-api) converts the cart to an order. 3. Once the order is created, payment needs to be taken. This is handled by Elastic Path Payments Powered by Stripe. See [**Payments**](/docs/api/subscriptions/invoices#payments).

OpenAPI Specification

elastic-path-subscriptions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: 25.1126.6886238
  x-version-timestamp: 2025-11-26 19:10:23+00:00
  title: Addresses Introduction Account Addresses Subscriptions API
  description: 'The Addresses API allows you to organize account addresses. Addresses are a sub-resource of `account` resources, an account can have multiple addresses, such as home, work, and neighbour.


    You can use an account address with either [client_credentials access token](/docs/api/authentication/create-an-access-token) or a combination of [implicit access token](/docs/api/authentication/create-an-access-token) and [Account Management authentication](/docs/api/accounts/post-v-2-account-members-tokens) token.

    '
  contact:
    name: Elastic Path
    url: https://www.elasticpath.com
    email: support@elasticpath.com
  license:
    url: https://elasticpath.dev
    name: MIT
servers:
- url: https://useast.api.elasticpath.com
  description: US East
- url: https://euwest.api.elasticpath.com
  description: EU West
security:
- BearerToken: []
tags:
- name: Subscriptions
  description: "Elastic Path Subscriptions enables you to manage your subscriptions plans and pricing options, using offerings. Offerings can contain any combination of pricing options and a plan. When a customer chooses a pricing option, a subscription is created.  \n\n### Managing the Subscription Lifecycle\n\nThe subscription lifecycle is the states that a subscription can go through when a customer subscribes to a service or a plan. \n\nA subscription can have the following states:\n\n- `pending`\n- `canceled`\n- `paused`\n- `resumed`\n\n#### Creating a pending subscription \n\nA subscription can be created in a `pending` state. This is useful for several reasons.\n\n- If there are subscriptions that require user setup or onboarding, for example, installing software or setting up preferences. This helps reduce shopper frustration during the onboarding process, as the shopper is not paying for a service that they cannot use yet.\n- When offering a free trial or promotion, keeping the subscription in a pending state until the trial or promotion starts or ends allows you to manage transitions more smoothly. \n- Before a subscription becomes active, you may need to verify the payment method or authorize the first payment. Keeping the subscription in a pending state allows time to complete these steps without activating the subscription.\n\nFor a subscription with a `pending` state, you can also configure a `go_live_after` date. The subscription starts from the `go_live_after` date. This is useful as it ensures both the subscription provider and subscriber are clear about when a subscription officially begins. Once the `go_live_after` date is passed, the subscription becomes `active`, initiating the billing and payment runs. If a subscription is activated this way, you can see this in the `timestamp` meta.   \n\nYou can configure a `go_live_after` date to be a past date. This is useful, for example, for backdating a subscription or managing a delay in activating a subscription. Setting the `go_live_after` date in the past ensures the subscriptions timeline correctly aligns with the agreed-upon service start date. \n\n:::caution\n\nAlthough, billing runs generate one invoice per subscription, if a `go_live_date` is set far in the past, multiple invoices could be generated over the course of several billing runs, which could be frustrating and confusing to your subscribers. \n\n:::\n\nSee [create a subscription](/docs/api/subscriptions/create-subscription).\n\n#### Cancelling or pausing and resuming subscriptions\n\nA subscriber can decide to cancel or pause and/or resume a subscription. The following example describes pausing or canceling and resuming a subscription.\n\n1. The subscriber pauses or cancels the subscription. \n   - The subscription status is `active`. \n   - either `paused` or `cancelled` is set to `true`.\n   - either the `paused_at` or `cancelled_at` timestamp is populated with the date and time the subscription is paused or cancelled.\n   - for cancelled subscriptions, `end_date` indicates when the subscription will expire and end.\n2. When the next billing run is due, the billing run checks the subscription state. If the subscription state is paused or cancelled then no invoice is created and the subscription status is updated to `inactive`.\n3. Subsequent billing runs skip that subscription completely as the subscription status is `inactive`.\n4. If the subscriber resumes the subscription:\n   - either `paused` or `cancelled` is set to `false`.\n   - the `resumed_at` timestamp is populated with the date and time the subscription is resumed.\n5. When the next billing run is due, the billing run checks the subscription state. If the `paused` or `cancelled` is set to `false` then the billing run creates an invoice.\n6. The payment run processes the invoice. Once the payment succeeds then the payment run updates the status of the subscription to `active`.\n\n### Orders\n\nWhen a customer chooses a subscription, they need to add the subscription to a cart, checkout the cart and then pay for the order. \n\n1. When a customer adds a subscription to cart, this is handled using the `Add subscription to cart` endpoint. \n2. Once a subscription has been added to a cart, the [**Checkout API**](/docs/api/carts/checkout-api) converts the cart to an order. \n3. Once the order is created, payment needs to be taken. This is handled by Elastic Path Payments Powered by Stripe. See [**Payments**](/docs/api/subscriptions/invoices#payments).\n"
paths:
  /v2/subscriptions/subscriptions:
    parameters:
    - $ref: '#/components/parameters/Filter'
    post:
      tags:
      - Subscriptions
      summary: Create a subscription
      operationId: CreateSubscription
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  $ref: '#/components/schemas/BuildSubscription'
      responses:
        '201':
          description: Success. The subscription is created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Subscription'
        '400':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      tags:
      - Subscriptions
      summary: List subscriptions
      parameters:
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      - $ref: '#/components/parameters/SubscriptionInclude'
      operationId: ListSubscriptions
      description: "Retrieves a list of all subscriptions.\n\n### Filtering\n\nThis endpoint supports filtering. For the general syntax, see [**Filtering**](/guides/Getting-Started/filtering).\n\nThe following attributes and operators are supported.\n\n| Operator | Attribute | Description |\n| --- | --- | --- | \n| `eq` | `account_id`, `name`, `email`, `external_ref` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. |\n| `in` | `account_id`, `name`, `email`, `external_ref` | In. Checks if the value is in the specified list. If it is, the condition is true. |\n\n### Including Resources\n\nYou can use the `include` parameter to include the following resources with this endpoint.\n\n| Resource | Required | Description |\n| --- | --- | --- |\n| `pricing_options, plans` | Optional | Retrieves all pricing options and plans associated with a subscription. |\n| `plans` | Optional | Retrieves all plans associated with a subscription. |\n| `pricing_options` | Optional | Retrieves all pricing options associated with a subscription. |\n\nSee [Characteristics of Include Parameter](/guides/Getting-Started/includes#characteristics-of-include-parameter).\n"
      responses:
        '200':
          description: Success. A list of subscriptions is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscription'
                  included:
                    $ref: '#/components/schemas/SubscriptionIncludes'
                  links:
                    $ref: '#/components/schemas/Links'
        '400':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      parameters:
      - $ref: '#/components/parameters/SubscriptionInclude'
      tags:
      - Subscriptions
      summary: Get subscription
      operationId: GetSubscription
      responses:
        '200':
          description: Success. The details of a subscription are returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Subscription'
                  included:
                    $ref: '#/components/schemas/SubscriptionIncludes'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Subscriptions
      summary: Update a subscription
      description: 'Updates a subscription. For example, a subscriber can switch from one pricing option to another in a subscription.

        '
      operationId: UpdateSubscription
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  $ref: '#/components/schemas/SubscriptionUpdate'
      responses:
        '200':
          description: Success. The subscription is updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Subscription'
        '400':
          $ref: '#/components/responses/ValidationError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
      - Subscriptions
      summary: Delete a subscription
      operationId: DeleteSubscription
      description: 'Deletes a subscription

        '
      responses:
        '204':
          description: Success. The subscription is removed.
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/features/{feature_uuid}:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: feature_uuid
      in: path
      description: The unique identifier of the feature.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      summary: Get a feature in a subscription
      operationId: GetSubscriptionFeature
      tags:
      - Subscriptions
      responses:
        '200':
          description: Success. The details of the feature are returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/OfferingFeature'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/plans/{plan_uuid}:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: plan_uuid
      in: path
      description: The unique identifier of the plan.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      summary: Get a plan in a subscription
      operationId: GetSubscriptionPlan
      tags:
      - Subscriptions
      responses:
        '200':
          description: Success. The details of the plan are returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/OfferingPlan'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/pricing-options/{pricing_option_uuid}:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: pricing_option_uuid
      in: path
      description: The unique identifier of the pricing option.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      summary: Get a pricing option in a subscription
      operationId: GetSubscriptionPricingOption
      tags:
      - Subscriptions
      responses:
        '200':
          description: Success. The details of the pricing option are returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/OfferingPricingOption'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/features:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      summary: List an subscriptions features
      operationId: ListSubscriptionFeatures
      parameters:
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      responses:
        '200':
          description: Success. A list of subscription features is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OfferingFeature'
                  links:
                    $ref: '#/components/schemas/Links'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/plans:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      summary: List subscription plans
      description: Retrieves a list of plans associated with the specified subscription. Using this endpoint you can see the plan that is currently active in a subscription. If `active_plan` is `true`, a plan is active in a subscription. If `active_plan` is null, the pricing option is not active.
      operationId: ListSubscriptionPlans
      responses:
        '200':
          description: Success. A list of subscription plans is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OfferingPlan'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
      - Subscriptions
      summary: Manage subscription plans
      description: Manage subscription plans by replacing, changing or detaching plans on the subscription
      operationId: ManageSubscriptionPlans
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  type: array
                  description: A list of plan IDs to manage on the subscription.
                  items:
                    $ref: '#/components/schemas/ManageSubscriptionPlans'
              example:
                data:
                - type: attach
                  plans:
                  - bafa601f-359c-48da-834e-377b6c0d9466
                - type: detach
                  plans:
                  - a8aad94d-60fc-44f7-8dfa-299249566ec4
      responses:
        '204':
          description: Success. The subscription's plans have been updated.
        '400':
          $ref: '#/components/responses/ValidationError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/pricing-options:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      summary: List subscription pricing options
      description: Retrieves a list of pricing options associated with the specified subscription. Using this endpoint you can see the pricing options that are currently active in a subscription. If `active_pricing_option` is `true`, a pricing option is active in a subscription. If `active_pricing_option` is null, the pricing option is not active.
      operationId: ListSubscriptionPricingOptions
      responses:
        '200':
          description: Success. A list of subscription pricing options is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OfferingPricingOption'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/states:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    post:
      tags:
      - Subscriptions
      summary: Create a subscription state
      description: "The subscription lifecycle is the states that a subscription can go through when a customer subscribes to a service or a plan. \n\nA subscription can have the following states:\n\n- `pending` \n- `canceled`\n- `paused`\n- `resumed`\nFor more information, see [Managing the Subscription Lifecycle](/docs/api/subscriptions/subscriptions#managing-the-subscription-lifecycle).\n\nImmediate cancellation (`cancel` with `cancel_immediately: true`) ends the subscription and updates entitlements in this request; it does **not** issue refunds or modify paid invoices. Use payments refund flows separately if needed.\n"
      operationId: CreateSubscriptionState
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  $ref: '#/components/schemas/ChangeState'
      responses:
        '204':
          description: Success. The subscription's state has changed.
        '400':
          $ref: '#/components/responses/ValidationError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      tags:
      - Subscriptions
      summary: List subscription states
      operationId: ListSubscriptionStates
      responses:
        '200':
          description: Success. A list of subscription states is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionState'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/states/{state_uuid}:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: state_uuid
      in: path
      description: The unique identifier of the subscription state.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      summary: Get subscription state
      operationId: GetSubscriptionState
      responses:
        '200':
          description: Success. A subscription state is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SubscriptionState'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/invoices:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      summary: List subscription invoices
      description: Lists all invoices for a given subscription.
      parameters:
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      operationId: ListSubscriptionInvoices
      responses:
        '200':
          description: Success. A list of invoices is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionInvoice'
                  links:
                    $ref: '#/components/schemas/Links'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/invoices/{invoice_uuid}/payments:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: invoice_uuid
      in: path
      description: The unique identifier of the invoice.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      parameters:
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      summary: List subscription invoice payments
      description: Lists all invoice payments for a given invoice.
      operationId: ListSubscriptionInvoicePayments
      responses:
        '200':
          description: Success. Payments for the invoice are returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionInvoicePayment'
                  links:
                    $ref: '#/components/schemas/Links'
  /v2/subscriptions/subscriptions/{subscription_uuid}/invoices/{invoice_uuid}/payments/{payment_uuid}:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: invoice_uuid
      in: path
      description: The unique identifier of the invoice.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: payment_uuid
      in: path
      description: The unique identifier of the payment.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      summary: Get subscription invoice payment
      description: Gets a specific payment for a given invoice.
      operationId: GetSubscriptionInvoicePayment
      responses:
        '200':
          description: Success. Specific payment for the invoice is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SubscriptionInvoicePayment'
        '404':
          $ref: '#/components/responses/NotFoundError'
  /v2/subscriptions/subscriptions/{subscription_uuid}/invoices/{invoice_uuid}:
    parameters:
    - name: subscription_uuid
      in: path
      description: The unique identifier of the subscription.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    - name: invoice_uuid
      in: path
      description: The unique identifier of the invoice.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Subscriptions
      summary: Get subscription invoice
      description: Gets a specific invoice for a given subscription.
      operationId: GetSubscriptionInvoice
      responses:
        '200':
          description: Success. An invoice is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SubscriptionInvoice'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    FeatureConfigUsageAttributes:
      description: Configures a usage feature against a plan in an offering, indicating that the referenced feature is a benefit of that plan. The default value that the usage metrics adopts must be supplied.
      required:
      - type
      - default_value
      properties:
        type:
          type: string
          enum:
          - usage
          example: usage
        default_value:
          type: integer
          description: The default initial value
          example: 10
    PlanResponseAttributes:
      allOf:
      - $ref: '#/components/schemas/PlanAttributes'
      - $ref: '#/components/schemas/Timestamps'
    Timestamps:
      required:
      - created_at
      - updated_at
      properties:
        updated_at:
          description: The date and time a resource was updated.
          type: string
          example: '2017-01-10T11:41:19.244842Z'
        created_at:
          description: The date and time a resource was created.
          type: string
          example: '2017-01-10T11:41:19.244842Z'
    FeatureResponseAttributes:
      allOf:
      - $ref: '#/components/schemas/FeatureAttributes'
    SubscriptionInvoice:
      required:
      - type
      - attributes
      - meta
      properties:
        id:
          $ref: '#/components/schemas/UUID'
        type:
          $ref: '#/components/schemas/SubscriptionInvoiceType'
        attributes:
          $ref: '#/components/schemas/SubscriptionInvoiceAttributes'
        relationships:
          $ref: '#/components/schemas/Relationships'
        meta:
          $ref: '#/components/schemas/SubscriptionInvoiceMeta'
    Link:
      anyOf:
      - $ref: '#/components/schemas/LinkURI'
      - $ref: '#/components/schemas/LinkObject'
    SingleCurrencyPrice:
      description: A price in a single currency.
      required:
      - amount
      - currency
      properties:
        currency:
          type: string
          description: The three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in uppercase, associated with a price.
          example: USD
          maxLength: 1024
        amount:
          type: integer
          format: int64
          description: The value as a whole number of the currency's smallest subdivision.
          example: 100
        includes_tax:
          type: boolean
          description: Whether the amount includes any taxes.
          example: true
      example:
        currency: USD
        amount: 100
        includes_tax: false
    Relationship:
      anyOf:
      - $ref: '#/components/schemas/SingleRelationship'
      - $ref: '#/components/schemas/ManyRelationship'
    SubscriptionOfferingPlanType:
      type: string
      example: subscription_offering_plan
      enum:
      - subscription_offering_plan
    FeatureAttributes:
      required:
      - name
      - configuration
      properties:
        external_ref:
          $ref: '#/components/schemas/ExternalRef'
        name:
          type: string
          description: The name of the feature.
          minLength: 3
          maxLength: 1024
          example: Digital library access
        description:
          type: string
          description: The feature description to display to customers.
          maxLength: 1024
          example: Access to over 100 ebooks via the digital library.
        configuration:
          $ref: '#/components/schemas/FeatureConfiguration'
    ProrationEvent:
      required:
      - proration_policy_id
      - billing_cost_before_proration
      - refunded_amount_for_unused_pricing_option
      - new_pricing_option_cost
      - prorated_at
      properties:
        proration_policy_id:
          $ref: '#/components/schemas/UUID'
        billing_cost_before_proration:
          type: integer
          format: int64
          description: The value as a whole number of the currency's smallest subdivision
          example: 100
        refunded_amount_for_unused_pricing_option:
          type: integer
          format: int64
          description: The value as a whole number of the currency's smallest subdivision.
          example: 100
        new_pricing_option_cost:
          type: integer
          format: int64
          description: The value as a whole number of the currency's smallest subdivision.
          example: 100
        prorated_at:
          description: The date and time the subscription was prorated.
          type: st

# --- truncated at 32 KB (98 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elastic-path/refs/heads/main/openapi/elastic-path-subscriptions-api-openapi.yml