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

# Attempt a payment on a PaymentIntent object

> This is the endpoint to use whenever you want to attempt a payment on a payment intent.
    It will create a payment object associated with the intent which will contains all the informations about the payment.
    Whenever a payment fails or don't have the appropriate amount to match the intent, other payments can be created on the same intent.



## OpenAPI

````yaml post /payment-intents/{id}/payments
openapi: 3.0.0
info:
  title: Hub2 Service · Api
  description: |-
    This is the Hub2 api reference |
          Please check https://docs.hub2.io/ for the full documentation |
          Rate limits of endpoints are here : https://docs.hub2.io/en/details/limits.html.
  version: 2.149.1
  contact:
    name: Hub2
    url: https://www.hub2.io/
    email: contact@hub2.io
servers: []
security: []
tags:
  - name: Payments
    description: >-
      Best known as the PAY-IN API, it provides endpoints for merchants to
      perform Hub2 PAY-IN transactions.
  - name: Transfers
    description: >-
      Best known as the PAY-OUT API, it provides endpoints for merchants to
      perform Hub2 PAY-OUT transactions.
  - name: IRT
    description: International Remittance Transfers
  - name: Balance
    description: ''
  - name: Webhooks
    description: ''
  - name: Provisioning
    description: ''
  - name: Payment on Terminal
    description: ''
  - name: Receipt
    description: ''
  - name: Sms
    description: ''
  - name: Data
    description: ''
  - name: Compliance
    description: ''
  - name: Recipient
    description: ''
  - name: Delegation
    description: ''
  - name: Deposits
    description: ''
  - name: Payment Links
    description: ''
  - name: Submerchants
    description: ''
paths:
  /payment-intents/{id}/payments:
    post:
      tags:
        - Payments
      summary: Attempt a payment on a PaymentIntent object
      description: >-
        This is the endpoint to use whenever you want to attempt a payment on a
        payment intent.
            It will create a payment object associated with the intent which will contains all the informations about the payment.
            Whenever a payment fails or don't have the appropriate amount to match the intent, other payments can be created on the same intent.
      operationId: PaymentIntentsController_pay
      parameters:
        - name: id
          required: true
          in: path
          description: >-
            Identifier of the PaymentIntent on which the Payment attempt is
            made.
          schema:
            type: string
        - name: ApiKey
          in: header
          description: >-
            Your api key. To create a key, please get into our dashboard. If you
            don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: MerchantId
          in: header
          description: >-
            Your merchant ID. This information is available in our dashboard. If
            you don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: Environment
          in: header
          description: >-
            Allow you to choose between the sandbox mode to perform some tests
            or the live mode for real world transactions.
          required: true
          schema:
            enum:
              - live
              - sandbox
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequestErrorAlias'
        '401':
          description: Wrong credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorizedErrorAlias'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiNotFoundErrorAlias'
        '409':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInvalidRequestErrorAlias'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnprocessableEntityErrorAlias'
        '429':
          description: 'ThrottlerException: Too Many Requests'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTooManyRequestErrorAlias'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInternalErrorAlias'
        '502':
          description: Invalid gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadGatewayErrorAlias'
