> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bango.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund

> Execute a refund.



## OpenAPI

````yaml /openapi/current/dvm/dvm-to-reseller/charge/openapi.json post /refunds
openapi: 3.1.0
info:
  title: DVM to Reseller - Charge API
  summary: Current / DVM / DVM to Reseller / Charge
  description: |

    # Overview

    API endpoints that need to be implemented by a reseller to:

    * approve or decline a charge
    * approve or decline a refunds
  version: 1.0.0
servers: []
security: []
tags:
  - name: Charge and refund
    description: Charge and refund API exposed by the reseller
paths:
  /refunds:
    post:
      tags:
        - Charge and refund
      summary: Refund
      description: Execute a refund.
      operationId: refund
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConsumerOfferRefund'
            examples:
              Consumer offer refund on downgrade:
                value:
                  requestId: e574a229-bb2c-42b3-b144-69f64d9a73da
                  billEffectiveDate: '2026-03-15T14:27:33.000Z'
                  billType: PRO_RATED_REFUND
                  billId: ca11419d-8143-43f2-af5d-0259b85a2fca
                  originalChargeId: c699aa49-35ea-4a23-9c3e-4479413db91d
                  originalPartnerChargeId: 3c2f7004-d464-4191-863a-32cb5108c935
                  refundId: d56442de-ca64-411f-8585-830291b3d6cf
                  refundAttempt: 0
                  isRetry: false
                  amount: 900
                  currency: USD
                  consumer:
                    consumerIdentifier: RFBNZ2MU3Y35OA5GNNNGETK6JTEVRYVB
                    billingIdentifier: BWNMJXEDAO7HTK6Q4SBAOEJMPGURUB3K
                  resourceType: CONSUMER_OFFER
                  consumerOffer:
                    consumerOfferId: 338d31e1-a289-40dd-beff-ab41c1fc5f51
                    offerId: 7560fca0-d8a9-4124-a172-924debec874e
                    entitlements:
                      - entitlementId: b0163d06-1fa3-4c9b-a298-29635ca7151d
                        contentProviderId: NETFLIX
                        productId: 0d83e344-62b3-44a8-adb5-59b835ef6cf7
                        productTierKey: NETFLIX_STD_ADS
                  billingDetails:
                    planType: SUBSCRIPTION
                    billingPeriod:
                      phaseType: FULL_PRICE
                      duration: P1M
                      renewalFrequency: P1M
                      startDate: '2026-03-01T01:00:00.000Z'
                      endDate: '2026-04-01T00:59:59.999Z'
                  lineItems:
                    - lineItemType: OFFER_TIER_CHANGE_PRORATION
                      quantity: 1
                      amount: 900
                      currency: USD
                      entitlementId: b0163d06-1fa3-4c9b-a298-29635ca7151d
              Consumer offer refund on cancellation:
                value:
                  requestId: f9effa1d-43a5-4ea4-bba0-f4343a5f9692
                  billEffectiveDate: '2026-04-15T14:27:33.000Z'
                  billType: PRO_RATED_REFUND
                  billId: 69869eb7-729e-4ada-9657-2d0d9fb6e844
                  originalChargeId: 32dfaaeb-a5ef-4379-a634-3503320f2c81
                  originalPartnerChargeId: cf5680d9-755e-4883-9877-de63b5b48f55
                  refundId: 113824b8-af0e-4fd9-b8ff-d63fd0c224e8
                  refundAttempt: 0
                  isRetry: false
                  amount: 450
                  currency: USD
                  consumer:
                    consumerIdentifier: RFBNZ2MU3Y35OA5GNNNGETK6JTEVRYVB
                    billingIdentifier: BWNMJXEDAO7HTK6Q4SBAOEJMPGURUB3K
                  resourceType: CONSUMER_OFFER
                  consumerOffer:
                    consumerOfferId: 338d31e1-a289-40dd-beff-ab41c1fc5f51
                    offerId: 7560fca0-d8a9-4124-a172-924debec874e
                    entitlements:
                      - entitlementId: b0163d06-1fa3-4c9b-a298-29635ca7151d
                        contentProviderId: NETFLIX
                        productId: 0d83e344-62b3-44a8-adb5-59b835ef6cf7
                        productTierKey: NETFLIX_STD_ADS
                  billingDetails:
                    planType: SUBSCRIPTION
                    billingPeriod:
                      phaseType: FULL_PRICE
                      duration: P1M
                      renewalFrequency: P1M
                      startDate: '2026-04-01T01:00:00.000Z'
                      endDate: '2026-05-01T00:59:59.999Z'
                  lineItems:
                    - lineItemType: OFFER_CANCELLATION_PRORATION
                      quantity: 1
                      amount: 450
                      currency: USD
                      consumerOfferId: 338d31e1-a289-40dd-beff-ab41c1fc5f51
              Consumer offer full refund on «right of withdrawal» cancellation:
                value:
                  requestId: 56045e04-fd10-4e60-8016-35ad6a9ccee1
                  billEffectiveDate: '2026-04-15T14:27:33.000Z'
                  billType: FULL_REFUND
                  billId: 3500325e-3f5f-4c78-ad93-dd125fbda5c0
                  originalChargeId: 32dfaaeb-a5ef-4379-a634-3503320f2c81
                  originalPartnerChargeId: cf5680d9-755e-4883-9877-de63b5b48f55
                  refundId: 113824b8-af0e-4fd9-b8ff-d63fd0c224e8
                  refundAttempt: 0
                  isRetry: false
                  amount: 899
                  currency: USD
                  consumer:
                    consumerIdentifier: RFBNZ2MU3Y35OA5GNNNGETK6JTEVRYVB
                    billingIdentifier: BWNMJXEDAO7HTK6Q4SBAOEJMPGURUB3K
                  resourceType: CONSUMER_OFFER
                  consumerOffer:
                    consumerOfferId: 338d31e1-a289-40dd-beff-ab41c1fc5f51
                    offerId: 7560fca0-d8a9-4124-a172-924debec874e
                    entitlements:
                      - entitlementId: b0163d06-1fa3-4c9b-a298-29635ca7151d
                        contentProviderId: NETFLIX
                        productId: 0d83e344-62b3-44a8-adb5-59b835ef6cf7
                        productTierKey: NETFLIX_STD_ADS
                  billingDetails:
                    planType: SUBSCRIPTION
                    billingPeriod:
                      phaseType: FULL_PRICE
                      duration: P1M
                      renewalFrequency: P1M
                      startDate: '2026-04-01T01:00:00.000Z'
                      endDate: '2026-05-01T00:59:59.999Z'
                  lineItems:
                    - lineItemType: OFFER_CANCELLATION_WITHDRAWAL_PERIOD
                      quantity: 1
                      amount: 899
                      currency: USD
                      consumerOfferId: 338d31e1-a289-40dd-beff-ab41c1fc5f51
              Consumer offer partial refund on «right of withdrawal» cancellation:
                value:
                  requestId: 72165638-e930-4d0a-a170-5dd7f0a3adfc
                  billEffectiveDate: '2026-04-15T14:27:33.000Z'
                  billType: PRO_RATED_REFUND
                  billId: 3500325e-3f5f-4c78-ad93-dd125fbda5c0
                  originalChargeId: 32dfaaeb-a5ef-4379-a634-3503320f2c81
                  originalPartnerChargeId: cf5680d9-755e-4883-9877-de63b5b48f55
                  refundId: 2f41d6ff-d69c-4745-a072-c9039ffd043c
                  refundAttempt: 0
                  isRetry: false
                  amount: 450
                  currency: USD
                  consumer:
                    consumerIdentifier: RFBNZ2MU3Y35OA5GNNNGETK6JTEVRYVB
                    billingIdentifier: BWNMJXEDAO7HTK6Q4SBAOEJMPGURUB3K
                  resourceType: CONSUMER_OFFER
                  consumerOffer:
                    consumerOfferId: 338d31e1-a289-40dd-beff-ab41c1fc5f51
                    offerId: 7560fca0-d8a9-4124-a172-924debec874e
                    entitlements:
                      - entitlementId: b0163d06-1fa3-4c9b-a298-29635ca7151d
                        contentProviderId: NETFLIX
                        productId: 0d83e344-62b3-44a8-adb5-59b835ef6cf7
                        productTierKey: NETFLIX_STD_ADS
                  billingDetails:
                    planType: SUBSCRIPTION
                    billingPeriod:
                      phaseType: FULL_PRICE
                      duration: P1M
                      renewalFrequency: P1M
                      startDate: '2026-04-01T01:00:00.000Z'
                      endDate: '2026-05-01T00:59:59.999Z'
                  lineItems:
                    - lineItemType: OFFER_CANCELLATION_WITHDRAWAL_PERIOD
                      quantity: 1
                      amount: 450
                      currency: USD
                      consumerOfferId: 338d31e1-a289-40dd-beff-ab41c1fc5f51
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/RefundApprovedResponse'
                  - $ref: '#/components/schemas/RefundDeclinedResponse'
                title: Response 200 Refund
                description: Refund Synchronous Response.
                discriminator:
                  propertyName: responseCode
                  mapping:
                    APPROVED:
                      $ref: '#/components/schemas/RefundApprovedResponse'
                    DECLINED:
                      $ref: '#/components/schemas/RefundDeclinedResponse'
              examples:
                Approved:
                  value:
                    requestId: f8e7d6c5-b4a3-4c2b-8d1e-9f0a1b2c3dff
                    responseCode: APPROVED
                    partnerRefundId: 585a95dd-b9d2-4d7b-b696-5ef001ee2d36
                Declined:
                  value:
                    requestId: f8e7d6c5-b4a3-4c2b-8d1e-9f0a1b2c3dff
                    responseCode: DECLINED
                    partnerRefundId: 585a95dd-b9d2-4d7b-b696-5ef001ee2d36
                    reason: REFUND_PERIOD_EXPIRED
                    reasonDescription: Refund period expired
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundAsyncResponse'
              examples:
                Accepted for asynchronous processing:
                  value:
                    requestId: f8e7d6c5-b4a3-4c2b-8d1e-9f0a1b2c3dff
                    partnerRefundId: 585a95dd-b9d2-4d7b-b696-5ef001ee2d36
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
              examples:
                Invalid JSON:
                  value:
                    errors:
                      - code: invalid-json
                        message: Invalid JSON
                        originator: PARTNER
                        metadata: {}
                Missing parameter:
                  value:
                    errors:
                      - code: missing-parameter
                        message: Missing parameter
                        originator: PARTNER
                        metadata:
                          missingParam: checkoutId
                Invalid parameter:
                  value:
                    errors:
                      - code: invalid-parameter
                        message: Invalid parameter
                        originator: PARTNER
                        metadata:
                          invalidParam: checkoutParameters.checkoutCallbackUrl
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
              examples:
                Unauthorized:
                  value:
                    errors:
                      - code: invalid-credentials
                        message: Invalid credentials
                        originator: PARTNER
                        metadata: {}
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
              examples:
                Forbidden:
                  value:
                    errors:
                      - code: permission-denied
                        message: Permission denied
                        originator: PARTNER
                        metadata: {}
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
              examples:
                Not found:
                  value:
                    errors:
                      - code: not-found
                        message: Not found
                        originator: PARTNER
                        metadata: {}
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResponse'
              examples:
                Conflict:
                  value:
                    errors:
                      - code: conflict
                        message: Conflict
                        originator: PARTNER
                        metadata: {}
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
              examples:
                Too Many Requests:
                  value:
                    errors:
                      - code: too-many-requests
                        message: Too many requests
                        originator: PARTNER
                        metadata: {}
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalErrorResponse'
              examples:
                Internal error:
                  value:
                    errors:
                      - code: internal-server-error
                        message: Internal server error
                        originator: PARTNER
                        metadata: {}
                Partner failure:
                  value:
                    errors:
                      - code: partner-failure
                        message: Partner failure
                        originator: PARTNER
                        metadata: {}
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureNotImplementedResponse'
              examples:
                Not Implemented:
                  value:
                    errors:
                      - code: not-implemented
                        message: Not implemented
                        originator: PARTNER
                        metadata: {}
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnvavailableResponse'
              examples:
                Service Unavailable:
                  value:
                    errors:
                      - code: service-unavailable
                        message: Service unavailable
                        metadata: {}
                        originator: PARTNER
      security:
        - APIKeyHeader: []
        - HTTPBasic: []
        - OAuth2PasswordBearer: []
