Elastic Path Invoices API

Invoices represent the amount a customer owes for a subscription. Elastic Path Subscriptions generates an invoice for every period in a subscription billing cycle. Invoices provide: - an itemized list of goods and services provided by a subscription. - the cost of a subscription. - if applicable, any taxes. The invoice lifecycle is described below. 1. When a subscription is created, an invoice for the first billing period is created. When a subscription is created as part of an order, the payment for the order covers the first billing period. 2. Subscription invoices are created by [**billing runs**](/docs/api/subscriptions/jobs). The billing run identifies subscriptions that require a new invoice for their next billing period and creates them. At this point, invoices are marked as outstanding. 3. Invoices where `tax_required` is `true` will not have payment taken until a tax run has added the required tax to the invoice. 3. The [**payment run**](/docs/api/subscriptions/jobs) identifies invoices that are still outstanding and attempts to take payment for them. If the payment succeeds the the invoice is no longer outstanding. If the payment fails for any reason, then the invoice remains outstanding and is picked up by the next payment run to retry the payment. If an invoice has a failed payment, payment is only retried if the fixed interval has passed from the last payment attempt as defined in Settings. ### Payment Retries It is important to limit the number of times Subscriptions retries a failed payment request for many reasons, including: frequent payment retries can indicate fraudulent activities; multiple failed payment attempts can lead to customers accounts being locked out or flagged for suspicious activity resulting in poor customer experience; and excessive retries places an unnecessary load on your payment processing system. In Subscriptions, by default, the number of payment retries is 10. You can set this to a limit between 0 - 20, depending on your requirements. Each payment retry is made as a payment run. Once the number of payment retries reaches the limit, the payment retries stop, resulting in status of the invoice being unpaid. See [Invoices](#invoices). When configuring payment retries, you have the following options. | Attribute | Required | Description | | --- | --- | --- | | `payment_retry_type` | Optional | One of the following options: `fixed` - use `fixed` if you want a fixed time interval between payment retries.`backoff` - use `backoff` if you want the time between retry attempts to increase exponentially.`tiered` - use `tiered` if you want to specify a list of time durations. | | `payment_retry_interval` | Optional | Represents the retry interval. For example, if `payment_retry_unit` is `week` and `payment_retry_interval` is `1` then, the payment retry interval is 1 week. | | `payment_retry_multiplier` | Optional | Use when `payment_retry_type` is `tiered` and represents the factor by which the time duration increases after each retry. | | `payment_retry_unit` | Optional | Represents the unit of time, either `day` or `week`. | ### Rounding Subscriptions always rounds down to the penny. ### Tax Subscriptions allows you to apply any number of tax rates to your invoices and subscriptions. When applying a tax rate, you must specify: - a name that appears on your customer's invoice that describes the specific type of tax. - the tax rate which is the percentage of the subscription amount that is required to be paid as tax. In addition, you can optionally specify the jurisdiction which is the geographic area or political entity that has authority to levey and collect taxes. You can apply more than one tax rate for all items in an invoice. You cannot apply a tax rate per line item. ### Payments When your customers add a subscription to a cart and the cart is checked out, an unpaid order is returned. You can process the payment for the order though a payment gateway. You can do this using: - Elastic Path Payments Powered by Stripe. The Elastic Path Payments Powered by Stripe gateway interacts with Stripe to allow your subscribers to pay for their subscriptions. - Authorize.Net. #### Using Elastic Path Payments Powered by Stripe To use Elastic Path Payments Powered by Stripe gateway, contact the [**Customer Success Team**](mailto:customersuccess@elasticpath.com). Create your Stripe account in [**Stripe Dashboard**](https://dashboard.stripe.com/login) and complete an onboarding form to make payments using the gateway. For more information, see [**Onboarding**](/docs/payments/onboarding). Once you have signed up for Elastic Path Payments Powered by Stripe, you must configure the payment gateway so that your shoppers can make payments. See [**Configure Elastic Path Payments Powered by Stripe**](/docs/payments/onboarding). #### Using Authorize.Net To use Authorize.Net, you must have: - an active merchant account with Authorize.Net - obtained API credentials. These include an **API Login ID** and a **Transaction Key**. - Enabled Authorize.Net in Commerce Manager. See [Enabling Authorize.net](/docs/commerce-manager/payments/configure-other-payment-gateways#enabling-authorizenet). #### Payment Requests Subscriptions only supports the `purchase` payment mechanism. The gateway attempts to charge the customer immediately, and the result of the attempt is returned. If a payment fails, the invoice is kept as outstanding and the payment information, with the reason for the failure is attached to the invoice. A new payment run is required to attempt another payment. When sending a payment request to the Payments service, you must specify the following. | Attribute | Required | Description | | --- | --- | --- | | `gateway` | Required| One of `elastic_path_payments_stripe`, `authorize_net` and `stripe_payment_intents`. | | `method` | Required | Must be `purchase`. | `payment` | Required | The type of payment, for example, `pm_card_visa_debit`. | `options` | Required | These options must be set as they set up the card to be used in future without the customer being present. If these options are not set, future payments may fail. There are two options. `off_session`. Must be set to `true`. `confirm`. Must be set to `true`. | #### External Payments External payments are payment methods not offered by Elastic Path Subscriptions (such as Elastic Path Payments powered by Stripe or Authorize.net), but they can still be integrated with Subscriptions. To do this, you must configure your subscriptions to use external payments by setting `manual_payments` to `true`. See [Create a Subscription](/docs/api/subscriptions/create-subscription). When a subscription is created with `manual_payments` set to `true`: 1. When the payment run processes the generated invoice, it creates a pending payment. A `subscription-invoice-created` event is emitted that includes the `subscription_id`, `invoice_id` and `payment_id`. No payment is taken. 2. You can use the events generated by Elastic Path Subscriptions to configure your external payment system to respond to these events, ensuring that your external payment system knows when the payment schedule has run and it's time to process the payment. 3. When the external payment system handles the payment (either takes the payment successfully or the payment fails) the [Update Invoice Payment](/docs/api/subscriptions/update-invoice-payment) endpoint, enables the update of the pending payment. - If payment is successful, the invoice is updated to `paid` and the billing/payment cycle continues as normal. - If payment fails, the invoice continues to be marked as `outstanding`. The payment is not `pending` anymore. This is because a payment attempt has been made. Following on from this, the next payment run generates another manual pending payment. The external system is notified of this using the `subscription-invoice-payment-updated`. #### Card Declines Card payments can fail for a variety of reasons, including insufficient funds, incorrect card data or fraudulent activity. 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, enabling you to easily manage your subscription changes.

