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

# Get Gateway Fees

> Learn how to query the configured payment gateway fees of a store using the endpoint GET /stores/{storeId}/fees.

## 💰 Get Gateway Fees

`GET /stores/{storeId}/fees`

Returns the **payment methods and fees of the store's active gateways**.

> **Important:** the fees returned here are the ones **defined by the merchant** in the dashboard (section "Fees by method" of each gateway), i.e. the percentage/fixed amount they decide to **pass on to the customer** at checkout. They **do not** represent the cost charged by the gateway to the merchant — that cost is internal and stays only in the dashboard frontend (table `GATEWAY_FEES`), used to calculate the net amount the merchant receives.

***

## 🔐 Authentication

* **Public route**.
* The linked store must have an active plan.

***

## 🧾 Route parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `storeId` | string | Yes | Store ID |

***

## ✅ Example request

```bash theme={null}
curl -X GET "https://api.cabrapi.com.br/v1/stores/STORE_ID/fees"
```

***

## 📦 Success response (200)

```json theme={null}
{
  "gateways": [
    {
      "type": "MERCADOPAGO",
      "publicKey": "APP_USR-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "methods": ["pix", "card", "boleto", "saldo"],
      "maxInstallments": 12,
      "installmentFees": [
        { "min": 1, "max": 1, "percent": 0, "fixed": 0 },
        { "min": 2, "max": 6, "percent": 3.49, "fixed": 0.49 },
        { "min": 7, "max": 12, "percent": 3.99, "fixed": 0.49 }
      ],
      "fees": {
        "pix": { "percent": 0, "fixed": 0 },
        "card": { "percent": 4.99, "fixed": 0 }
      }
    },
    {
      "type": "ASAAS",
      "methods": ["pix", "card", "boleto"],
      "maxInstallments": 1,
      "installmentFees": [],
      "fees": {
        "pix": { "percent": 0, "fixed": 1.99 },
        "card": { "percent": 2.99, "fixed": 0.49 }
      }
    },
    {
      "type": "STRIPE",
      "publicKey": "pk_live_xxxxxxxxxxxxxxxxxxxxxxxx",
      "methods": ["pix", "card", "boleto"],
      "maxInstallments": 1,
      "installmentFees": [],
      "fees": {
        "card": { "percent": 3.99, "fixed": 0.39 }
      }
    },
    {
      "type": "EFI_BANK",
      "payeeCode": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "methods": ["pix", "card", "boleto"],
      "maxInstallments": 1,
      "installmentFees": [],
      "fees": {
        "pix": { "percent": 0, "fixed": 0 }
      }
    }
  ],
  "fees": {
    "pix": { "percent": 0, "fixed": 0 },
    "card": { "percent": 4.99, "fixed": 0 }
  }
}
```

* `gateways[]` → **all** active gateways of the store owner (`type` among `MERCADOPAGO`, `ASAAS`, `EFI_BANK`, and `STRIPE`, available methods `methods[]`, `maxInstallments`, `installmentFees[]`, `fees` per method with `percent` + `fixed`, plus optional/nullable `publicKey` when configured and optional/nullable `payeeCode` for `EFI_BANK` when configured).
* `fees` (top-level) → fees of the **first** active gateway, kept for compatibility with older consumers.
* The `fees` values (e.g. Mercado Pago `card` 4.99%, Asaas `pix` R\$ 1.99 / `card` 2.99% + R\$ 0.49) are **configured by the merchant** and may vary from store to store — they are **not** guaranteed fixed values nor the real cost of the gateway.

When the store has no active gateway (or no configured credentials), fees return empty:

```json theme={null}
{
  "gateways": [],
  "fees": {}
}
```

***

## ⚠️ Possible errors

* `403 NO_ACTIVE_SUBSCRIPTION` → the linked store has no active plan
* `404 STORE_NOT_FOUND` → store not found
* `429 RATE_LIMIT_EXCEEDED` → per-minute request limit exceeded
* `500 INTERNAL_SERVER_ERROR` → internal error
* `503 SERVICE_UNAVAILABLE` → service temporarily unavailable

***

## 📝 Notes

* `gateways[]` reflects **all** gateways marked as **active** by the store owner (`MERCADOPAGO`, `ASAAS`, `EFI_BANK`, `STRIPE`).
* `publicKey` is returned on the gateway object when present in the configured credentials (e.g. Mercado Pago or Stripe); for `EFI_BANK`, `payeeCode` is also returned when configured.
* `methods[]` comes from `credentials.paymentMethods` of each gateway (fallback: type default — `MERCADOPAGO`: `pix/card/boleto/saldo`; `ASAAS`, `EFI_BANK`, and `STRIPE`: `pix/card/boleto`).
* `maxInstallments` → maximum number of card installments configured by the merchant (default `1`, max `12`).
* `installmentFees` → list of **installment ranges** configured by the merchant, with its own fee per interval `{ min, max, percent, fixed }` (max **12 ranges**, no overlap). When a range exists for the `installmentCount`, checkout and billing use it instead of the flat `fees.card` fee — ensuring the amount shown to the customer matches what is charged.
* Fees are read from the decrypted credentials (AES-256-GCM) of the gateway.
* The public checkout uses this route to display the store's real payment methods (e.g. Mercado Pago + Asaas), available installments (`maxInstallments`) and to calculate the fee pass-through per method/range.


## OpenAPI

````yaml GET /stores/{storeId}/fees
openapi: 3.1.0
info:
  title: caBRAPI
  version: 1.0.0
servers:
  - url: https://api.cabrapi.com.br/v1
security: []
paths:
  /stores/{storeId}/fees:
    get:
      tags:
        - Stores
      summary: Get store fees
      operationId: getStoreFees
      parameters:
        - $ref: '#/components/parameters/StoreId'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  fees:
                    type: object
                  gateways:
                    items:
                      properties:
                        fees:
                          type: object
                        installmentFees:
                          items:
                            type: object
                          type: array
                        maxInstallments:
                          type: number
                        methods:
                          items:
                            type: string
                          type: array
                        type:
                          enum:
                            - MERCADOPAGO
                            - ASAAS
                            - EFI_BANK
                            - STRIPE
                          type: string
                        publicKey:
                          type: string
                        payeeCode:
                          type: string
                      required:
                        - type
                        - methods
                      type: object
                    type: array
                required:
                  - gateways
                  - fees
                type: object
          description: Active gateways and store fees.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: NO_ACTIVE_SUBSCRIPTION
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: STORE_NOT_FOUND
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Rate limit exceeded.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Service unavailable.
      security: []
components:
  parameters:
    StoreId:
      in: path
      name: storeId
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 50
  schemas:
    Error:
      properties:
        code:
          example: STORE_NOT_FOUND
          type: string
      required:
        - code
      type: object

````

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