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

# Development

> Learn how to integrate with Mavapay API in a test environment

## Environment Overview

Mavapay provides two distinct environments for your integration:

### Staging Environment

The staging environment is designed for development and testing. Key characteristics:

* Base URL: `https://staging.api.mavapay.co/api/v1`
* Uses Bitcoin's Signet network for Lightning Network transactions
* All Lightning invoices are test invoices (prefixed with `lntbs`)
* Generated coins are not spendable or transferable
* Simulated bank transfers and mobile money transactions
* No real funds involved
* Test API keys required
* Webhook notifications work identically to production

### Production Environment

The production environment is for live transactions:

* Base URL: `https://api.mavapay.co/api/v1`
* Uses the main Bitcoin Lightning Network
* Real funds are involved
* Requires completed KYC verification
* Live bank transfers and mobile money transactions
* Production API keys required

<Warning>
  Never use production API keys in staging or staging API keys in production. Always test thoroughly in staging before moving to production.
</Warning>

## Getting Started with Staging

### Prerequisites

1. Create a sandbox [Mavapay account](https://staging.mavapay.co/create-account)
2. Get your [test API keys](/authentication)
3. Complete basic account setup

### Testing Features

#### Lightning Network Payments

* All invoices are generated on Bitcoin's Signet network
* Test invoices are prefixed with `lntbs`
* Example test invoice:

```text theme={null}
lntbs64740n1pney8wspp538tl6et3ez7lgfpqjx2n257zvg5d6kmk09ef6g927txgfuqq6x7q
```

#### Bank Transfers

Test different scenarios with:

* Mock bank account numbers
* Various response states (success/failure)
* Different currencies (NGN, KES, ZAR)

#### Mobile Money

Test mobile money features using:

* Test phone numbers
* Simulated provider responses
* All supported providers (M-PESA, etc.)

### Error Scenarios

The staging environment allows testing various error cases:

* Insufficient funds
* Network timeouts
* Rate limit exceeded
* Invalid API key
* Invalid request

## Webhooks in Staging

Webhook notifications work identically to production:

1. Configure your webhook URL in the [API reference](/api-reference/endpoint/webhook/register-webhook)
2. Receive notifications for all test transactions
3. Test your webhook handling code

<Tip>
  Use tools like [webhook.site](https://webhook.site) or [ngrok](https://ngrok.com) for local webhook testing.
</Tip>

## Moving to Production

Before going live:

1. Complete all integration testing in staging
2. Verify webhook handling
3. Complete KYC verification
4. Request production API keys
5. Update API endpoints to production URLs
6. Test with small amounts initially

## Support

Need help during development?

* Check our [API Reference](/api-reference)
* Join our [Discord community](https://discord.gg/w82z7DdTM9)
* Email support at [info@mavapay.co](mailto:info@mavapay.co)

<Note>
  The staging environment is reset periodically. Don't rely on staging data persistence for long-term testing.
</Note>
