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

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# Testen in de sandbox

> Richt de Whop SDK en Elements op de sandbox, maak test-API-sleutels en webhooks aan, simuleer betalingen met testkaarten en bekijk de beperkingen van de sandbox.

Whop biedt een sandboxomgeving waarmee je je integratie kunt testen zonder productiegegevens te beïnvloeden of echte betalingen te doen.

## Sandbox-URL's

| Omgeving | URL |
| - | - |
| Frontend | `https://sandbox.whop.com` |
| API | `https://sandbox-api.whop.com/api/v1` |

Maak je sandboxaccount en API-sleutels aan op [sandbox.whop.com](https://sandbox.whop.com).

## Configuratie van de software development kit

Geef de omgeving `Sandbox` door om de sandboxomgeving met de Whop SDK te gebruiken. Een omgeving benoemt elke host waarmee de SDK communiceert, zodat alle verzoeken in één keer naar de sandbox gaan.

```typescript TypeScript theme={null}
import { WhopClient, WhopEnvironment } from "@whop/sdk";

const client = new WhopClient({
	token: process.env["WHOP_API_KEY"],
	environment: WhopEnvironment.Sandbox,
});
```

```python Python theme={null}
import os
from whop_sdk import Whop, WhopEnvironment

client = Whop(
    token=os.environ.get("WHOP_API_KEY"),
    environment=WhopEnvironment.SANDBOX,
)
```

```ruby Ruby theme={null}
require "whop_sdk"

client = Whop_sdk::Client.new(
  token: ENV.fetch("WHOP_API_KEY"),
  environment: Whop_sdk::Environment::SANDBOX,
)
```

```rust Rust theme={null}
use whop_sdk::prelude::*;

let config = ClientConfig {
    token: Some(std::env::var("WHOP_API_KEY").unwrap()),
    base_url: "https://sandbox-api.whop.com/api/v1".to_string(),
    ..Default::default()
};
let client = Whop::new(config).expect("Failed to build client");
```

```go Go theme={null}
import (
    "os"

    whopsdk "github.com/whopio/whopsdk-go/v2"
    "github.com/whopio/whopsdk-go/v2/client"
    "github.com/whopio/whopsdk-go/v2/option"
)

client := client.NewWhop(
    option.WithToken(os.Getenv("WHOP_API_KEY")),
    option.WithEnvironment(whopsdk.Environments.Sandbox),
)
```

> [!NOTE]
>
> De omgeving `Sandbox` is toegevoegd in SDK 2.0. Richt de client op 1.x in plaats daarvan op `https://sandbox-api.whop.com/api/v1`: `baseUrl` in TypeScript, `base_url` in Python en Ruby, `option.WithBaseURL` in Go. TypeScript, Ruby en Go behouden die override in 2.0, maar daarmee gaat elk verzoek naar één host. Bewerkingen die een andere host moeten bereiken, worden dan geweigerd, dus gebruik `environment`. De Python-client van 2.0 heeft geen parameter `base_url`. De Rust SDK is nog steeds 1.x en behoudt `base_url`.

## Elements in de sandbox

Stel `environment` in wanneer je de SDK-instantie aanmaakt om [Whop Elements](https://docs.whop.com/nl/elements/latest/getting-started.md) op de sandbox te richten. Deze optie is de enige manier om te wijzigen waarheen de elements versturen wat een koper invoert.

De Elements-property voor het selecteren van een variant heet om compatibiliteitsredenen nog steeds `plan`.

```tsx React theme={null}
import { WhopElements, Payments, PaymentElement, BrandingElement } from "@whop/elements-react";
import { loadWhop } from "@whop/elements";

function App() {
	return (
		<WhopElements elements={loadWhop()} environment="sandbox">
			<Payments accountId="biz_xxxxxxxxxxxxx" plan="plan_xxxxxxxxxxxxx">
				<PaymentElement />
				<BrandingElement />
			</Payments>
		</WhopElements>
	);
}
```

```html JavaScript theme={null}
<script src="https://cdn.whop.com/elements/amber/elements.js" data-whop-elements></script>
<script type="module">
  const whop = window.WhopElements({ environment: "sandbox" });
  const payments = whop.payments.create({
    accountId: "biz_xxxxxxxxxxxxx",
    plan: "plan_xxxxxxxxxxxxx",
  });
  payments.create("payment").mount("#payment");
  payments.create("branding").mount("#branding");
</script>
```

## API-sleutels en webhooks

API-sleutels en webhooks werken in de sandbox hetzelfde als in productie:

* Maak API-sleutels aan op [sandbox.whop.com/dashboard/developer](https://sandbox.whop.com/dashboard/developer)
* Configureer webhooks om events uit de sandbox te ontvangen
* Gebruik dezelfde authenticatieheaders (`Authorization: Bearer YOUR_API_KEY`)

## Testkaarten

Gebruik de volgende testkaartnummers om betalingen in de sandbox te simuleren:

| Kaartnummer | Beschrijving |
| - | - |
| `4242 4242 4242 4242` | Geslaagde betaling |
| `4000 0000 0000 0002` | Geweigerde betaling |
| `4000 0000 0000 0341` | Het instellen van de kaart slaagt, maar de verwerker weigert latere afschrijvingen |
| `5385 3083 6013 5181` | Vereist 3D Secure (voer `Checkout1!` in op het 3DS-scherm) |

In productie bevat een geweigerde betaling een code van de kaartuitgever. [Weigeringscodes voor betalingen uitgelegd](https://docs.whop.com/nl/payments-and-billing/payment-issues/payment-decline-reasons.md) vermeldt wat elke code betekent.

Voor alle testkaarten:

* Gebruik een willekeurige vervaldatum in de toekomst (bijv. 12/34)
* Gebruik een willekeurige verificatiecode van 3 cijfers (bijv. 123)
* Gebruik een willekeurig factuuradres

Gebruik `4000 0000 0000 0341` om herstelflows te testen waarbij je een kaart
succesvol opslaat, maar een toekomstige afschrijving op die opgeslagen kaart mislukt.

## Betaalmethoden in de sandbox

Gebruik de [testkaarten](#test-cards) hierboven om kaartbetalingen te testen.

Deze methoden worden in de sandbox ook voltooid via de eigen testflow van elke provider: PayPal, Bancontact, iDEAL, Cash App Pay, Pix en Boleto.

Deze methoden worden nog niet ondersteund in de sandbox:

* Apple Pay en Google Pay
* Bankrekeningen (ACH)
* SEPA-incasso
* EU-bankoverschrijvingen en wire transfers
* Alipay, WeChat Pay en MobilePay

## Bekende beperkingen

> [!WARNING]
>
> De volgende functies zijn niet beschikbaar in de sandbox:

* Uitbetalingen
* Cryptostortingen en on-chain overboekingen
* Directe berichten en rolsynchronisatie in Discord
* Actuele zoekresultaten
* Sommige geplande taken en achtergrondtaken die in productie draaien, zoals fraudecontroles en samenvattingsmails


## Related topics

- [Kernconcepten van de Whop API](https://docs.whop.com/nl/developer/concepts.md)
- [Whop-plugin voor Claude Code](https://docs.whop.com/nl/developer/guides/plugins/claude-code.md)
- [Whop-plugin voor Grok Build](https://docs.whop.com/nl/developer/guides/plugins/grok.md)
