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

# Fingo Pay API reference

> Interactive API docs powered by OpenAPI for payments, payouts, balances, and transactions

<Info>
  This section documents Fingo Pay's REST API. Use the interactive playground to test requests against <code>[https://api.fingopay.io](https://api.fingopay.io)</code> with your API key.
</Info>

## Authentication

All API endpoints use Bearer authentication. Provide your API key as a Bearer token in the <code>Authorization</code> header.

```http theme={"dark"}
Authorization: Bearer <YOUR_SECRET_KEY>
```

<Tip>
  For POST endpoints, include an <code>Idempotency-Key</code> header so retries do not create duplicate operations.
</Tip>

## Enterprise-only fields in API requests

Some endpoints accept optional fields that are only relevant for enterprise integrations (aggregators, dedicated shortcodes, sub-merchants). These fields are marked with the <span style={{background: '#FEF3C7', color: '#92400E', padding: '2px 8px', borderRadius: '4px', fontSize: '12px', fontWeight: 600, border: '1px solid #F59E0B'}}>ENTERPRISE</span> badge throughout this reference.

<Warning>
  Send only required fields unless your integration needs enterprise routing behavior. Over-specifying optional fields is a common source of integration errors.
</Warning>

| Endpoint                | Enterprise-only fields                                    | Notes                                                                      |
| ----------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------- |
| `POST /v1/mpesa/charge` | `shortcode` `subMerchantId` `metadata.subMerchantDetails` | Route charges via dedicated shortcode and optional sub-merchant enrichment |
| `POST /v1/mpesa/b2c`    | `shortcode` `subMerchantId` `metadata.subMerchantDetails` | Dedicated payout routing with optional sub-merchant enrichment             |
| `POST /v1/mpesa/b2b`    | `shortcode` `subMerchantId` `metadata.subMerchantDetails` | Dedicated payout routing with optional sub-merchant enrichment             |

<Card title="Enterprise integration guide" icon="compass" href="/enterprise/aggregators-large-merchants">
  Learn how to set up dedicated shortcodes, sub-merchants, and enterprise routing patterns.
</Card>

## OpenAPI specification

<Card title="Fingo Pay OpenAPI" icon="file-code" href="/api-reference/openapi.json">
  View the source OpenAPI file used by this reference
</Card>
