> ## 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.

# Create a PaymentIntent object

> This endpoint is the first entry point of the PAY-IN circuit.
    First of all, you must create a payment intent which describes your intention to collect an amount of money in a currency.
    Later on, you will perform payments associated with this payment intent.
    Please do save the fields returned by this endpoint, especially the field 'id' and 'token'.
    That will help you identity the payment intent in our platform whenever you want to retrieve it.



## OpenAPI

````yaml post /payment-intents
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.190.0
  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: Subscription Links
    description: ''
  - name: Submerchants
    description: ''
  - name: Bill Payments
    description: ''
  - name: Subscriptions
    description: ''
  - name: Subscription Intents
    description: >-
      Enrolls a customer in card-on-file recurring debits and tracks how each
      enrollment ended.
  - name: Instant Payment
    description: >-
      Instant payment (PI SPI, BCEAO) resources, such as the aliases naming your
      accounts in the national directory.
paths:
  /payment-intents:
    post:
      tags:
        - Payments
      summary: Create a PaymentIntent object
      description: |-
        This endpoint is the first entry point of the PAY-IN circuit.
            First of all, you must create a payment intent which describes your intention to collect an amount of money in a currency.
            Later on, you will perform payments associated with this payment intent.
            Please do save the fields returned by this endpoint, especially the field 'id' and 'token'.
            That will help you identity the payment intent in our platform whenever you want to retrieve it.
      operationId: PaymentIntentsController_createPayment
      parameters:
        - 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:
            type: string
            enum:
              - live
              - sandbox
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentIntentDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInvalidInputErrorAlias'
        '401':
          description: Wrong credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorizedErrorAlias'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbiddenRequestErrorAlias'
        '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'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUpstreamErrorAlias'
