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

# Introduction

> Start with the Moflay REST API base URL, authentication model, core resources, payment status flow, and supporting reference pages.

The Moflay API gives your backend direct access to M-Pesa payment, customer, and transaction workflows over HTTPS.

## Base URL

```text theme={null}
https://api.moflay.com/v1
```

## Authentication

Send your API key in the `Authorization` header:

```http theme={null}
Authorization: Bearer mof_test_your_api_key
```

Use a sandbox key for sandbox data and a production key for live data. The API key determines the business, environment, and permissions for the request.

## Core API areas

| Area             | Purpose                                                                   |
| ---------------- | ------------------------------------------------------------------------- |
| Express payments | Create M-Pesa Express STK push payment requests with `POST /v1/express`   |
| Payments         | Read the current status of a payment attempt with `GET /v1/payments/{id}` |
| Customers        | Create, update, list, and delete customer records                         |
| Transactions     | List transactions and fetch individual transaction records                |
| Webhooks         | Receive signed payment and customer events in your backend                |

## Payment status flow

1. Call `POST /v1/express`.
2. Store the returned `paymentId` and `transactionId`.
3. Use `GET /v1/payments/{id}` for status checks (this reads Moflay’s stored state; see [Payment statuses & outcomes](/payments/transaction-statuses)).
4. Use [Moflay webhooks](/webhooks/overview) for production-grade asynchronous status updates.

## Amounts

Send payment amounts as integer minor currency units. For example, `amount: 1000` means `KES 10.00`.

## Supporting behavior

* Cursor-based pagination for list endpoints
* Environment-specific API keys
* Permission-based access control
* Standardized JSON error responses
* Rate limit headers on public API responses

## Read next

* [Authentication](/api-reference/authentication)
* [Payment statuses & outcomes](/payments/transaction-statuses) (**Developer Docs → Payments**): Moflay statuses, Daraja codes, and webhooks
* [Errors](/api-reference/errors)
* [Daraja callbacks](/daraja/handling-callbacks)
* [Rate limits](/api-reference/rate-limit)
* [Pagination](/api-reference/pagination)