OpenAPI Specification

elastic-path-invoices-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 Invoices 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: Invoices
  description: "Invoices represent the amount a customer owes for a subscription. Elastic Path Subscriptions generates an invoice for every period in a subscription billing cycle. Invoices provide:\n\n- an itemized list of goods and services provided by a subscription.\n- the cost of a subscription.\n- if applicable, any taxes.\n\nThe invoice lifecycle is described below.\n\n1. When a subscription is created, an invoice for the first billing period is created. When a subscription is created as part of an order, the payment for the order covers the first billing period.\n2. Subscription invoices are created by [**billing runs**](/docs/api/subscriptions/jobs). The billing run identifies subscriptions that require a new invoice for their next billing period and creates them. At this point, invoices are marked as outstanding.\n3. Invoices where `tax_required` is `true` will not have payment taken until a tax run has added the required tax to the invoice.  \n3. The [**payment run**](/docs/api/subscriptions/jobs) identifies invoices that are still outstanding and attempts to take payment for them. If the payment succeeds the the invoice is no longer outstanding. If the payment fails for any reason, then the invoice remains outstanding and is picked up by the next payment run to retry the payment. If an invoice has a failed payment, payment is only retried if the fixed interval has passed from the last payment attempt as defined in Settings.\n\n### Payment Retries\n\nIt is important to limit the number of times Subscriptions retries a failed payment request for many reasons, including: frequent payment retries can indicate fraudulent activities; multiple failed payment attempts can lead to customers accounts being locked out or flagged for suspicious activity resulting in poor customer experience; and excessive retries places an unnecessary load on your payment processing system.\n\nIn Subscriptions, by default, the number of payment retries is 10. You can set this to a limit between 0 - 20, depending on your requirements. Each payment retry is made as a payment run. \n\nOnce the number of payment retries reaches the limit, the payment retries stop, resulting in status of the invoice being unpaid. See [Invoices](#invoices).\n\nWhen configuring payment retries, you have the following options.\n\n| Attribute | Required | Description |\n| --- | --- | --- |\n| `payment_retry_type` | Optional | One of the following options: <ul><li>`fixed` - use `fixed` if you want a fixed time interval between payment retries.</li><li>`backoff` - use `backoff` if you want the time between retry attempts to increase exponentially.</li><li>`tiered` - use `tiered` if you want to specify a list of time durations.</li></ul>  |\n| `payment_retry_interval` | Optional | Represents the retry interval. For example, if `payment_retry_unit` is `week` and `payment_retry_interval` is `1` then, the payment retry interval is 1 week.  |\n| `payment_retry_multiplier` | Optional | Use when `payment_retry_type` is `tiered` and represents the factor by which the time duration increases after each retry.   |\n| `payment_retry_unit` | Optional | Represents the unit of time, either `day` or `week`. |\n\n### Rounding\n\nSubscriptions always rounds down to the penny. \n\n### Tax\n\nSubscriptions allows you to apply any number of tax rates to your invoices and subscriptions. When applying a tax rate, you must specify:\n\n- a name that appears on your customer's invoice that describes the specific type of tax.\n- the tax rate which is the percentage of the subscription amount that is required to be paid as tax.\n\nIn addition, you can optionally specify the jurisdiction which is the geographic area or political entity that has authority to levey and collect taxes.\n\nYou can apply more than one tax rate for all items in an invoice. You cannot apply a tax rate per line item.\n\n### Payments\n\nWhen your customers add a subscription to a cart and the cart is checked out, an unpaid order is returned. You can process the payment for the order though a payment gateway. You can do this using:\n\n- Elastic Path Payments Powered by Stripe. The Elastic Path Payments Powered by Stripe gateway interacts with Stripe to allow your subscribers to pay for their subscriptions. \n- Authorize.Net. \n\n#### Using Elastic Path Payments Powered by Stripe\n\nTo use Elastic Path Payments Powered by Stripe gateway, contact the [**Customer Success Team**](mailto:customersuccess@elasticpath.com). \n\nCreate your Stripe account in [**Stripe Dashboard**](https://dashboard.stripe.com/login) and complete an onboarding form to make payments using the gateway. For more information, see [**Onboarding**](/docs/payments/onboarding).\n\nOnce you have signed up for Elastic Path Payments Powered by Stripe, you must configure the payment gateway so that your shoppers can make payments. See [**Configure Elastic Path Payments Powered by Stripe**](/docs/payments/onboarding).\n\n#### Using Authorize.Net\n\nTo use Authorize.Net, you must have: \n\n- an active merchant account with Authorize.Net\n- obtained API credentials. These include an **API Login ID** and a **Transaction Key**.\n- Enabled Authorize.Net in Commerce Manager. See [Enabling Authorize.net](/docs/commerce-manager/payments/configure-other-payment-gateways#enabling-authorizenet).\n\n#### Payment Requests\n\nSubscriptions only supports the `purchase` payment mechanism. The gateway attempts to charge the customer immediately, and the result of the attempt is returned. If a payment fails, the invoice is kept as outstanding and the payment information, with the reason for the failure is attached to the invoice. A new payment run is required to attempt another payment. \n\nWhen sending a payment request to the Payments service, you must specify the following.\n\n| Attribute | Required | Description |\n| --- | --- | --- |\n| `gateway` | Required| One of `elastic_path_payments_stripe`, `authorize_net` and `stripe_payment_intents`. |\n| `method` | Required | Must be `purchase`.\n| `payment` | Required | The type of payment, for example, `pm_card_visa_debit`.\n| `options` | Required | These options must be set as they set up the card to be used in future without the customer being present. If these options are not set, future payments may fail. There are two options. <ul><li>`off_session`. Must be set to `true`. </li><li>`confirm`. Must be set to `true`.</li></ul> |\n\n#### External Payments\n\nExternal payments are payment methods not offered by Elastic Path Subscriptions (such as Elastic Path Payments powered by Stripe or Authorize.net), but they can still be integrated with Subscriptions. To do this, you must configure your subscriptions to use external payments by setting `manual_payments` to `true`. See [Create a Subscription](/docs/api/subscriptions/create-subscription).\n\nWhen a subscription is created with `manual_payments` set to `true`:\n\n1. When the payment run processes the generated invoice, it creates a pending payment. A `subscription-invoice-created` event is emitted that includes the `subscription_id`, `invoice_id` and `payment_id`. No payment is taken. \n2. You can use the events generated by Elastic Path Subscriptions to configure your external payment system to respond to these events, ensuring that your external payment system knows when the payment schedule has run and it's time to process the payment.\n3. When the external payment system handles the payment (either takes the payment successfully or the payment fails) the [Update Invoice Payment](/docs/api/subscriptions/update-invoice-payment) endpoint, enables the update of the pending payment. \n    - If payment is successful, the invoice is updated to `paid` and the billing/payment cycle continues as normal.\n    - If payment fails, the invoice continues to be marked as `outstanding`. The payment is not `pending` anymore. This is because a payment attempt has been made. Following on from this, the next payment run generates another manual pending payment. The external system is notified of this using the `subscription-invoice-payment-updated`.\n\n#### Card Declines\n\nCard payments can fail for a variety of reasons, including insufficient funds, incorrect card data or fraudulent activity. 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, enabling you to easily manage your subscription changes.\n"
