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

# Retrieve fees

> This endpoint allows you to retrieve the fees associated with a payment intent.
    Fees are applied per payment and this endpoints will group all the fees in an array.



## OpenAPI

````yaml get /payment-intents/{id}/payment-fees
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}/payment-fees:
    get:
      tags:
        - Payments
      summary: Retrieve fees
      description: >-
        This endpoint allows you to retrieve the fees associated with a payment
        intent.
            Fees are applied per payment and this endpoints will group all the fees in an array.
      operationId: PaymentIntentsController_getPaymentFees
      parameters:
        - name: id
          required: true
          in: path
          description: Identifier of the PaymentIntent on which to retrieve PaymentFees.
          schema:
            type: string
        - name: country
          required: true
          in: query
          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. 
          schema:
            example: CI
            type: string
        - name: provider
          required: true
          in: query
          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)
          schema:
            example: orange
            type: string
        - name: paymentMethod
          required: true
          in: query
          description: The method selected by the customer to make this Payment.
          schema:
            type: string
            enum:
              - mobile_money
              - credit_card
              - bank_transfer
        - 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
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaymentFeeDto'
        '401':
          description: Wrong credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorizedErrorAlias'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbiddenRequestErrorAlias'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiNotFoundErrorAlias'
        '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'
components:
  schemas:
    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
    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
    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
    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
    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

````