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

# Environments

> Understanding CashQ API sandbox and production environments

## Overview

The CashQ API provides two separate environments to support your development and production needs:

* **Sandbox**: For testing and development
* **Production**: For live transactions

## Environment Details

| Environment | Base URL                    | Purpose                 | Credentials                                                   |
| ----------- | --------------------------- | ----------------------- | ------------------------------------------------------------- |
| Sandbox     | `https://api.cashqbot.com/` | Testing and development | [Request via form](https://cashqkyc.typeform.com/to/ysRjOpwP) |
| Production  | Provided by support         | Live transactions       | Contact support                                               |

## Sandbox Environment

The sandbox environment is a complete testing environment that mirrors the production API. Use it to:

* Develop and test your integration
* Experiment with API features
* Test error handling
* Validate your implementation before going live

### Getting Sandbox Access

<Steps>
  <Step title="Request credentials">
    Fill out the [Sandbox Request Form](https://cashqkyc.typeform.com/to/ysRjOpwP)
  </Step>

  <Step title="Receive API key">
    You'll receive your sandbox API key via email within 24 hours
  </Step>

  <Step title="Start testing">
    Use the sandbox base URL: `https://api.cashqbot.com/`
  </Step>
</Steps>

### Sandbox Characteristics

<CardGroup cols={2}>
  <Card title="Isolated Data" icon="database">
    Data in sandbox is completely separate from production and won't affect live transactions.
  </Card>

  <Card title="Test Safely" icon="shield">
    Test all scenarios including errors and edge cases without risk.
  </Card>

  <Card title="Same Features" icon="copy">
    Sandbox mirrors production functionality for accurate testing.
  </Card>

  <Card title="No Real Money" icon="ban">
    All transactions in sandbox are simulated - no actual money moves.
  </Card>
</CardGroup>

## Production Environment

The production environment is for live transactions with real money transfers.

### Going Live

<Steps>
  <Step title="Complete sandbox testing">
    Thoroughly test your integration in the sandbox environment
  </Step>

  <Step title="Request production access">
    Contact [support@mycashq.com](mailto:support@mycashq.com) to request production credentials
  </Step>

  <Step title="Receive credentials">
    Our team will provide your production API key and base URL
  </Step>

  <Step title="Deploy">
    Update your application to use production credentials and go live
  </Step>
</Steps>

<Warning>
  **Production Environment Considerations**

  * All transactions involve real money
  * Errors can affect actual customer transfers
  * Ensure thorough testing in sandbox before going live
  * Monitor your production integration closely
  * Have error handling and logging in place
</Warning>

## Key Differences

### Data Isolation

<Tabs>
  <Tab title="Sandbox">
    * Test data only
    * Can be reset or modified freely
    * No impact on production
    * Safe for experimentation
  </Tab>

  <Tab title="Production">
    * Real customer data
    * Permanent records
    * Affects actual transactions
    * Requires careful handling
  </Tab>
</Tabs>

### Credentials

Each environment requires its own API key:

```bash theme={null}
# Sandbox
curl -X GET 'https://api.cashqbot.com/api/agent_balance' \
  -H 'API-KEY: sandbox_api_key_here'

# Production
curl -X GET 'https://production.url/api/agent_balance' \
  -H 'API-KEY: production_api_key_here'
```

<Info>
  **Important:** Data cannot be transferred between environments. You must manage data separately in each environment.
</Info>

## Best Practices

### Development Workflow

<Steps>
  <Step title="Start in sandbox">
    Begin all development and testing in the sandbox environment
  </Step>

  <Step title="Test thoroughly">
    Test all features, error cases, and edge scenarios
  </Step>

  <Step title="Validate integration">
    Ensure your integration handles all API responses correctly
  </Step>

  <Step title="Move to production">
    Only deploy to production after complete sandbox validation
  </Step>
</Steps>

### Configuration Management

Store environment-specific configuration separately:

```javascript theme={null}
// config.js
const config = {
  sandbox: {
    baseURL: 'https://api.cashqbot.com/',
    apiKey: process.env.CASHQ_SANDBOX_API_KEY
  },
  production: {
    baseURL: process.env.CASHQ_PRODUCTION_BASE_URL,
    apiKey: process.env.CASHQ_PRODUCTION_API_KEY
  }
};

const environment = process.env.NODE_ENV || 'sandbox';
module.exports = config[environment];
```

### Testing Checklist

Before moving to production, verify:

* [ ] All API endpoints work as expected
* [ ] Error handling is implemented
* [ ] Edge cases are handled properly
* [ ] Logging and monitoring are in place
* [ ] Security best practices are followed
* [ ] API keys are stored securely
* [ ] Timeout and retry logic is implemented

## Need Help?

<Card title="Contact Support" icon="envelope" href="mailto:support@mycashq.com" horizontal>
  Questions about environments or ready for production? Contact our support team.
</Card>