components:
  schemas:
    PayDto:
      type: object
      properties:
        token:
          type: string
          description: >-
            The token which identify a payment intent. This is a field returned
            at payment intent creation.
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbnRlbnRJZCI6InBpXzBkeV9GZTJXQl8wNVVBdDdqMFloaSIsIm1lcmNoYW50SWQiOiIzIiwibW9kZSI6InNhbmRib3giLCJpYXQiOjE2OTUxMjY1MDJ9.8cpkja3PgSLFXiMW9BJN3ec5ndJFE2kIHvXvc834Wpo
        paymentMethod:
          type: string
          description: The method selected by the customer to make the payment.
          enum:
            - mobile_money
            - credit_card
            - bank_transfer
        country:
          type: string
          description: >-
            Two-letter [ISO country
            code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents
            the country where the selected provider is located.
          example: CI
        provider:
          type: string
          description: >-
            The name of the selected provider in lowercase. The list of
            supported providers can be found at
            [/data/providers](#operation/DataController_getProviders).
                If type is 'bank_transfer', provider will be optionnal and will be a bank name
        mobileMoney:
          title: MobileMoney
          allOf:
            - $ref: '#/components/schemas/PayMobileMoneyDto'
        creditCard:
          title: CreditCard
          allOf:
            - $ref: '#/components/schemas/PayCreditCardDto'
        bankTransfer:
          title: BankTransfer
          allOf:
            - $ref: '#/components/schemas/PayBankTransferDto'
        overrideBusinessId:
          type: string
          description: >-
            This field is mandatory for merchants that have the corresponding
            setting enabled, It allows to send a custom name
          example: e9bb247c-6e3f-4a39-a539-78e3bf115994
        paymentInformation:
          description: >-
            Optional hashed metadata about the payment beneficiary (compliance /
            fraud). All identifiers must be hashed or pseudonymized.
          allOf:
            - $ref: '#/components/schemas/PaymentInformationDto'
      required:
        - token
        - paymentMethod
        - country
    PaymentIntentDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the PaymentIntent
          example: pi_z1urYtVFgEebtcj8fxp4v
        merchantId:
          type: string
          description: Identifier of the merchant owning this PaymentIntent
        createdAt:
          type: string
          description: |-
            Datetime in UTC timezone at which this object was created.
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:09:49.355Z'
        updatedAt:
          type: string
          description: >-
            Datetime in UTC timezone at which this object was updated for the
            last time .
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:16:26.128Z'
        token:
          type: string
          description: >-
            A unique [JSON Web
            Token](https://en.wikipedia.org/wiki/JSON_Web_Token) allowing to
            attempt a Payment on the PaymentIntent on a client-side application.
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElkIjoiMTYiLCJtb2RlIjoic2FuZGJveCIsInBheW1lbnRJZCI6InBpX3oxdXJZdFZGZ0VlYnRjajhmeHA0diIsImlhdCI6MTYwMjc1OTE4M30.OZ0fDnMVWvcT-gRthyBD58PFC20gabGKt1UPRe4aNi4
        purchaseReference:
          type: string
          description: >-
            A reference provided by the client during the creation of this
            PaymentIntent
          example: ref_2020_11_10_001
        customerReference:
          type: string
          description: >-
            A reference provided by the client during the creation of this
            PaymentIntent. It is a reference to the customer for who this
            PaymentIntent was created.
          example: cust_01924059
        status:
          type: string
          description: The current status of this PaymentIntent
          example: successful
          enum:
            - action_required
            - canceled
            - failed
            - payment_required
            - processing
            - successful
        amount:
          type: number
          description: >-
            Amount intended to be collected by this PaymentIntent. A positive
            integer representing how much to charge in the smallest currency
            unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a
            zero-decimal currency).
          example: 100
        currency:
          type: string
          description: >-
            Three-letter [ISO currency
            code](https://www.iso.org/iso-4217-currency-codes.html).
          example: XOF
        payments:
          type: array
          description: List of Payment attempts made on this PaymentIntent
          title: Payment
          items:
            oneOf:
              - $ref: '#/components/schemas/PaymentCreditCardDto'
              - $ref: '#/components/schemas/PaymentMobileMoneyDto'
              - $ref: '#/components/schemas/PaymentBankTransferDto'
          discriminator:
            propertyName: method
            mapping:
              mobile_money:
                $ref: '#/components/schemas/PaymentMobileMoneyDto'
              credit_card:
                $ref: '#/components/schemas/PaymentCreditCardDto'
              bank_transfer:
                $ref: '#/components/schemas/PaymentMobileMoneyDto'
        mode:
          type: string
          description: |-
            Mode in which this PaymentIntent exists.
                The sandbox mode can be used during the integration phase and is available as soon as the merchant account is created. No real transactions are made in this mode.
                The live mode has to be used to make real transactions.
          example: live
          enum:
            - live
            - sandbox
        nextAction:
          description: >-
            Action required to execute to continue the processing of the current
            Payment on this PaymentIntent. The action allows the customer to
            validate the Payment.
                - A redirection action provides all the information to redirect the customer to an external page,
                - A ussd action provides a message to display to the user for the validation of the Payment. He will receive a USSD message on his phone describing how to make the validation,
                - A otp action requires that you display an input to the customer to collect an OTP. A message is provided to explains to the user how to get this OTP. Then, the client will have to send the authentication request.
                
          title: NextAction
          allOf:
            - $ref: '#/components/schemas/NextActionDto'
        lastPaymentFailure:
          description: >-
            In case of a Payment attempt failure, this object will describe the
            reason of the failure
          title: PaymentFailureCause
          allOf:
            - $ref: '#/components/schemas/PaymentFailureCauseDto'
        overrideBusinessName:
          type: string
          description: For Aggregator, name of the  merchant
          example: MyBusiness
        subMerchantId:
          type: string
          description: Submerchant ID
          example: submerchant_123
      required:
        - id
        - merchantId
        - createdAt
        - updatedAt
        - token
        - purchaseReference
        - customerReference
        - status
        - amount
        - currency
        - payments
        - mode
    ApiBadRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 400
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiBadRequestError'
      required:
        - status
        - error
    ApiUnauthorizedErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 401
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiUnauthorizedError'
      required:
        - status
        - error
    ApiNotFoundErrorAlias:
      type: object
      properties:
        httpStatus:
          type: number
          description: Http status
          enum:
            - 404
          example: 404
        message:
          type: string
          description: Detailed error message which describe what happened.
          example: X not found
        error:
          type: string
          description: Error message
          example: Not found
      required:
        - httpStatus
        - message
        - error
    ApiInvalidRequestErrorAlias:
      type: object
      properties:
        httpStatus:
          type: number
          description: Http status
          enum:
            - 409
          example: 409
        type:
          type: string
          description: Error type
          example: invalid_request
        code:
          type: string
          description: Error code
          enum:
            - unsupported_action
          example: unsupported_action
        message:
          type: string
          description: Error message
          example: This action is not supported
      required:
        - httpStatus
        - type
        - code
        - message
    ApiUnprocessableEntityErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 422
          example: 422
        error:
          type: string
          description: Unprocessable Entity
          example: Unable to process this transaction
      required:
        - status
        - error
    ApiTooManyRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 429
          example: 429
        error:
          type: string
          description: Error
          example: 'ThrottlerException: Too Many Requests'
      required:
        - status
        - error
    ApiInternalErrorAlias:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: internal_error
        code:
          type: string
          description: The error code for this error.
          example:
            - internal_error
            - wrong_credentials
            - not_granted
            - live_mode_not_granted
            - invalid_sandbox_msisdn
            - invalid_url
            - orange_invalid_url
            - wrong_provider
            - override_business_name
            - do_not_override_business_name
        message:
          type: string
          description: The error message describing what happens to throw this error.
          example: An error occurred on our system. Please try again later.
      required:
        - type
        - code
        - message
    ApiBadGatewayErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 502
          example: 502
        error:
          description: Error object
          allOf:
            - $ref: '#/components/schemas/ApiInternalErrorAlias'
      required:
        - status
        - error
    PayMobileMoneyDto:
      type: object
      properties:
        msisdn:
          type: string
          description: >-
            The phone number associated to the Mobile Money account used to make
            the transaction.
          example: '15948253'
        otp:
          type: string
          description: >-
            Some providers ask the customer to generate an OTP to allow the
            payment.
                Hub2 handle this in a two-step process if the selected provider ask for an OTP.
                But in some case, the client prefers to make a one-step process in which the payment and the authentication are done at same time.
                Hub2 allows this by accepting an OTP to be provided during the payment attempt step.
        onSuccessRedirectionUrl:
          type: string
          description: |-
            Only for payment using provider Wave.
                The URL the customer will be directed to if the payment succeeds.
                You must provide a fully-qualified address using https as the scheme.
                You may include any information you need in the path itself or in query parameters.
        onFailedRedirectionUrl:
          type: string
          description: |-
            Only for payment using provider Wave.
                The URL the customer will be directed to if an error occurs on the payment attempt.
                You must provide a fully-qualified address using https as the scheme.
                You may include any information you need in the path itself or in query parameters.
        onCancelRedirectionUrl:
          type: string
          description: >-
            Only for payment using provider Orange with the redirection
            workflow.
                The URL the customer will be directed to if he cancels the payment.
                You must provide a fully-qualified address using https as the scheme.
                You may include any information you need in the path itself or in query parameters.
        onFinishRedirectionUrl:
          type: string
          description: >-
            Only for payment using provider Orange with the redirection
            workflow.
                The URL the customer will be directed to when the payment finish and the return link is clicked.
                You must provide a fully-qualified address using https as the scheme.
                You may include any information you need in the path itself or in query parameters.
        workflow:
          type: string
          description: |-
            Only for payment using provider Orange.
                If you choose to set this parameter to 'redirection', you will be provided a redirection URL.
                Your clients must be redirected to this url for them to finalize payment.
                Otherwise it will follow our conventional workflow with OTP.
      required:
        - msisdn
    PayCreditCardDto:
      type: object
      properties:
        billing:
          description: Informations about order and credit card owner
          allOf:
            - $ref: '#/components/schemas/PayCreditCardBilling'
        useHub2ReceiptPage:
          type: boolean
          description: When set to true, Hub2 receipt page is displayed after payment
        onSuccessRedirectionUrl:
          type: string
          description: The url used to redirect the user when the transaction is successful
        onFailedRedirectionUrl:
          type: string
          description: The url used to redirect the user when the transaction is failed
    PayBankTransferDto:
      type: object
      properties:
        expirationDelay:
          type: number
          description: Number of seconds until the payment expires.
          example: 3600
          default: 1296000
          minimum: 3600
        kybName:
          type: string
          description: Name of the aggregated merchant declared in the kyb
          example: MechantName
      required:
        - kybName
    PaymentInformationDto:
      type: object
      properties:
        recipient_name_hashmac:
          type: string
          description: >-
            HMAC or hashed full name of the person receiving the funds. Send
            only hashed or pseudonymized values; do not send raw personal data.
          example: a1b2c3d4e5f6
          maxLength: 50
        recipient_phone_hashmac:
          type: string
          description: >-
            HMAC or hashed MSISDN of the recipient (natural identifier for
            mobile money). Send only a partner-side hash or HMAC — clear phone
            numbers are rejected.
          example: a1b2c3d4e5f6
          maxLength: 50
        customer_id_hashmac:
          type: string
          description: >-
            Partner-side hashed customer identifier. Use when name or phone
            hashes are not available, to correlate transactions for fraud
            analysis.
          example: a1b2c3d4e5f6
          maxLength: 50
        transaction_purpose:
          type: string
          description: Declared purpose of the payment for compliance and reporting.
          enum:
            - SALARY
            - LOAN_DISBURSEMENT
            - COMMISSION
            - REFUND
            - CASHOUT
            - OTHER
    PaymentCreditCardDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the Payment
          example: pay_QW2d6JnqiatcH8KhK0mD1
        intentId:
          type: string
          description: Unique identifier for the PaymentIntent owning this Payment
          example: pi_z1urYtVFgEebtcj8fxp4v
        createdAt:
          type: string
          description: |-
            Datetime in UTC timezone at which this object was created.
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:09:49.355Z'
        updatedAt:
          type: string
          description: >-
            Datetime in UTC timezone at which this object was updated for the
            last time .
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:16:26.128Z'
        status:
          type: string
          description: Current status of this Payment
          enum:
            - created
            - failed
            - pending
            - successful
          example: successful
        amount:
          type: number
          description: >-
            Amount intended to be collected by this payment. A positive integer
            representing how much to charge in the smallest currency unit (e.g.,
            100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal
            currency).
          example: 100
        currency:
          type: string
          description: >-
            Three-letter [ISO currency
            code](https://www.iso.org/iso-4217-currency-codes.html).
          example: XOF
        method:
          type: string
          description: The method selected by the customer to make this Payment
          example: credit_card
          enum:
            - mobile_money
            - credit_card
            - bank_transfer
          title: Credit card
        country:
          type: string
          description: >-
            Two-letter [ISO country
            code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents
            the country where the provider selected by the customer is
            localized. 
          example: CI
        failure:
          description: >-
            In case of a Payment attempt failure, this object will describe the
            reason of the failure
          title: PaymentFailureCause
          allOf:
            - $ref: '#/components/schemas/PaymentFailureCauseDto'
        fees:
          description: >-
            Some fees may be applied on a Payment. This array provides
            information of the fees that could have been applied on this
            Payment.
          title: PaymentFee
          type: array
          items:
            $ref: '#/components/schemas/PaymentFeeDto'
        nextAction:
          description: >-
            Action required to execute to continue the processing of this
            Payment. The action allows the customer to validate the Payment.
                - A redirection action provides all the information to redirect the customer to an external page,
                - A ussd action provides a message to display to the user for the validation of the Payment. He will receive a USSD message on his phone describing how to make the validation,
                - A otp action requires that you display an input to the customer to collect an OTP. A message is provided to explains to the user how to get this OTP. Then, the client will have to send the authentication request.
                
          title: NextAction
          allOf:
            - $ref: '#/components/schemas/NextActionDto'
        providerReference:
          type: string
          description: provider reference that identify this payment
          title: providerReference
        gatewayId:
          type: string
          description: gatewayId used for this payment (Mobile Money Only)
          title: gatewayId
        number:
          type: string
          description: |-
            The identifier referencing the payment method of the customer.
                - In case of a payment by Mobile Money, it corresponds to the customer phone number corresponding to his Mobile Money account,
                - In case of a payment by Credit Card, it corresponds to the four last digits of the customer's credit card number.
        paymentInformation:
          description: >-
            Optional beneficiary metadata (hashed identifiers) attached to this
            payment.
          allOf:
            - $ref: '#/components/schemas/PaymentInformationDto'
        isDelegated:
          type: boolean
          description: Indicates whether this payment is a delegated payment.
        onSuccessRedirectionUrl:
          type: string
          description: The url used to redirect the user after a transaction is successful.
          example: https://my.website.com/cancel
        onFailedRedirectionUrl:
          type: string
          description: The url used to redirect the user after a transaction fails
          example: https://my.website.com/finish
        billing:
          type: object
          description: Informations about order and credit card owner
      required:
        - id
        - intentId
        - createdAt
        - updatedAt
        - status
        - amount
        - currency
        - method
        - country
        - fees
        - providerReference
        - gatewayId
        - number
        - onSuccessRedirectionUrl
        - onFailedRedirectionUrl
        - billing
    PaymentMobileMoneyDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the Payment
          example: pay_QW2d6JnqiatcH8KhK0mD1
        intentId:
          type: string
          description: Unique identifier for the PaymentIntent owning this Payment
          example: pi_z1urYtVFgEebtcj8fxp4v
        createdAt:
          type: string
          description: |-
            Datetime in UTC timezone at which this object was created.
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:09:49.355Z'
        updatedAt:
          type: string
          description: >-
            Datetime in UTC timezone at which this object was updated for the
            last time .
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:16:26.128Z'
        status:
          type: string
          description: Current status of this Payment
          enum:
            - created
            - failed
            - pending
            - successful
          example: successful
        amount:
          type: number
          description: >-
            Amount intended to be collected by this payment. A positive integer
            representing how much to charge in the smallest currency unit (e.g.,
            100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal
            currency).
          example: 100
        currency:
          type: string
          description: >-
            Three-letter [ISO currency
            code](https://www.iso.org/iso-4217-currency-codes.html).
          example: XOF
        method:
          type: string
          description: The method selected by the customer to make this Payment
          example: mobile_money
          enum:
            - mobile_money
            - credit_card
            - bank_transfer
          title: Mobile money
        country:
          type: string
          description: >-
            Two-letter [ISO country
            code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents
            the country where the provider selected by the customer is
            localized. 
          example: CI
        failure:
          description: >-
            In case of a Payment attempt failure, this object will describe the
            reason of the failure
          title: PaymentFailureCause
          allOf:
            - $ref: '#/components/schemas/PaymentFailureCauseDto'
        fees:
          description: >-
            Some fees may be applied on a Payment. This array provides
            information of the fees that could have been applied on this
            Payment.
          title: PaymentFee
          type: array
          items:
            $ref: '#/components/schemas/PaymentFeeDto'
        nextAction:
          description: >-
            Action required to execute to continue the processing of this
            Payment. The action allows the customer to validate the Payment.
                - A redirection action provides all the information to redirect the customer to an external page,
                - A ussd action provides a message to display to the user for the validation of the Payment. He will receive a USSD message on his phone describing how to make the validation,
                - A otp action requires that you display an input to the customer to collect an OTP. A message is provided to explains to the user how to get this OTP. Then, the client will have to send the authentication request.
                
          title: NextAction
          allOf:
            - $ref: '#/components/schemas/NextActionDto'
        providerReference:
          type: string
          description: provider reference that identify this payment
          title: providerReference
        gatewayId:
          type: string
          description: gatewayId used for this payment (Mobile Money Only)
          title: gatewayId
        number:
          type: string
          description: |-
            The identifier referencing the payment method of the customer.
                - In case of a payment by Mobile Money, it corresponds to the customer phone number corresponding to his Mobile Money account,
                - In case of a payment by Credit Card, it corresponds to the four last digits of the customer's credit card number.
        paymentInformation:
          description: >-
            Optional beneficiary metadata (hashed identifiers) attached to this
            payment.
          allOf:
            - $ref: '#/components/schemas/PaymentInformationDto'
        isDelegated:
          type: boolean
          description: Indicates whether this payment is a delegated payment.
        provider:
          type: string
          description: >-
            The name of the provider selected by the customer, in lowercase. The
            list of supported providers can be found at
            [/data/providers](#operation/DataController_getProviders)
          example: orange
      required:
        - id
        - intentId
        - createdAt
        - updatedAt
        - status
        - amount
        - currency
        - method
        - country
        - fees
        - providerReference
        - gatewayId
        - number
        - provider
    PaymentBankTransferDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the Payment
          example: pay_QW2d6JnqiatcH8KhK0mD1
        intentId:
          type: string
          description: Unique identifier for the PaymentIntent owning this Payment
          example: pi_z1urYtVFgEebtcj8fxp4v
        createdAt:
          type: string
          description: |-
            Datetime in UTC timezone at which this object was created.
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:09:49.355Z'
        updatedAt:
          type: string
          description: >-
            Datetime in UTC timezone at which this object was updated for the
            last time .
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2020-10-15T12:16:26.128Z'
        status:
          type: string
          description: Current status of this Payment
          enum:
            - created
            - failed
            - pending
            - successful
          example: successful
        amount:
          type: number
          description: >-
            Amount intended to be collected by this payment. A positive integer
            representing how much to charge in the smallest currency unit (e.g.,
            100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal
            currency).
          example: 100
        currency:
          type: string
          description: >-
            Three-letter [ISO currency
            code](https://www.iso.org/iso-4217-currency-codes.html).
          example: XOF
        method:
          type: string
          description: The method selected by the customer to make this Payment
          example: bank_transfer
          enum:
            - mobile_money
            - credit_card
            - bank_transfer
          title: Bank transfer
        country:
          type: string
          description: >-
            Two-letter [ISO country
            code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents
            the country where the provider selected by the customer is
            localized. 
          example: CI
        failure:
          description: >-
            In case of a Payment attempt failure, this object will describe the
            reason of the failure
          title: PaymentFailureCause
          allOf:
            - $ref: '#/components/schemas/PaymentFailureCauseDto'
        fees:
          description: >-
            Some fees may be applied on a Payment. This array provides
            information of the fees that could have been applied on this
            Payment.
          title: PaymentFee
          type: array
          items:
            $ref: '#/components/schemas/PaymentFeeDto'
        nextAction:
          description: >-
            Action required to execute to continue the processing of this
            Payment. The action allows the customer to validate the Payment.
                - A redirection action provides all the information to redirect the customer to an external page,
                - A ussd action provides a message to display to the user for the validation of the Payment. He will receive a USSD message on his phone describing how to make the validation,
                - A otp action requires that you display an input to the customer to collect an OTP. A message is provided to explains to the user how to get this OTP. Then, the client will have to send the authentication request.
                
          title: NextAction
          allOf:
            - $ref: '#/components/schemas/NextActionDto'
        providerReference:
          type: string
          description: provider reference that identify this payment
          title: providerReference
        gatewayId:
          type: string
          description: gatewayId used for this payment (Mobile Money Only)
          title: gatewayId
        number:
          type: string
          description: |-
            The identifier referencing the payment method of the customer.
                - In case of a payment by Mobile Money, it corresponds to the customer phone number corresponding to his Mobile Money account,
                - In case of a payment by Credit Card, it corresponds to the four last digits of the customer's credit card number.
        paymentInformation:
          description: >-
            Optional beneficiary metadata (hashed identifiers) attached to this
            payment.
          allOf:
            - $ref: '#/components/schemas/PaymentInformationDto'
        isDelegated:
          type: boolean
          description: Indicates whether this payment is a delegated payment.
        provider:
          type: string
          description: >-
            The name of the provider (bank) selected by the customer, in
            lowercase. The list of supported providers can be found at
            [/data/providers](#operation/DataController_getProviders)
          example: Bankname
        bankTransferReference:
          type: string
          description: Reference that must be used to make the bank transfer
          example: 102D250401Z8F2A025
        expirationDate:
          format: date-time
          type: string
          description: |-
            Datetime in UTC timezone at which this payment will expire.
                 Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
          example: '2025-40-15T12:09:49.355Z'
      required:
        - id
        - intentId
        - createdAt
        - updatedAt
        - status
        - amount
        - currency
        - method
        - country
        - fees
        - providerReference
        - gatewayId
        - number
        - provider
        - bankTransferReference
        - expirationDate
    NextActionDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - ussd
            - otp
            - redirection
        message:
          type: string
        data:
          description: ''
          allOf:
            - $ref: '#/components/schemas/RedirectionDataDto'
      required:
        - type
        - message
    PaymentFailureCauseDto:
      type: object
      properties:
        code:
          type: string
          description: Unique code representing the failure cause for the payment.
          enum:
            - internal_error
            - service_unavailable
            - unknown_reason
            - customer_account_locked
            - customer_insufficient_funds
            - authentication_failed
            - authentication_timeout
            - timeout
            - bad_parameters
            - forbidden_by_provider
            - too_many_request
            - duplicate_request
            - canceled_by_customer
            - canceled
            - fraud_suspicion
            - unsupported_currency
            - payer_quota_exceeded
            - invalid_payment_processor
            - invalid_amount
            - blacklisted_msisdn
            - msisdn_invalid
            - card_expired
            - card_declined
            - card_stolen
            - card_refused
            - card_invalid
            - card_cvn_invalid
            - address_verification_failed
            - payment_limit_reached
        message:
          type: string
          description: >-
            Human readable message explaining the failure cause. This message
            can be displayed to the customer.
        params:
          description: >-
            List of parameters causing the payment failure in case of invalid
            parameters
          type: array
          items:
            type: string
      required:
        - code
        - message
    InternalApiBadRequestError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP error code.
          example: 400
        message:
          description: >-
            Detailed error message or array of messages to describe what's
            wrong.
          example:
            - destination.provider must be a string
          type: array
          items:
            type: string
        error:
          type: string
          description: The error message
          example: Bad Request
      required:
        - statusCode
        - message
        - error
    InternalApiUnauthorizedError:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: authorization_error
        code:
          type: string
          description: The internal error code describing what happened.
          enum:
            - bad_payment_intent_token
            - wrong_credentials
          example: wrong_credentials
        message:
          type: string
          description: Detailed error message which describe what happened.
          example: L'ID marchand et/ou la clé d'API sont incorrects.
      required:
        - type
        - code
        - message
    PayCreditCardBilling:
      type: object
      properties:
        username:
          type: string
          description: Username of the customer
        userId:
          type: string
          description: User ID of the customer
        phoneNumber:
          type: string
          description: The phone number of the customer
        email:
          type: string
          description: The email of the customer
        orderId:
          type: string
          description: The order ID associated with the transaction
    PaymentFeeDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the applied Fee object.
          example: lAe5HnFpvOjwdT9vSIgPA
        rate:
          type: number
          description: >-
            A rate corresponding to the amount (flat or percentage) applied by
            the fees.
        rateType:
          type: string
          description: >-
            Fees can either be a flat amount of the transaction amount or
            percentage of the transaction amount.
          enum:
            - percent
            - flat
        amount:
          type: number
          description: >-
            Amount applied by this Fees. A positive integer representing how
            much to charge in the smallest currency unit (e.g., 100 cents to
            charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
          example: 5
        currency:
          type: string
          description: >-
            Three-letter [ISO currency
            code](https://www.iso.org/iso-4217-currency-codes.html).
          example: XOF
        label:
          type: string
          description: An optional label giving information on the reason of this fees.
        taxes:
          description: Taxes applied to this fee.
          type: array
          items:
            type: string
      required:
        - id
        - rate
        - rateType
        - amount
        - currency
    RedirectionDataDto:
      type: object
      properties:
        url:
          type: string
          description: >-
            A fully qualified URL where the customer must be redirected to
            pursue the payment.
        urls:
          type: string
          description: >-
            An array of fully qualified URLs where the customer must be
            redirected to pursue the payment.
        method:
          type: string
          description: HTTP verb to be used to redirect the customer.
          example: post
        headers:
          type: object
          description: ''
        data:
          type: object
          description: >-
            Data that need to be used to make the redirection. It could be
            parameters for a GET request or a body payload for a POST.
      required:
        - url
        - urls
        - method

````