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

# Sandbox

> Build and test your Kelviq integration without affecting production data or processing real payments

Kelviq's sandbox is a separate environment for development and testing. You can configure products and plans, create customers, exercise checkout flows, and test your integration without affecting your live organization or processing real payments.

## How isolation works

Sandbox and production use separate data and credentials.

| Resource | Sandbox behavior |
| - | - |
| Data | Products, plans, customers, subscriptions, and orders are isolated from production |
| API keys | Work only with sandbox hosts |
| Payments | Use test card details; no real charge is made |

This separation prevents development activity from changing live customer or billing data. Before launch, configure the resources your integration needs in production and replace all sandbox credentials and URLs.

## Get started

1. Sign in to the [Kelviq dashboard](https://app.kelviq.com).
2. Open the organization dropdown and click **Enter sandbox**.
3. Create the products, plans, prices, and other test data you need.
4. Open **Settings → API keys** and copy the sandbox key required by your integration.

> [!WARNING]
>
> Never use a production Server API Key in test code. Store Server API Keys in environment variables and use Client API Keys only in supported browser integrations.

## Connect to the sandbox API

Use the sandbox hosts with sandbox-scoped credentials:

| API | Sandbox base URL |
| - | - |
| Core API | `https://sandboxapi.kelviq.com/api/v1` |
| Edge API | `https://edge.sandboxapi.kelviq.com/api/v1` |

For example:

```bash theme={null}
curl https://sandboxapi.kelviq.com/api/v1/catalog/products/ \
  --header "Authorization: Bearer $KELVIQ_SANDBOX_SERVER_API_KEY" \
  --header "Accept: application/json"
```

Changing only the URL is not enough: the request must also use an API key created while the dashboard is in Sandbox mode.

## Use the sandbox with an SDK

Set `environment` to `sandbox` when initializing an official SDK.

```typescript Node.js theme={null}
import { Kelviq } from "@kelviq/node-sdk";

const client = new Kelviq({
  accessToken: process.env.KELVIQ_SANDBOX_SERVER_API_KEY,
  environment: "sandbox",
});
```

```python Python theme={null}
from kelviq_sdk import Kelviq

client = Kelviq.create_sync_client(
    access_token=KELVIQ_SANDBOX_SERVER_API_KEY,
    environment="sandbox",
)
```

```tsx React theme={null}
<KelviqProvider
  customerId="YOUR_TEST_CUSTOMER_ID"
  accessToken="YOUR_SANDBOX_CLIENT_API_KEY"
  environment="sandbox"
>
  {children}
</KelviqProvider>
```

See the [Node SDK](https://docs.kelviq.com/backend-integration/node-sdk.md), [Python SDK](https://docs.kelviq.com/backend-integration/python-sdk.md), or [frontend SDK guides](https://docs.kelviq.com/frontend-integration/react-sdk.md) for full setup instructions.

## Test checkout

Create a checkout in the sandbox and pay with a test card. Use any future expiration date and any CVC.

| Card number | Result |
| - | - |
| `4242 4242 4242 4242` | Successful payment |
| `4000 0000 0000 0002` | Declined payment |
| `4000 0025 0000 3155` | Payment requiring authentication |

For every other outcome, including specific decline reasons, disputes, refunds, wallets, SEPA Direct Debit and UPI, see [Test payments](https://docs.kelviq.com/guides/test-payments.md).

> [!WARNING]
>
> Do not enter a real card number in the sandbox.

After payment, confirm that the test order, customer, subscription, and entitlements have the expected state in Sandbox mode.

## Test a subscription renewal

> [!NOTE]
>
> To test renewals faster, ask [Kelviq support](mailto:hi@kelviq.com) to turn on Daily billing for your sandbox.

After Daily billing is enabled, use it to test a renewal without waiting for a monthly or yearly billing cycle.

1. Enter Sandbox mode in the Kelviq dashboard.
2. Open the test plan you want to use.
3. Under **Billing cycles**, select **Daily** and enter a test price.
4. Publish the plan.
5. Start a subscription with a sandbox test card.
6. After the next billing cycle, check the order, invoice, subscription status, and entitlements in Sandbox mode.

If you create the checkout session through the API, set `chargePeriod` to `DAILY`:

```json theme={null}
{
  "planIdentifier": "sandbox-renewal-test",
  "chargePeriod": "DAILY",
  "customerId": "test-customer-001",
  "successUrl": "https://example.com/billing/success"
}
```

## Can I test production with my own card?

Test in Sandbox or with a 100% discount code. A payment provider can flag your card if you pay yourself, even for a small amount.

Here's how:

* Keep payment and renewal testing in Sandbox.
* If you need to inspect the production checkout, [create a 100% discount code](https://docs.kelviq.com/product-catalog/discounts.md) so no real payment is collected.
* Check production credentials, URLs, and environment settings without completing a purchase.

## Prepare for production

Before accepting live payments:

1. Complete the required [business review and payout setup](https://docs.kelviq.com/getstarted/review-process.md).
2. Configure and publish your production products and plans.
3. Replace sandbox API keys with production API keys.
4. Replace sandbox base URLs or set each SDK's environment to `production`.
5. Run a final check that no sandbox credentials or hosts remain in your production configuration.

> [!TIP]
>
> Use clearly named variables such as `KELVIQ_SANDBOX_SERVER_API_KEY` and `KELVIQ_PRODUCTION_SERVER_API_KEY` to reduce the chance of mixing environments.


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