components:
  schemas:
    CreatePaymentIntentDto:
      type: object
      properties:
        customerReference:
          type: string
          description: >-
            This is a custom field you can fill with any reference you have on
            your side matching this payment intent.
                It can allow you to make a correspondence with this payment intent in your system.
                This field is specifically useful for customer's references, like your customer ID.
          example: cust_01924059
        purchaseReference:
          type: string
          description: >-
            This is a custom field you can fill with any reference you have on
            your side matching this payment intent.
                It can allow you to make a correspondence with this payment intent in your system.
                This field is specifically useful for purchase's references, like an order your customer made.
          example: ref_2020_11_10_001
        amount:
          type: number
          description: |-
            Amount intended to be collected by this payment intent.
                A positive integer representing how much to charge in whole currency units (e.g., 100 to charge €100 or FCFA100).
          example: 100
        currency:
          type: string
          description: >-
            Three-letter [ISO currency
            code](https://www.iso.org/iso-4217-currency-codes.html).
          example: XOF
        overrideBusinessName:
          type: string
          description: >-
            This field is mandatory for aggregators and allows you to override
            the business name displayed to the end users.
                This is useful if you don't want your clients to see "Hub2" as the target of their payment but your company name instead.
          example: My wonderful business
      required:
        - customerReference
        - purchaseReference
        - amount
        - currency
    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.
            It expires 30 minutes after the PaymentIntent creation: paying or
            authenticating with it is then refused with a 401
            `bad_payment_intent_token` error, and reading the PaymentIntent with
            it (status, details, fees) is refused the same way 15 minutes later.
          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 whole currency units
            (e.g., 100 to charge €100 or FCFA100).
          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, most recently
            updated first. The same order applies to every endpoint and webhook
            returning a PaymentIntent. It is an update order: the latest attempt
            is the one with the most recent createdAt, which is not necessarily
            the first element.
          title: Payment
          items:
            oneOf:
              - $ref: '#/components/schemas/PaymentCreditCardDto'
              - $ref: '#/components/schemas/PaymentMobileMoneyDto'
              - $ref: '#/components/schemas/PaymentBankTransferDto'
          discriminator:
            propertyName: method
            mapping:
              mobile_money: '#/components/schemas/PaymentMobileMoneyDto'
              credit_card: '#/components/schemas/PaymentCreditCardDto'
              bank_transfer: '#/components/schemas/PaymentBankTransferDto'
        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
    ApiInvalidInputErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP status.
          enum:
            - 400
          example: 400
        code:
          type: string
          description: >-
            The error code, e.g. `wrong_provider`, `provider_required`,
            `provider_not_allowed`, `invalid_url`, `invalid_sandbox_msisdn`,
            `credit_card_fees_not_supported`,
            `credit_card_provider_not_configured`,
            `credit_card_provider_unavailable`, `payment_method_not_supported`,
            `override_business_id`, `override_business_name`, `signature_error`,
            `merchant_not_found`, `forbidden_special_chars`,
            `ci.mtn.description_too_big`, `reference_required`. `Bad Request`
            for DTO validation failures and other uncoded 400s.
          example: wrong_provider
        message:
          description: >-
            What is wrong with the request. An array of messages when the
            payload fails DTO validation.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: >-
            Provider 'unknown_provider' does not exist for country 'CI' and
            method 'mobile_money'.
        request_id:
          type: string
          description: >-
            Identifier of the request, to quote when contacting the Support
            team.
      required:
        - status
        - code
        - message
        - request_id
    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
    ApiForbiddenRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 403
          example: 403
        error:
          description: Error object
          allOf:
            - $ref: '#/components/schemas/ForbiddenErrorObject'
      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
            - merchant_inactive
        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
    ApiUpstreamErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP status.
          enum:
            - 502
            - 503
          example: 503
        code:
          type: string
          description: >-
            The error code. 503: `instant_payment_alias_rail_unavailable`,
            `merchant_group_unavailable` (the merchant group of the caller could
            not be verified, so money movement is refused, and in live mode
            every request made with an API key), `merchant_unavailable` (live
            mode, API key or payment intent token: the merchant could not be
            verified, retry later), `provider_check_unavailable` (payment link
            creation: the providers could not be checked, retry later). 502:
            `instant_payment_alias_not_recorded`,
            `instant_payment_alias_deletion_not_recorded`,
            `instant_payment_alias_divergence`.
          example: merchant_group_unavailable
        message:
          type: string
          description: What went wrong, and whether the call is safe to retry.
          example: >-
            Your merchant group could not be verified. Please retry in a few
            moments.
        request_id:
          type: string
          description: >-
            Identifier of the request, to quote when contacting the Support
            team.
      required:
        - status
        - code
        - message
        - request_id
    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 whole currency units (e.g., 100
            to charge €100 or FCFA100).
          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
            - instant_payment
          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
        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/finish
        onFailedRedirectionUrl:
          type: string
          description: The url used to redirect the user after a transaction fails
          example: https://my.website.com/cancel
        billing:
          type: object
          description: Informations about order and credit card owner
      required:
        - id
        - intentId
        - createdAt
        - updatedAt
        - status
        - amount
        - currency
        - method
        - country
        - fees
        - providerReference
        - 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 whole currency units (e.g., 100
            to charge €100 or FCFA100).
          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
            - instant_payment
          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
        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
        - 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 whole currency units (e.g., 100
            to charge €100 or FCFA100).
          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
            - instant_payment
          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
        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-04-15T12:09:49.355Z'
      required:
        - id
        - intentId
        - createdAt
        - updatedAt
        - status
        - amount
        - currency
        - method
        - country
        - fees
        - providerReference
        - 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
            - issuer_authentication_unavailable
            - timeout
            - bad_parameters
            - forbidden_by_provider
            - too_many_request
            - duplicate_request
            - consent_reference_in_use
            - canceled_by_customer
            - canceled
            - fraud_suspicion
            - unsupported_currency
            - payer_quota_exceeded
            - invalid_payment_processor
            - invalid_amount
            - recipient_unavailable
            - msisdn_invalid
            - card_expired
            - card_declined
            - card_stolen
            - card_refused
            - card_invalid
            - card_cvn_invalid
            - address_verification_failed
            - payment_limit_reached
            - reconciliation_failure
        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
    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
    ForbiddenErrorObject:
      type: object
      properties:
        statusCode:
          type: number
          description: Http status
          enum:
            - 403
          example: 403
        message:
          type: string
          description: Detailed error message
          example: Forbidden
        error:
          type: string
          description: Error name
      required:
        - statusCode
        - message
        - error
    PaymentFeeDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the applied Fee object.
          example: fee_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 fee, in the same currency units as the
            payment `amount` (e.g., 5 for €5 or FCFA5).
          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:
            $ref: '#/components/schemas/PaymentFeeTaxResponseDto'
      required:
        - id
        - rate
        - rateType
        - amount
        - currency
    PaymentInformationDto:
      type: object
      properties:
        customer_id_hashmac:
          type: string
          description: >-
            HMAC-SHA256, hex-encoded (64 characters), of your identifier for the
            end user paying: your customer id, or the end-user phone number when
            you have no customer id. Lets Hub2 correlate the pay-ins of one
            person for fraud analysis without receiving personal data.
            Case-insensitive on input, returned in lower case.
          example: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
          pattern: ^[0-9a-fA-F]{64}$
          maxLength: 64
    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
    PaymentFeeTaxResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the applied tax.
          example: tax_lAe5HnFpvOjwdT9vSIgPA
        feeId:
          type: string
          description: Identifier of the Fee this tax applies to.
          example: fee_lAe5HnFpvOjwdT9vSIgPA
        taxType:
          type: string
          description: Kind of tax applied.
          enum:
            - tva
          example: tva
        type:
          type: string
          description: >-
            How the tax amount was computed: a flat amount, or a percentage
            included in the fee amount.
          enum:
            - flat
            - percent
          example: percent
        value:
          type: number
          description: >-
            Tax amount, not rounded. For a `percent` tax it is the tax part of
            this fee, in the same currency units as the payment `amount`,
            computed on a base that may differ from the one `amount` uses, so it
            may not match the tax contained in `amount`. For a `flat` tax it is
            the configured tax amount as is.
          example: 3.813559322033896
      required:
        - id
        - feeId
        - taxType
        - type
        - value

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.