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

# Introduction

> Accept M-Pesa payments and automate payouts with Fingo Pay's unified payments API

## Welcome to Fingo Pay

Build reliable payment experiences with a single API. Charge customers via STK Push, disburse funds to wallets, tills, paybills, and bank accounts, and reconcile everything with webhooks.

<Info>
  **Base URL** (all environments)

  ```bash theme={"dark"}
  https://api.fingopay.io
  ```
</Info>

<CardGroup cols={3}>
  <Card title="Authentication" icon="lock-keyhole" href="/auth">
    API keys, Bearer tokens, and idempotency.
  </Card>

  <Card title="API Reference" icon="square-terminal" href="/api-reference/introduction">
    Interactive docs for every endpoint.
  </Card>

  <Card title="Webhooks" icon="bell-ring" href="/webhooks">
    Real-time event notifications.
  </Card>
</CardGroup>

## Quickstart

Get up and running in three steps.

<Steps>
  <Step title="Set your API key">
    Get your key from the [Fingo Pay Dashboard](https://fingopay.io) and export it.

    ```bash theme={"dark"}
    export FINGO_API_KEY=sk_test_***
    ```
  </Step>

  <Step title="Create a charge">
    Initiate an M-Pesa STK Push payment.

    ```bash theme={"dark"}
    curl -X POST "https://api.fingopay.io/v1/mpesa/charge" \
      -H "Authorization: Bearer $FINGO_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: 46ea80b4-5f6d-43b6-8d69-445d0f9cb33f" \
      -d '{
        "merchantTransactionId": "order_12345",
        "amount": 150000,
        "phoneNumber": "+254712345678",
        "narration": "Order #12345"
      }'
    ```

    <Check>
      The customer receives an STK Push prompt. Final status arrives via webhook.
    </Check>
  </Step>

  <Step title="Handle webhooks">
    Subscribe your endpoint and process `transaction.*` events.

    <Card title="Webhook guide" icon="bell-ring" href="/webhooks">
      Signature verification, retries, and idempotent handling.
    </Card>
  </Step>
</Steps>

## Common operations

<Tabs>
  <Tab title="Collect a payment">
    ```bash theme={"dark"}
    curl -X POST "https://api.fingopay.io/v1/mpesa/charge" \
      -H "Authorization: Bearer $FINGO_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "merchantTransactionId": "order_12345",
        "amount": 150000,
        "phoneNumber": "+254712345678",
        "narration": "Order #12345"
      }'
    ```
  </Tab>

  <Tab title="Send a payout">
    ```bash theme={"dark"}
    curl -X POST "https://api.fingopay.io/v1/mpesa/b2c" \
      -H "Authorization: Bearer $FINGO_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "merchantTransactionId": "payout_97233",
        "amount": 420000,
        "phoneNumber": "+254701234567",
        "narration": "Salary payout"
      }'
    ```
  </Tab>

  <Tab title="Check balance">
    ```bash theme={"dark"}
    curl "https://api.fingopay.io/v1/balance?accountNo=ACC-123456" \
      -H "Authorization: Bearer $FINGO_API_KEY"
    ```
  </Tab>
</Tabs>

## Next steps

<CardGroup cols={2}>
  <Card title="Environments" icon="flask-conical" href="/environments">
    Sandbox vs production and how API keys control routing.
  </Card>

  <Card title="TypeScript SDK" icon="js" href="/sdks/typescript">
    Type-safe SDK with built-in retries and error handling.
  </Card>

  <Card title="Error handling" icon="circle-exclamation" href="/errors">
    Error types, codes, and response format.
  </Card>

  <Card title="Data conventions" icon="ruler" href="/data-conventions">
    Amounts, currencies, phone formats, and timestamps.
  </Card>

  <Card title="Enterprise guide" icon="buildings" href="/enterprise/aggregators-large-merchants">
    Dedicated shortcodes, sub-merchants, and advanced routing.
  </Card>
</CardGroup>