components:
  schemas:
    ConsumerOfferRefund:
      properties:
        externalRecurringChargeId:
          type: string
          title: External Recurring Charge ID
          description: >-
            Partner-generated identifier of the authorization for recurring
            charges.
        requestId:
          type: string
          title: Request ID
          description: >-
            Bango-generated Request ID (UUID v4). Should be returned in the API
            response.This allows correalating individual requests and responses.
        billEffectiveDate:
          type: string
          title: Bill Effective Date
          description: Date the bill was generated for.
        billType:
          $ref: '#/components/schemas/ConsumerOfferRefundBillType'
          title: Bill Type
          description: >
            Bill type


            * `PRO_RATED_REFUND`: the amount of the refund is lower than the
            amount of the original charge.

            * `FULL_REFUND`: the amount of the refund equals the amount of the
            original charge.
        billId:
          type: string
          title: Bill ID
          description: >-
            Bango-generated unique bill identifier (UUID v4).If the initial
            charge fails, all subsequent retries will have the same billId.
        amount:
          type: integer
          title: Amount
          description: Charge amount, in minor units
        currency:
          type: string
          title: Currency
          description: Currency code (ISO 4217)
        resourceType:
          type: string
          const: CONSUMER_OFFER
          title: Refund Resource Type
          description: Type of resource that is being refunded.
        consumer:
          anyOf:
            - $ref: '#/components/schemas/ConsumerWithBillingIdentifier'
            - $ref: '#/components/schemas/ConsumerWithPhoneNumber'
          title: Consumer
          description: Consumer information
        originalChargeId:
          type: string
          title: Original Charge ID
          description: >-
            Bango-generated unique identifier of the charge transaction (UUID
            v4) that is being refunded. 
          examples:
            - c699aa49-35ea-4a23-9c3e-4479413db91d
        originalPartnerChargeId:
          type: string
          title: Originalpartnerchargeid
          description: >-
            Reseller generated unique identifier of the charge that is being
            refunded.
        refundId:
          type: string
          title: Refund ID
          description: >-
            Bango-generated unique identifier of the refund transaction (UUID
            v4). There could be more than one partial refund per charge. 
          examples:
            - d56442de-ca64-411f-8585-830291b3d6cf
        refundAttempt:
          type: integer
          title: Refund Attempt
          description: >-
            Refund attempt. 0 if it's the first attempt, 1 for the first
            retry...
          examples:
            - 0
        isRetry:
          type: boolean
          title: Is Retry
          description: Whether this is a retry of a charge
          examples:
            - false
        consumerOffer:
          $ref: '#/components/schemas/ConsumerOfferSummary'
          title: Consumer Offer
          description: Consumer offer details
        billingDetails:
          $ref: '#/components/schemas/ConsumerOfferBillingDetail'
          title: Billing Details
          description: Billing details
        lineItems:
          items:
            oneOf:
              - $ref: '#/components/schemas/LineItemForCancellationProration'
              - $ref: '#/components/schemas/LineItemForWithdrawalCancellation'
              - $ref: '#/components/schemas/LineItemForTierChangeProration'
            discriminator:
              propertyName: lineItemType
              mapping:
                OFFER_CANCELLATION_PRORATION:
                  $ref: '#/components/schemas/LineItemForCancellationProration'
                OFFER_CANCELLATION_WITHDRAWAL_PERIOD:
                  $ref: '#/components/schemas/LineItemForWithdrawalCancellation'
                OFFER_TIER_CHANGE_PRORATION:
                  $ref: '#/components/schemas/LineItemForTierChangeProration'
          type: array
          title: Line Items
          description: List of line items
      type: object
      required:
        - requestId
        - billEffectiveDate
        - billType
        - billId
        - amount
        - currency
        - resourceType
        - consumer
        - originalChargeId
        - refundId
        - refundAttempt
        - isRetry
        - consumerOffer
        - billingDetails
        - lineItems
      title: ConsumerOfferRefund
      description: Execute a refund for a consumer offer bill.
    RefundApprovedResponse:
      properties:
        requestId:
          type: string
          title: Request ID
          description: >-
            Bango-generated Request ID (UUID v4). Should be returned in the API
            response.This allows correalating individual requests and responses.
        responseCode:
          type: string
          const: APPROVED
          title: Response Code
          description: Result of the operation
        partnerRefundId:
          type: string
          title: Partnerrefundid
          description: Unique identifier of the refund operation, generated by reseller.
      type: object
      required:
        - requestId
        - responseCode
      title: RefundApprovedResponse
      description: Refund approved response.
    RefundDeclinedResponse:
      properties:
        requestId:
          type: string
          title: Request ID
          description: >-
            Bango-generated Request ID (UUID v4). Should be returned in the API
            response.This allows correalating individual requests and responses.
        responseCode:
          type: string
          const: DECLINED
          title: Response Code
          description: Result of the operation
        reason:
          $ref: '#/components/schemas/RefundDeclineReason'
          title: Decline Reason
          description: >
            Decline reason


            * `DENIED`: The refund was declined. This is a general denial that
            doesn't fall into a more specific category. We recommend using a
            more specific reason. Bango will not retry the refund.

            * `USER_INVALID`: The user identifier provided is not recognized or
            corresponds to a deactivated account. This may occur if the user's
            account has been closed or the identifier is incorrect. Bango will
            not retry the refund.

            * `REFUND_PERIOD_EXPIRED`: The refund cannot be executed because it
            was requested after the allowed deadline. Bango will not retry the
            refund.

            * `ALREADY_IN_PROGRESS`: A charge with the same `refundId` is
            already being processed. This prevents duplicate refunds and
            indicates Bango should wait for the current operation to complete
            before retrying.
          examples:
            - REFUND_PERIOD_EXPIRED
        reasonDescription:
          type: string
          title: Decline Reason Description
          description: >-
            In case responseCode is DECLINED, human-readable reason for
            declining.
          examples:
            - Refund period expired
        partnerRefundId:
          type: string
          title: Partnerrefundid
          description: Unique identifier of the refund operation, generated by reseller.
      type: object
      required:
        - requestId
        - responseCode
      title: RefundDeclinedResponse
      description: Refund declined response.
    RefundAsyncResponse:
      properties:
        requestId:
          type: string
          title: Request ID
          description: >-
            Bango-generated Request ID (UUID v4). Should be returned in the API
            response.This allows correalating individual requests and responses.
        partnerRefundId:
          type: string
          title: Partnerrefundid
          description: Unique identifier of the refund operation, generated by reseller.
      type: object
      required:
        - requestId
      title: RefundAsyncResponse
      description: Refund accepted for asynchronous processing.
    BadRequestResponse:
      properties:
        errors:
          items:
            anyOf:
              - $ref: '#/components/schemas/InvalidJsonError'
              - $ref: '#/components/schemas/MissingParameterError'
              - $ref: '#/components/schemas/InvalidParameterError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: BadRequestResponse
      description: Invalid json error response.
    UnauthorizedResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/UnauthorizedError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: UnauthorizedResponse
      description: Payment unauthorized response.
    ForbiddenResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ForbiddenError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: ForbiddenResponse
      description: Payment forbidden response.
    NotFoundResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/NotFoundError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: NotFoundResponse
      description: Not found response.
    ConflictResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ConflictError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: ConflictResponse
      description: Conflict response.
    TooManyRequestsResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/TooManyRequestsError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: TooManyRequestsResponse
      description: Rate limited response.
    InternalErrorResponse:
      properties:
        errors:
          items:
            anyOf:
              - $ref: '#/components/schemas/InternalError'
              - $ref: '#/components/schemas/PartnerError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: InternalErrorResponse
      description: Internal error response.
    FeatureNotImplementedResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/FeatureNotImplementedError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: FeatureNotImplementedResponse
      description: Not implemented response.
    ServiceUnvavailableResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ServiceUnavailableError'
          type: array
          title: Errors
          description: List of errors
      type: object
      required:
        - errors
      title: ServiceUnvavailableResponse
      description: Service unavailable response.
    ConsumerOfferRefundBillType:
      type: string
      enum:
        - PRO_RATED_REFUND
        - FULL_REFUND
      title: ConsumerOfferRefundBillType
      description: Types of bills.
    ConsumerWithBillingIdentifier:
      properties:
        consumerIdentifier:
          type: string
          maxLength: 400
          title: Consumer Identifier
          description: Consumer identifier
        billingIdentifier:
          type: string
          title: Billing Identifier
          description: Billing identifier
      type: object
      required:
        - consumerIdentifier
      title: ConsumerWithBillingIdentifier
      description: Consumer with billing identifier.
    ConsumerWithPhoneNumber:
      properties:
        consumerIdentifier:
          type: string
          maxLength: 400
          title: Consumer Identifier
          description: Consumer identifier
        phoneNumber:
          type: string
          title: Phone Number
          description: Phone number
      type: object
      required:
        - consumerIdentifier
      title: ConsumerWithPhoneNumber
      description: Consumer with phone number.
    ConsumerOfferSummary:
      properties:
        consumerOfferId:
          type: string
          title: Consumer Offer ID
          description: A globally unique and immutable identifier of the Consumer Offer
          examples:
            - 338d31e1-a289-40dd-beff-ab41c1fc5f51
        offerId:
          type: string
          title: Offer ID
          description: >-
            A globally unique and immutable identifier of the offer the consumer
            has subcribed to.
          examples:
            - 7560fca0-d8a9-4124-a172-924debec874e
        entitlements:
          items:
            $ref: '#/components/schemas/Entitlement'
          type: array
          title: Entitlement list
          description: Entitlements created under this consumer offer.
      type: object
      required:
        - consumerOfferId
        - offerId
      title: ConsumerOfferSummary
      description: Consumer Offer.
    ConsumerOfferBillingDetail:
      properties:
        planType:
          $ref: '#/components/schemas/PlanType'
          title: Plan Type
          description: |-
            Plan type:

            * `SUBSCRIPTION`: Recurring subscription plan
            * `FIXED_TERM`: Fixed-term plan
            * `TRANSACTION`: One-time transaction
            * `REDEMPTION`: Redemption-based plan
          examples:
            - SUBSCRIPTION
        billingPeriod:
          $ref: '#/components/schemas/BillingPeriod'
          title: Billing Period
          description: Billing period information
      type: object
      required:
        - planType
        - billingPeriod
      title: ConsumerOfferBillingDetail
      description: Billing information.
    LineItemForCancellationProration:
      properties:
        lineItemType:
          type: string
          const: OFFER_CANCELLATION_PRORATION
          title: Line Item Type
          description: >-
            Pro-ration caused by the immediate cancellation ofof the
            entitlements in the consumer offer
        quantity:
          type: integer
          title: Quantity
          description: Number of units charged.
          examples:
            - 1
        amount:
          type: integer
          title: Amount
          description: Charge amount, in minor units
          examples:
            - 1699
        currency:
          type: string
          title: Currency
          description: Currency code (ISO 4217)
          examples:
            - USD
        consumerOfferId:
          type: string
          title: Consumer Offer ID
          description: A globally unique and immutable identifier of the Consumer Offer
      type: object
      required:
        - lineItemType
        - quantity
        - amount
        - currency
        - consumerOfferId
      title: LineItemForCancellationProration
      description: Line item details - pro-ration caused by an entitlement tier change.
    LineItemForWithdrawalCancellation:
      properties:
        lineItemType:
          type: string
          const: OFFER_CANCELLATION_WITHDRAWAL_PERIOD
          title: Line Item Type
          description: >-
            Refund being executed because the customer exercised his right of
            withdrawal
        quantity:
          type: integer
          title: Quantity
          description: Number of units charged.
          examples:
            - 1
        amount:
          type: integer
          title: Amount
          description: Charge amount, in minor units
          examples:
            - 1699
        currency:
          type: string
          title: Currency
          description: Currency code (ISO 4217)
          examples:
            - USD
        consumerOfferId:
          type: string
          title: Consumer Offer ID
          description: A globally unique and immutable identifier of the Consumer Offer
      type: object
      required:
        - lineItemType
        - quantity
        - amount
        - currency
        - consumerOfferId
      title: LineItemForWithdrawalCancellation
      description: Line item details - pro-ration caused by an entitlement tier change.
    LineItemForTierChangeProration:
      properties:
        lineItemType:
          type: string
          const: OFFER_TIER_CHANGE_PRORATION
          title: Line Item Type
          description: >-
            Pro-ration caused by a tier change in one of the entitlements in the
            consumer offer
        quantity:
          type: integer
          title: Quantity
          description: Number of units charged.
          examples:
            - 1
        amount:
          type: integer
          title: Amount
          description: Charge amount, in minor units
          examples:
            - 1699
        currency:
          type: string
          title: Currency
          description: Currency code (ISO 4217)
          examples:
            - USD
        entitlementId:
          type: string
          title: Entitlement ID
          description: A globally unique and immutable identifier of the entitlement.
      type: object
      required:
        - lineItemType
        - quantity
        - amount
        - currency
        - entitlementId
      title: LineItemForTierChangeProration
      description: Line item details - pro-ration caused by an entitlement tier change.
    RefundDeclineReason:
      type: string
      enum:
        - DENIED
        - USER_INVALID
        - REFUND_PERIOD_EXPIRED
        - ALREADY_IN_PROGRESS
      title: RefundDeclineReason
      description: Decline reason.
    InvalidJsonError:
      properties:
        code:
          type: string
          const: invalid-json
          title: Code
          description: The request body is not valid JSON
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: InvalidJsonError
      description: Invalid json error.
    MissingParameterError:
      properties:
        code:
          type: string
          const: missing-parameter
          title: Code
          description: A required parameter is missing from the request
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: MissingParameterError
      description: Invalid json error.
    InvalidParameterError:
      properties:
        code:
          type: string
          const: invalid-parameter
          title: Code
          description: A request parameter is invalid
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: InvalidParameterError
      description: Invalid json error.
    UnauthorizedError:
      properties:
        code:
          type: string
          const: invalid-credentials
          title: Code
          description: Invalid credentials
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: UnauthorizedError
      description: Not authorized error.
    ForbiddenError:
      properties:
        code:
          type: string
          const: permission-denied
          title: Code
          description: Permission denied
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: ForbiddenError
      description: Forbidden error.
    NotFoundError:
      properties:
        code:
          type: string
          const: not-found
          title: Code
          description: The target consumer or consumer no longer exists
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: NotFoundError
      description: Not found error.
    ConflictError:
      properties:
        code:
          type: string
          const: conflict
          title: Code
          description: The request conflicts with the current status of the target entity
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: ConflictError
      description: Conflict error.
    TooManyRequestsError:
      properties:
        code:
          type: string
          const: too-many-requests
          title: Code
          description: Too many requests
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: TooManyRequestsError
      description: Rate limited error.
    InternalError:
      properties:
        code:
          type: string
          const: internal-server-error
          title: Code
          description: Internal Server Error
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: InternalError
      description: Internal error.
    PartnerError:
      properties:
        code:
          type: string
          const: partner-failure
          title: Code
          description: Partner failure
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: PartnerError
      description: Partner failure.
    FeatureNotImplementedError:
      properties:
        code:
          type: string
          const: not-implemented
          title: Code
          description: Not Implemented
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: FeatureNotImplementedError
      description: Not implemented error.
    ServiceUnavailableError:
      properties:
        code:
          type: string
          const: service-unavailable
          title: Code
          description: Service Unavailable
        message:
          type: string
          title: Message
          description: Human-readable message describing the error
        originator:
          type: string
          title: Originator
          description: Additional information to help identify the error origin.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: Additional information to help identify the specific error case.
      type: object
      required:
        - code
        - message
      title: ServiceUnavailableError
      description: Internal error.
    Entitlement:
      properties:
        entitlementId:
          type: string
          title: Entitlement ID
          description: A globally unique and immutable identifier of the entitlement.
        contentProviderId:
          type: string
          title: Content Provider ID
          description: >-
            A globally unique, immutable, human readable identifier of the
            content provider that delivers the product.
        productId:
          type: string
          format: uuid
          title: Product ID
          description: >-
            A globally unique, immutable, identifier of the product the user is
            entitled to.
        productTierKey:
          type: string
          title: Product Tier ID
          description: >-
            A unique, immutable identifier of the product tier the user is
            entitled to.
      type: object
      required:
        - entitlementId
        - contentProviderId
        - productId
        - productTierKey
      title: Entitlement
      description: Entitlement to a specific product within a Consumer Offer.
    PlanType:
      type: string
      enum:
        - SUBSCRIPTION
        - FIXED_TERM
        - TRANSACTION
        - REDEMPTION
      title: PlanType
      description: Types of billing plans.
    BillingPeriod:
      properties:
        phaseType:
          $ref: '#/components/schemas/PhaseType'
          title: Phase Type
          description: |-
            Phase type:

            * `FREE`: Free trial or promotional period
            * `DISCOUNT`: Discounted pricing period
            * `FULL_PRICE`: Full price period
          examples:
            - FULL_PRICE
        duration:
          type: string
          title: Duration
          description: Duration in ISO 8601 format
          examples:
            - P1M
        renewalFrequency:
          type: string
          title: Renewal Frequency
          description: >-
            The frequency at which the consumer is billed during this phase e.g.
            P1M (monthly), P1Y (yearly).

            If the consumer is not billed during this phase, set this value to
            be the same as the phase's duration.
        startDate:
          type: string
          title: Start Date
          description: Start date
          examples:
            - '2026-01-01T01:00:00.000Z'
        endDate:
          type: string
          title: End Date
          description: End date
          examples:
            - '2026-02-01T00:59:59.999Z'
      type: object
      required:
        - phaseType
        - duration
        - renewalFrequency
        - startDate
        - endDate
      title: BillingPeriod
      description: Billing period details.
    PhaseType:
      type: string
      enum:
        - FREE
        - DISCOUNT
        - FULL_PRICE
      title: PhaseType
      description: Types of billing phases.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    HTTPBasic:
      type: http
      scheme: basic
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /token

````