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

# Transaction fee quote

> Calculate the fee amount, payable amount, and fee bearer before a transaction.

This route calculates fees server-side before launching a collection or disbursement.

You can identify the service with `serviceId`, `service_id`, `provider`, `serviceCode`, or `service_code`.

For a direct API application, the fee bearer comes from the authenticated application configuration or the internal `X-SP-Fee-Bearer` header.

For a plugin, send `origin: "PLUGIN"` and provide `feeBearer` in the payload or query string. The payload has priority.

| Field       | Role                                       |
| ----------- | ------------------------------------------ |
| `amount`    | Base amount to charge                      |
| `currency`  | Currency expected by the service           |
| `operation` | `COLLECTION` by default, or `DISBURSEMENT` |
| `provider`  | Service code, for example `mtn_cmr`        |
| `origin`    | `APPLICATION` by default, or `PLUGIN`      |
| `feeBearer` | `CUSTOMER` or `MERCHANT`                   |

When `feeBearer` is `CUSTOMER`, `payableAmount` includes fees. When `feeBearer` is `MERCHANT`, `merchantNetAmount` indicates the merchant net amount after fees.


## OpenAPI

````yaml en/api-reference/openapi.json POST /transactions/fees/quote
openapi: 3.1.0
info:
  title: Mysoleas API
  version: 3.0.0
  description: >-
    New Mysoleas architecture: business gateway, Mysoleas Identity Cloud, and
    SoleasPay ecosystem.
servers:
  - url: https://api.mysoleas.com
    description: Mysoleas gateway
  - url: https://account.mysoleas.com
    description: Mysoleas authentication
security:
  - spAuthToken: []
tags:
  - name: Identity Cloud
  - name: Plugin
  - name: Payment links
  - name: Subscriptions
  - name: Collections
  - name: Disbursements
  - name: Verification
  - name: Catalog
paths:
  /transactions/fees/quote:
    post:
      tags:
        - Collections
      summary: Calculate transaction fees
      description: >-
        Returns a server-side fee quote. For a direct API application, feeBearer
        comes from the authenticated application configuration. For a plugin,
        feeBearer can come from the payload or query string.
      parameters:
        - name: feeBearer
          in: query
          required: false
          schema:
            type: string
            enum:
              - CUSTOMER
              - MERCHANT
          description: >-
            Prioritaire seulement pour les flux plugin lorsque le payload ne
            fournit pas feeBearer.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
              properties:
                serviceId:
                  type: integer
                  example: 1
                service_id:
                  type: integer
                  example: 1
                provider:
                  type: string
                  example: mtn_cmr
                amount:
                  type: integer
                  example: 10000
                currency:
                  type: string
                  example: XAF
                origin:
                  type: string
                  enum:
                    - APPLICATION
                    - PLUGIN
                  example: APPLICATION
                plugin:
                  type: string
                  example: CHECKOUT
                feeBearer:
                  type: string
                  enum:
                    - CUSTOMER
                    - MERCHANT
                  example: CUSTOMER
                customerPaysFees:
                  type: boolean
                  deprecated: true
                  example: true
                operation:
                  type: string
                  enum:
                    - COLLECTION
                    - DISBURSEMENT
                  example: COLLECTION
      responses:
        '200':
          description: Devis de fees
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeQuoteResponse'
        '400':
          description: Invalid request
        '401':
          description: Unauthenticated
        '404':
          description: Service introuvable
      security:
        - spAuthToken: []
components:
  schemas:
    FeeQuoteResponse:
      type: object
      properties:
        code:
          type: integer
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/FeeQuote'
        locale:
          type: string
          example: fr
        message:
          type: string
          example: fees_quote
    FeeQuote:
      type: object
      properties:
        baseAmount:
          type: integer
          example: 10000
        feeAmount:
          type: integer
          example: 350
        payableAmount:
          type: integer
          example: 10350
        merchantNetAmount:
          type: integer
          example: 9650
        currency:
          type: string
          example: XAF
        feeBearer:
          type: string
          nullable: true
          enum:
            - CUSTOMER
            - MERCHANT
          example: CUSTOMER
        countryCode:
          type: string
          example: CMR
        userTier:
          type: integer
          example: 5
        source:
          type: string
          enum:
            - APPLICATION_CONFIGURATION
            - PLUGIN_PAYLOAD
            - PLUGIN_QUERY
            - HISTORICAL_DEFAULT
          example: APPLICATION_CONFIGURATION
  securitySchemes:
    spAuthToken:
      type: apiKey
      in: header
      name: x-sp-auth-token
      description: >-
        JWT Bearer emis par Mysoleas Identity Cloud. Format: Bearer
        <access_token>.

````