# Issue an upcoming invoice for early pay

`POST /subscriptions/{id}/upcoming-invoice/issue`

> This is a subset of the full specification, limited to the `POST /subscriptions/{id}/upcoming-invoice/issue` operation.
>
> You can find the full specification here: /_bundle/docs/dev-docs/api/index.yaml

```yaml
openapi: 3.1.1
info:
  version: latest
  title: Core APIs
  contact:
    name: Rebilly API Support
    url: https://www.rebilly.com/contact/
    email: integrations@rebilly.com
  license:
    name: Rebilly
    url: https://www.rebilly.com/api-license/
  termsOfService: https://www.rebilly.com/terms-of-use/
  x-logo:
    url: https://rebilly-core.redoc.ly/rb_apiLogo.svg
    backgroundColor: '#0044d4'
  description: This is a subset of the full specification, limited to the `POST /subscriptions/{id}/upcoming-invoice/issue` operation.
  x-metadata:
    description: The most common APIs used to automate common workflows.
    redocly_category: API Reference
servers:
  - url: https://api-sandbox.rebilly.com/organizations/{organizationId}
    description: Sandbox server
    variables:
      organizationId:
        default: '{organizationId}'
        description: |-
          Unique organization identifier.
          An organization is an entity that represents a company.
          For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
  - url: https://api.rebilly.com/organizations/{organizationId}
    description: Live server
    variables:
      organizationId:
        default: '{organizationId}'
        description: |-
          Unique organization identifier.
          An organization is an entity that represents a company.
          For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
security:
  - SecretApiKey: []
  - JWT: []
tags:
  - name: Orders (legacy)
    description: |-
      Use these operations to manage customer orders.

      This is the legacy order model.
      If you are new to Rebilly, use [these order operations](#tag/orders).
      Organizations that use the current order model cannot create legacy orders.
      For these organizations, the operations that create a legacy order return a validation error.

      For information on the legacy order model, and how to upgrade to the current order model, see [Legacy orders model](https://www.rebilly.com/docs/glossary#legacy-orders-model).

      An order is a customer's request to purchase items.
      It can contain subscription and one-time sale items.
      When an order contains one or more subscription items, it is a subscription order.

      An order generates an invoice.
      A subscription order generates an invoice for each service period.
      For more information, see [Orders](https://www.rebilly.com/docs/dev-docs/concepts/#orders).
x-tagGroups:
  - name: Orders & Invoices
    tags:
      - Orders (legacy)
paths:
  /subscriptions/{id}/upcoming-invoice/issue:
    parameters:
      - $ref: '#/components/parameters/resourceId'
    post:
      x-products:
        - Core
      tags:
        - Orders (legacy)
      summary: Issue an upcoming invoice for early pay
      operationId: PostSubscriptionUpcomingInvoiceIssuance
      x-sdk-operation-name: issueEarlyUpcomingInvoice
      description: Issues an upcoming invoice, for a subscription order with a specified ID, for early pay.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceIssue'
        description: InvoiceIssue resource.
        required: true
      responses:
        '201':
          description: Upcoming invoice issued.
          headers:
            Location:
              $ref: '#/components/headers/Location'
            Rate-Limit-Limit:
              $ref: '#/components/headers/Rate-Limit-Limit'
            Rate-Limit-Remaining:
              $ref: '#/components/headers/Rate-Limit-Remaining'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpcomingInvoice'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  securitySchemes:
    JWT:
      description: |-
        JWT is a short lifetime token that can be assigned a specific expiration time.

        Usage format: `Bearer <JWT>`.
      type: http
      scheme: bearer
      bearerFormat: JWT
    SecretApiKey:
      description: |-
        Never share your secret keys.
        Keep them guarded and secure.

        Use your secret API key only to make requests from the server side.
        To authenticate, provide your secret key in the request header.
      name: REB-APIKEY
      type: apiKey
      in: header
  parameters:
    resourceId:
      name: id
      in: path
      description: ID of the resource.
      required: true
      schema:
        type: string
        maxLength: 50
        pattern: ^[@~\-\.\w]+$
  headers:
    Location:
      description: Location of the related resource.
      schema:
        type: string
        format: uri
      example: https://api.rebilly.com/example
    Rate-Limit-Limit:
      description: |-
        Maximum number of requests available at one time for this rate limit.
        For more information, see [Rate limits](#section/Rate-limits).
      schema:
        type: integer
      example: 500
    Rate-Limit-Remaining:
      description: |-
        Number of requests still available for this rate limit.
        For more information, see [Rate limits](#section/Rate-limits).
      schema:
        type: integer
      example: 499
    Rate-Limit-Retry-After:
      description: Number of seconds to wait before retrying the request.
      schema:
        type: integer
      example: 1
  schemas:
    CreatedTime:
      type: string
      description: |-
        Date and time when the resource is created.
        This value is set automatically when the resource is created.
      format: date-time
      readOnly: true
      x-sortable: true
      x-label: Creation Time
    UpdatedTime:
      type: string
      description: |-
        Date and time when the resource is updated.
        This value is set automatically when the resource is updated.
      format: date-time
      readOnly: true
      x-sortable: true
      x-label: Last Update Time
    ResourceId:
      type: string
      description: Unique resource ID.
      maxLength: 50
      example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
    BaseProblem:
      type: object
      additionalProperties: true
      minProperties: 1
      description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object.
      properties:
        type:
          type: string
          description: |-
            Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
            It should provide human-readable documentation for the problem type.
            When this member is not present, its value is assumed to be "about:blank".
          format: uri
        title:
          type: string
          description: |-
            Short, human-readable summary of the problem type.
            Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
        detail:
          type: string
          description: Human-readable explanation that is specific to this occurrence of the problem.
        instance:
          type: string
          description: |-
            URI reference that identifies the specific occurrence of the problem.
            It may or may not yield further information if dereferenced.
    Unauthorized:
      allOf:
        - title: Unauthorized
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 401
              maximum: 401
        - $ref: '#/components/schemas/BaseProblem'
    OrganizationId:
      type: string
      description: |-
        Unique organization identifier.
        An organization is an entity that represents a company.
        For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
      maxLength: 50
      example: org_0YVDM8RC7GDADADSBSMW124JA8
    Forbidden:
      allOf:
        - title: Forbidden
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 403
              maximum: 403
            error:
              type: string
              description: |-
                Message that describes why the request is forbidden.
                Most responses use a descriptive message, such as `Not allowed to change security settings`.
                If the organization requires multi-factor authentication (MFA) and MFA verification has not been completed for the session, this value is `mfa_required`.
                If MFA verification has not been completed for the session and the operation requires a confirmed session, this value is `mfa_required_for_caller`.
                This includes turning on `requireMfa` and resetting MFA for a user.
                If the organization restricts access to a list of IP addresses and the request comes from an IP address that is not in the list, this value is `ip_not_allowed`.
            organizationId:
              description: |-
                ID of the organization that requires MFA or does not allow the IP address of the request.
                This property is present only if `error` is `mfa_required` or `ip_not_allowed`.
                The organization is the organization of the request or another organization that the request acts on.
              $ref: '#/components/schemas/OrganizationId'
        - $ref: '#/components/schemas/BaseProblem'
    NotFound:
      allOf:
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 404
              maximum: 404
        - $ref: '#/components/schemas/BaseProblem'
    TooManyRequests:
      type: object
      additionalProperties: true
      minProperties: 1
      description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object.
      properties:
        type:
          type: string
          description: |-
            Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
            It should provide human-readable documentation for the problem type.
            When this member is not present, its value is assumed to be "about:blank".
          format: uri
          example: about:blank
        title:
          type: string
          description: |-
            Short, human-readable summary of the problem type.
            Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
          example: Rate Limit Exceeded
        status:
          type: integer
          description: HTTP status code.
          minimum: 429
          maximum: 429
        detail:
          type: string
          description: Human-readable explanation that is specific to this occurrence of the problem.
          example: A request cannot be executed because the user has sent too many requests within a certain period of time
        instance:
          type: string
          description: |-
            URI reference that identifies the specific occurrence of the problem.
            It may or may not yield further information if dereferenced.
    Conflict:
      allOf:
        - title: Conflict
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 409
              maximum: 409
        - $ref: '#/components/schemas/BaseProblem'
    CustomerId:
      type: string
      description: ID of the customer resource.
      maxLength: 50
      example: cus_0YV7DDSDD1C8DA64KHH2W33CPF
      x-basic: true
    CurrencyCode:
      type: string
      description: Currency code in ISO 4217 format.
      minLength: 3
      maxLength: 3
      example: USD
      x-label: Currency
    DiscountContext:
      type: string
      description: Context in which the discount applies.
      default: items
      x-label: Context
      x-sortable: true
      x-basic: true
      x-enumDescriptions:
        items: items (less discounts)
        shipping: shipping (less discounts)
        items-and-shipping: items and shipping (less discounts)
      enum:
        - items
        - shipping
        - items-and-shipping
    WebsiteId:
      type: string
      description: |-
        ID of the website.
        A website is where an organization obtains a customer.
        For more information, see [Obtain an organization ID and website ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
      maxLength: 50
      example: web_0YV7DE4Z26DQSA1AC92FBJ7SEG
    ContactPhoneNumbers:
      description: List of phone numbers associated with the contact.
      type: array
      items:
        type: object
        required:
          - label
          - value
        properties:
          label:
            description: Phone number label or name.
            type: string
            maxLength: 45
            example: main
          value:
            description: Phone number value.
            type: string
            minLength: 1
            maxLength: 50
            example: 1-512-777-0269
          primary:
            description: Specifies if the phone number is the contact's primary phone number.
            type: boolean
            example: true
    ContactEmails:
      description: List of email addresses associated with the contact.
      type: array
      items:
        type: object
        required:
          - label
          - value
        properties:
          label:
            description: Email label or name.
            type: string
            maxLength: 45
            example: main
          value:
            description: Email address value.
            type: string
            format: email
            maxLength: 255
            example: rebilly@example.com
          primary:
            description: Specifies if the email address is the contact's primary email address.
            type: boolean
            example: true
    ContactObject:
      type: object
      description: Contact's information.
      properties:
        firstName:
          description: Contact's first name.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 45
          example: Benjamin
        lastName:
          description: Contact's last name.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 45
          example: Franklin
        organization:
          description: Contact's organization.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 255
          example: Rebilly
        address:
          description: First line of the contact's street address.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 60
          example: 36 Craven St
        address2:
          description: Second line of the contact's street address.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 60
        city:
          description: Contact's city of residence.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 45
          example: Austin
        region:
          description: Contact's region of residence.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 45
          example: Texas
        country:
          description: |-
            Contact's country of residence in ISO 3166 alpha-2 country code.
            For examples, see [ISO.org](https://www.iso.org/obp/ui/#search/code/).
          type:
            - string
            - 'null'
          pattern: ^[A-Z]{2}$
          maxLength: 2
          example: GB
        postalCode:
          description: Contact's postal code.
          type:
            - string
            - 'null'
          pattern: ^[\w\s\-]+$
          maxLength: 10
          example: WC2N 5NF
        phoneNumbers:
          $ref: '#/components/schemas/ContactPhoneNumbers'
        emails:
          $ref: '#/components/schemas/ContactEmails'
        dob:
          description: Contact's date of birth in ISO-8601 `YYYY-MM-DD` format.
          type:
            - string
            - 'null'
          format: date
          example: '1980-04-01'
        jobTitle:
          description: Contact's job title.
          type:
            - string
            - 'null'
          pattern: ^[\u0000-\uFFFF]+$
          maxLength: 255
          example: CEO
        hash:
          description: |-
            Hash value for the contact.
            Use this value to compare contacts for identical attribute values.
          type: string
          maxLength: 40
          example: 056ae6d97c788b9e98b049ebafd7b229bf852221
          readOnly: true
    ServerTimestamp:
      type: string
      description: Read-only timestamp in ISO 8601 date-time format.
      format: date-time
      readOnly: true
    ManualShipping:
      description: Manually set shipping amount.
      type: object
      required:
        - amount
        - calculator
      properties:
        amount:
          x-type: Money
          type: number
          format: double
          description: Shipping amount.
        calculator:
          description: Shipping calculator.
          type: string
          enum:
            - manual
    RebillyShipping:
      description: Rebilly-based shipping which is calculated by shipping rates.
      type: object
      required:
        - calculator
      properties:
        calculator:
          description: Shipping calculator.
          type: string
          enum:
            - rebilly
        rateId:
          description: |-
            ID of the shipping rate.
            If this value is not set,
            the cheapest applicable shipping rate is used.
          type:
            - string
            - 'null'
          maxLength: 50
          example: shipping-123-456
        amount:
          type: number
          format: double
          readOnly: true
          description: Shipping amount which is calculated from [Shipping rates](https://www.rebilly.com/catalog/all/shipping-rates).
    Shipping:
      description: Shipping settings.
      type: object
      discriminator:
        propertyName: calculator
        mapping:
          manual: '#/components/schemas/ManualShipping'
          rebilly: '#/components/schemas/RebillyShipping'
      oneOf:
        - $ref: '#/components/schemas/ManualShipping'
        - $ref: '#/components/schemas/RebillyShipping'
    TaxItem:
      type: object
      required:
        - amount
        - description
      properties:
        amount:
          description: Amount of the tax.
          type: number
          format: double
        description:
          type: string
          description: Description of the tax.
        rate:
          description: Overall sales tax rate which includes state, county, city and district tax.
          type:
            - number
            - 'null'
          format: double
          readOnly: true
        stateAmount:
          description: Amount of sales tax to collect for the state.
          type:
            - number
            - 'null'
          format: double
          example: 0.94
          readOnly: true
        countyAmount:
          description: Amount of sales tax to collect for the county.
          type:
            - number
            - 'null'
          format: double
          example: 0.04
          readOnly: true
        cityAmount:
          description: Amount of sales tax to collect for the city.
          type:
            - number
            - 'null'
          format: double
          example: 0
          readOnly: true
        specialDistrictAmount:
          description: Amount of sales tax to collect for the special district.
          type:
            - number
            - 'null'
          format: double
          example: 0.38
          readOnly: true
        stateRate:
          description: State sales tax rate for given location.
          type:
            - number
            - 'null'
          format: double
          readOnly: true
        countyRate:
          description: County sales tax rate for given location.
          type:
            - number
            - 'null'
          format: double
          readOnly: true
        cityRate:
          description: City sales tax rate for given location.
          type:
            - number
            - 'null'
          format: double
          readOnly: true
        specialDistrictRate:
          description: Special district sales tax rate for given location.
          type:
            - number
            - 'null'
          format: double
          readOnly: true
        jurisdictions:
          description: Jurisdiction names for the invoice.
          type:
            - object
            - 'null'
          readOnly: true
          properties:
            country:
              description: Two-letter ISO country code for the provided location.
              type:
                - string
                - 'null'
              example: US
              readOnly: true
            state:
              description: Postal abbreviated state name for the provided location.
              type:
                - string
                - 'null'
              example: CA
              readOnly: true
            county:
              description: County name for the provided location.
              type:
                - string
                - 'null'
              example: LOS ANGELES
              readOnly: true
            city:
              description: City name for the provided location.
              type:
                - string
                - 'null'
              example: LOS ANGELES
              readOnly: true
    ManualTax:
      type: object
      description: Manual tax calculator.
      required:
        - calculator
        - items
      properties:
        calculator:
          description: Type of tax calculator.
          type: string
          enum:
            - manual
        amount:
          type: number
          format: double
          x-type: Money
          x-sortable: true
          description: Total amount of taxes.
          readOnly: true
        items:
          type: array
          description: Taxes applied.
          items:
            $ref: '#/components/schemas/TaxItem'
    RebillyTaxJarTax:
      type: object
      description: TaxJar tax calculator.
      required:
        - calculator
      properties:
        calculator:
          description: Type of tax calculator.
          type: string
          enum:
            - rebilly-taxjar
        amount:
          type: number
          format: double
          x-type: Money
          x-sortable: true
          description: Total amount of taxes.
          readOnly: true
        items:
          type: array
          description: Taxes applied and calculated based on the `taxCategoryId` of the related product.
          items:
            $ref: '#/components/schemas/TaxItem'
    RebillyAvalaraTax:
      type: object
      description: Avalara tax calculator.
      required:
        - calculator
      properties:
        calculator:
          description: Type of tax calculator.
          type: string
          enum:
            - rebilly-avalara
        amount:
          type: number
          format: double
          x-type: Money
          x-sortable: true
          description: Total amount of taxes.
          readOnly: true
        items:
          type: array
          description: Taxes applied and calculated based on the `taxCategoryId` of the related product.
          items:
            $ref: '#/components/schemas/TaxItem'
    Taxes:
      description: Taxes.
      type: object
      discriminator:
        propertyName: calculator
        mapping:
          manual: '#/components/schemas/ManualTax'
          rebilly-taxjar: '#/components/schemas/RebillyTaxJarTax'
          rebilly-avalara: '#/components/schemas/RebillyAvalaraTax'
      oneOf:
        - $ref: '#/components/schemas/ManualTax'
        - $ref: '#/components/schemas/RebillyTaxJarTax'
        - $ref: '#/components/schemas/RebillyAvalaraTax'
    InvoiceIssue:
      type: object
      properties:
        issuedTime:
          description: |-
            Date and time when the invoice is issued.
            If this field is `null` or omitted, the invoice is issued immediately.
          type:
            - string
            - 'null'
          format: date-time
        dueTime:
          description: |-
            Date and time when the invoice is due for payment.
            If this field is `null` or omitted, this value is set to the `issuedTime` value.
          type:
            - string
            - 'null'
          format: date-time
    UpcomingInvoiceItem:
      type: object
      readOnly: true
      properties:
        id:
          type: string
          description: ID of the upcoming invoice item.
          maxLength: 50
          example: ii_0YVFDEQS2KCFTBN9HXWJFY55GV
        isInterim:
          description: Specifies if the line item is added to an interim invoice.
          type: boolean
        description:
          description: Description of the upcoming invoice item.
          type: string
          maxLength: 1000
        unitPrice:
          description: Unit price of the upcoming invoice item.
          type: number
          format: double
        quantity:
          description: Quantity of the upcoming invoice item.
          type: integer
        price:
          description: Total price of the upcoming invoice item.
          type: number
          format: double
        productId:
          type:
            - string
            - 'null'
          description: ID of the product.
          maxLength: 50
          example: prod_0YV7DES3WPC5J8JD8QTVNZBZNZ
        planId:
          type:
            - string
            - 'null'
          description: ID of the plan.
          maxLength: 50
          example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X
        subscriptionId:
          type: string
          description: ID of the order.
          maxLength: 50
          example: sub_01HRF27SATGE4Z6PBJE6PD8328
        periodStartTime:
          description: Date and time when the billing period starts.
          type: string
          format: date-time
        periodEndTime:
          description: Date and time when the billing period ends.
          type: string
          format: date-time
        periodNumber:
          description: |-
            Billing period number that is associated with the invoice item.
            For example, an invoice item for a service is included in billing period number 3.
            The invoice item is only applied to billing period number 3.
          type: integer
        createdTime:
          $ref: '#/components/schemas/CreatedTime'
        updatedTime:
          $ref: '#/components/schemas/UpdatedTime'
        tax:
          description: Invoice item tax.
          $ref: '#/components/schemas/TaxItem'
        _links:
          type: array
          description: Related links.
          items:
            type: object
            properties:
              href:
                description: Link URL.
                type: string
              rel:
                description: Type of link.
                type: string
                enum:
                  - self
                  - product
                  - plan
                  - subscription
        _embedded:
          type: object
          description: Embedded objects that are requested by the `expand` query parameter.
          properties:
            product:
              type: object
            plan:
              type: object
    UpcomingInvoice:
      type: object
      readOnly: true
      properties:
        id:
          description: ID of the upcoming invoice, which is persisted in the future renewal invoice.
          type: string
          readOnly: true
          maxLength: 50
          example: in_0YVF9605RKC62BP14NE2R7V2XT
        websiteId:
          $ref: '#/components/schemas/WebsiteId'
        subscriptionId:
          description: ID of the related subscription order.
          type: string
          readOnly: true
          maxLength: 50
          example: sub_01HRF27SATGE4Z6PBJE6PD8328
        currency:
          x-sortable: true
          x-basic: true
          $ref: '#/components/schemas/CurrencyCode'
        customerId:
          x-basic: true
          allOf:
            - $ref: '#/components/schemas/CustomerId'
        revision:
          description: |-
            Number of times the upcoming invoice data has changed.

            Use the revision number when analyzing webhook data to
            determine if a change should take precedence over the current
            representation.
          type: integer
        organizationId:
          allOf:
            - $ref: '#/components/schemas/OrganizationId'
        items:
          type: array
          description: Upcoming invoice items array.
          items:
            $ref: '#/components/schemas/UpcomingInvoiceItem'
        amount:
          description: Amount of the invoice.
          type: number
          x-type: Money
          x-sortable: true
          x-basic: true
          format: double
          readOnly: true
        amountDue:
          description: Amount that is due on the invoice.
          type: number
          x-type: Money
          x-sortable: true
          format: double
          readOnly: true
        subtotalAmount:
          description: Subtotal amount of the invoice.
          type: number
          x-type: Money
          format: double
          readOnly: true
        discountAmount:
          description: Discount amount that is applied to the invoice.
          type: number
          x-type: Money
          format: double
          readOnly: true
        shipping:
          $ref: '#/components/schemas/Shipping'
        tax:
          $ref: '#/components/schemas/Taxes'
        billingAddress:
          description: Billing address of the invoice.
          $ref: '#/components/schemas/ContactObject'
        deliveryAddress:
          description: Delivery address of the invoice.
          $ref: '#/components/schemas/ContactObject'
        poNumber:
          description: Purchase order number that is displayed on the invoice.
          type:
            - string
            - 'null'
          example: PO123456
        notes:
          description: Notes for the customer that are displayed on the invoice.
          type: string
        discounts:
          type: array
          description: Discounts applied.
          readOnly: true
          items:
            type: object
            readOnly: true
            properties:
              couponId:
                type: string
                description: ID of the coupon.
                maxLength: 50
                example: cpn_0YVCNKF81GD778N4YNVGDJK558
              redemptionId:
                description: ID of the redemption.
                $ref: '#/components/schemas/ResourceId'
              amount:
                description: Total amount discounted by this coupon.
                type: number
                format: double
              description:
                type: string
                description: Description of the discount.
              context:
                $ref: '#/components/schemas/DiscountContext'
        isNewOrder:
          description: Specifies if the order is a new order.
          type: boolean
          readOnly: true
          example: true
        dueTime:
          description: Date and time when the invoice is due for payment.
          type: string
          x-sortable: true
          format: date-time
        issuedTime:
          description: Date and time when the invoice is issued.
          x-label: Date Issued
          x-sortable: true
          x-basic: true
          $ref: '#/components/schemas/ServerTimestamp'
        createdTime:
          $ref: '#/components/schemas/CreatedTime'
        updatedTime:
          $ref: '#/components/schemas/UpdatedTime'
        _links:
          type: array
          description: Related links.
          items:
            type: object
            properties:
              href:
                description: Link URL.
                type: string
              rel:
                description: Type of link.
                type: string
                enum:
                  - self
                  - website
                  - customer
                  - organization
                  - subscription
                  - attachments
                  - leadSource
        _embedded:
          type: object
          description: Embedded objects that are requested by the `expand` query parameter.
          properties:
            customer:
              type: object
            website:
              type: object
            organization:
              type: object
            leadSource:
              type: object
  responses:
    Unauthorized:
      description: |-
        Unauthorized access.
        Invalid credentials used.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
    Forbidden:
      description: |-
        Access forbidden.
        If the organization requires multi-factor authentication (MFA) and the session has not passed MFA, `error` is `mfa_required`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Forbidden'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFound'
    TooManyRequests:
      description: Request rate limit exceeded.
      headers:
        Rate-Limit-Limit:
          $ref: '#/components/headers/Rate-Limit-Limit'
        Rate-Limit-Remaining:
          description: |-
            Number of requests still available for this rate limit.
            For more information, see [Rate limits](#section/Rate-limits).
          schema:
            type: integer
          example: 0
        Rate-Limit-Retry-After:
          $ref: '#/components/headers/Rate-Limit-Retry-After'
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          schema:
            type: integer
          example: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TooManyRequests'
    Conflict:
      description: Conflict.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Conflict'
```
