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

# Getting Your API Keys

> Learn how to obtain your secret API keys to start integrating with Yabetoo

# Introduction

Before you can integrate any Yabetoo Pay product or solution, you need to configure your development environment to obtain the OAuth 2.0 client identifier and secret credentials for both sandbox and production environments.

You exchange these credentials for an access token that authorizes your REST API calls. To test your web and mobile applications, you create sandbox accounts.

## Obtaining Your API Keys

To generate REST API credentials for the sandbox:

1. Create an account by clicking [here](https://app.yabetoopay.com).
2. You will then be invited to create a store.
3. You will find your API keys in the developer tab.

API keys are specific to each store and are strictly personal - you should never share them with third parties.

Your secret key allows you to interact with Yabetoo APIs.

> [!NOTE]
>
> Keep your API keys secure and never expose them in client-side code. Always
> use them on your server-side applications only.

## API Key Types

### Test Keys

* **Purpose**: For development and testing
* **Environment**: Sandbox
* **Transactions**: No real money processed
* **Prefix**: Usually starts with `test_`

### Live Keys

* **Purpose**: For production transactions
* **Environment**: Production
* **Transactions**: Real money processed
* **Prefix**: Usually starts with `live_`

## Restrict a Key to IP Addresses

A live secret key (`sk_live_`) can be limited to a list of IP addresses. A call coming from any other address is refused with `403` and the code `E_IP_NOT_ALLOWED`.

1. Open the developer tab of the dashboard, the key's menu, **Allowed IPs**.
2. Enter one IP address or CIDR per line (IPv4 or IPv6, 20 entries at most).
3. Confirm the operation (security verification).

* An empty list allows every address.
* Test keys and publishable keys are not affected.
* The change applies within 5 minutes at most: until then the previous list may still apply.
* Check your servers' outbound address before saving, an incorrect list blocks your disbursements.

> [!WARNING]
>
> If you change host or outbound address, add the new address before switching over.

## Security Best Practices

> [!WARNING]
>
> Your secret keys can perform any action on your account. Treat them like
> passwords: - Never share them publicly - Don't include them in client-side
> code - Use environment variables to store them - Rotate them regularly -
> Monitor their usage

### Environment Variables

Store your keys securely using environment variables:

```bash theme={null}
# .env file
YABETOO_TEST_SECRET_KEY=test_your_secret_key_here
YABETOO_LIVE_SECRET_KEY=live_your_secret_key_here
```

### Code Example

```php theme={null}
// PHP example
$secretKey = $_ENV['YABETOO_TEST_SECRET_KEY']; // Use test key for development
// $secretKey = $_ENV['YABETOO_LIVE_SECRET_KEY']; // Use live key for production

$yabetoo = new YabetooClient($secretKey);
```

## Making REST API Calls

Once you have your API keys, you can start making authenticated requests to the Yabetoo API. Include your secret key in the Authorization header:

```bash theme={null}
curl -X POST "https://buy.api.yabetoopay.com/v1/checkout/sessions" \
  -H "Authorization: Bearer your_secret_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "currency": "EUR",
    "success_url": "https://yoursite.com/success",
    "cancel_url": "https://yoursite.com/cancel"
  }'
```

## Next Steps

> [card] [Create Your First Checkout](https://docs.yabetoopay.com/en/payments/checkout-page/intro.md)
>
> Start accepting payments with our hosted checkout pages

> [card] [API Integration Guide](https://docs.yabetoopay.com/en/payments/api/overview.md)
>
> Build custom payment flows with our REST API

## Need Help?

If you encounter any issues obtaining your API keys or have questions about authentication:

* Check our [API Reference](https://docs.yabetoopay.com/en/api-reference/introduction.md) for detailed documentation
* Contact our developer support team
* Visit our [testing guide](https://docs.yabetoopay.com/en/developer-tools/test/overview.md) for sandbox usage tips


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.