paths:
  /v2/subscriptions/invoices:
    get:
      tags:
      - Invoices
      summary: List invoices
      description: "Retrieves a list of all invoices.\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` | `subscriber_id`, `subscription_id`, `outstanding`, `tax_required` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. |\n| `in` | `subscriber_id`, `subscription_id` | In. Checks if the value is in the specified list. If it is, the condition is true. |\n"
      parameters:
      - $ref: '#/components/parameters/Filter'
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      operationId: ListInvoices
      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'
        '400':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/invoices/{invoice_uuid}:
    parameters:
    - name: invoice_uuid
      in: path
      description: The unique identifier of the invoice.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Invoices
      summary: Get invoice
      operationId: GetInvoice
      responses:
        '200':
          description: Success. The details of the invoice are returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SubscriptionInvoice'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/invoices/{invoice_uuid}/payments:
    parameters:
    - name: invoice_uuid
      in: path
      description: The unique identifier of the invoice.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      tags:
      - Invoices
      summary: List invoice payments
      parameters:
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      operationId: ListInvoicePayments
      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/invoices/{invoice_uuid}/payments/{payment_uuid}:
    parameters:
    - 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:
      - Invoices
      summary: Get invoice payment
      operationId: GetInvoicePayment
      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'
    put:
      tags:
      - Invoices
      summary: Update Invoice Payment
      description: 'External payment methods are payment methods not offered by Elastic Path Subscriptions (such as Elastic Path Payments powered by Stripe or Authorize.net), but they can still be integrated with Subscriptions. You can use the `Update Invoice Payment` endpoint to manually update a payment against an invoice where an external payment method is handling the payment of your invoices. See [External Payments](/docs/api/subscriptions/invoices#external-payments).

        '
      operationId: UpdateInvoicePayment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  $ref: '#/components/schemas/UpdateInvoicePayment'
      responses:
        '200':
          description: Success. Invoice payment has been updated.
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/SubscriptionInvoicePayment'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/WriteConflictError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/invoices/{invoice_uuid}/payments/{payment_uuid}/refunds:
    parameters:
    - 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'
    post:
      operationId: CreateInvoicePaymentRefund
      summary: Create a refund for an invoice payment
      description: Creates a refund for a paid invoice.
      tags:
      - Invoices
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  $ref: '#/components/schemas/CreateInvoicePaymentRefund'
      responses:
        '201':
          description: Success. The payment refund is completed.
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/SubscriptionInvoicePaymentRefund'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      parameters:
      - $ref: '#/components/parameters/PageOffset'
      - $ref: '#/components/parameters/PageLimit'
      operationId: ListInvoicePaymentRefunds
      summary: List invoice payment refunds
      description: List all refunds for an invoice payments
      tags:
      - Invoices
      responses:
        '200':
          description: Success. Refunds for an invoice payment are returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionInvoicePaymentRefund'
                  links:
                    $ref: '#/components/schemas/Links'
        '400':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/subscriptions/invoices/{invoice_uuid}/payments/{payment_uuid}/refunds/{refund_uuid}:
    parameters:
    - 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'
    - name: refund_uuid
      in: path
      description: The unique identifier of the refund.
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
    get:
      operationId: GetInvoicePaymentRefund
      summary: Get a refund for an invoice payment
      description: Get a refund for a paid invoice.
      tags:
      - Invoices
      responses:
        '200':
          description: Success. Specific refund for the invoice payment is returned
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/SubscriptionInvoicePaymentRefund'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    PageOffset:
      name: page[offset]
      description: 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](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
      in: query
      required: false
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 10000
        example: 10
    Filter:
      name: filter
      in: query
      required: false
      schema:
        type: string
        format: string
        description: 'Some Subscriptions API endpoints support filtering. For the general syntax, see [**Filtering**](/guides/Getting-Started/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports.

          '
        example: eq(name,Alan Turing)
    PageLimit:
      name: page[limit]
      description: 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](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used.
      in: query
      required: false
      schema:
        type: integer
        format: int64
        minimum: 0
        example: 100
  schemas:
    TaxItem:
      required:
      - type
      - rate
      properties:
        type:
          description: This represents the type of resource object being returned. Always `tax_item`.
          type: string
          enum:
          - tax_item
          example: tax_item
        name:
          description: The name that appears on your customer's invoice and usually describes the specific type of tax, for example, `Sales`, `VAT` or `GST`.
          type: string
          maxLength: 1024
          example: GST
        code:
          description: The unique identifier assigned to goods and services for taxation purposes.
          type: string
          maxLength: 1024
          example: 20.0 % S
        rate:
          description: The tax rate is the percentage of the subscription amount that is required to be paid as tax.
          type: number
          format: double
          example: 0.2
        jurisdiction:
          description: The geographic area or political entity that has authority to levy and collect taxes.
          type: string
          maxLength: 1024
          example: USA
    PriceFormatting:
      required:
      - amount
      - currency
      - formatted
      properties:
        amount:
          type: integer
          format: int64
          example: 100
          description: The unformatted amount for the objects.
        currency:
          type: string
          format: string
          example: USD
          description: The three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in uppercase, associated with a price.
        formatted:
          type: string
          format: string
          example: $1.00
          description: The formatted amount for the objects.
    ManyRelationship:
      description: The list of resources that are related.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/RelationshipData'
        links:
          $ref: '#/components/schemas/RelationshipLinks'
    SubscriptionInvoicePaymentRefundType:
      type: string
      description: This represents the type of resource object being returned. Always `subscription_invoice_payment_refund`.
      example: subscription_invoice_payment_refund
      enum:
      - subscription_invoice_payment_refund
    SubscriptionInvoicePaymentMeta:
      readOnly: true
      required:
      - owner
      - timestamps
      - invoice_id
      - subscription_id
      - job_id
      - manual_payment
      properties:
        owner:
          $ref: '#/components/schemas/OwnerMeta'
        subscription_id:
          $ref: '#/components/schemas/UUID'
        invoice_id:
          $ref: '#/components/schemas/UUID'
        job_id:
          $ref: '#/components/schemas/UUID'
        timestamps:
          $ref: '#/components/schemas/InvoicePaymentTimestamps'
        manual_payment:
          type: boolean
          example: false
          description: Whether manual payments are enabled or the payment will be handled by the configured gateway.
    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'
    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'
    Error:
      required:
      - status
      - title
      properties:
        status:
          type: string
          description: The HTTP response code of the error.
          example: '500'
        title:
          type: string
          description: A brief summary of the error.
          example: Internal server error
        detail:
          type: string
          description: Optional additional detail about the error.
          example: An internal error has occurred.
        meta:
          type: object
          description: Additional supporting meta data for the error.
          example:
            missing_ids:
            - e7d50bd5-1833-43c0-9848-f9d325b08be8
    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
    ErrorResponse:
      required:
      - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    Links:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/Link'
    RelationshipLinks:
      description: "Links are used to allow you, as an API consumer, to move between requests. Single entities use a self parameter with a link to that specific resource. Sometimes, there aren’t enough entities for a project to fill multiple pages. In this situation, we return some defaults, instead of expecting you to check for these special cases. \n\n - current - Always the current page.\n - first - Always the first page.\n - last - always `null`.\n - next - `null` if the user is on the first page.\n - previous - `null` if there is only one page.\n"
      type: object
      properties:
        related:
          type: string
          example: foo.bar
    SubscriptionInvoicePaymentType:
      type: string
      description: This represents the type of resource object being returned. Always `subscription_invoice_payment`.
      example: subscription_invoice_payment
      enum:
      - subscription_invoice_payment
    Relationship:
      anyOf:
      - $ref: '#/components/schemas/SingleRelationship'
      - $ref: '#/components/schemas/ManyRelationship'
    LinkObject:
      type: object
      properties:
        href:
          type: string
          format: uri
          example: http://example.com/articles/1/comments
        title:
          type: string
          example: Comments
        describedby:
          type: string
          format: uri
          example: http://example.com/schemas/article-comments
    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: string
          example: '2017-01-10T11:41:19.244842Z'
    SubscriptionInvoiceItem:
      required:
      - description
      - price
      properties:
        description:
          type: string
          description: A description of the subscribed item.
          example: Magazine issue
        price:
          $ref: '#/components/schemas/SingleCurrencyPrice'
        plan_id:
          $ref: '#/components/schemas/UUID'
        from_time_period:
          description: The start date and time of the billing period in this price
          type: string
          example: '2017-01-10T11:41:19.244842Z'
        until_time_period:
          description: The end date and time of the billing period in this price
          type: string
          example: '2017-01-10T11:41:19.244842Z'
    SubscriptionInvoiceAttributes:
      required:
      - billing_period
      - pro_forma
      - invoice_items
      - outstanding
      - tax_required
      - payment_retries_limit_reached
      - manual_payment_pending
      properties:
        billing_period:
          $ref: '#/components/schemas/TimePeriod'
        invoice_items:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionInvoiceItem'
        tax_items:
          type: array
          items:
            $ref: '#/components/schemas/TaxItem'
        outstanding:
          type: boolean
          description: The invoice still requires payment if `true`.
          example: true
        number:
          type: integer
          description: A sequential number assigned by the billing run.
          example: 1
        tax_required:
          type: boolean
          description: Whether tax is required for this invoice.
          example: true
        payment_retries_limit_reached:
          type: boolean
          description: Whether the limit of payment retries has been reached.
          example: false
        updated_at:
          description: The date and time an invoice was updated.
          type: string
          example: '2017-01-10T11:41:19.244842Z'
        created_at:
          description: The date and time an invoice was created.
          type: string
          example: '2017-01-10T11:41:19.244842Z'
        pro_forma:
          description: 'Whether the invoice is a Pro Forma invoice (generated ahead of payment) or not.


            Pro Forma Invoices are created ahead of payment time (for example, a week in advance of payment so

            you can notify customers) and will not be picked up by a payment run until on or after their valid_from

            date.

            '
          type: boolean
          example: false
        valid_from:
          description: 'The date and time at which an invoice will be valid from.


            If generated with no lead time then the invoice will be valid immediately.


            If generated with a lead time, then the valid_from will be the data at which the Invoice transitions from

            it''s Pro Forma state to one that can have payment taken.

            '
          type: string
          example: '2017-01-10T11:41:19.244842Z'
        manual_payment_pending:
          type: boolean
          description: Whether there is a manual pending payment pending on the invoice.
          example: true
    RelationshipData:
      type: object
      required:
      - id
      - type
      properties:
        id:
          $ref: '#/components/schemas/UUID'
        type:
          type: string
          description: This represents the type of resource being returned.
          example: 11111111-2222-3333-4444-555555555555
    CreateInvoicePaymentRefund:
      required:
      - type
      - attributes
      properties:
        type:
   

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