# Test the WhatsApp API without paying: is there a sandbox or test mode?

_No, there is no sandbox: every template sent costs credits. But you can test almost everything at very low cost: ping, reads, template creation and replies within 24 h charge nothing or almost nothing, and a refused send costs nothing._

Keywords: sandbox, test mode, test without paying, free trial, test environment, free credits, test the API, development, API testing, send to my own number, ping, test key, free, postman, test the webhook

## Scenario

You are integrating the API and want to try your calls before spending. You look for a "sandbox" or "test" mode. **There is none.** No flag switches sends to fake: a template sent really reaches the recipient and really charges your credits. A new account starts at zero credits, with no trial credits offered.

What you can do is test almost everything for almost nothing.

## What costs nothing

| Call | Charge |
|---|---|
| `GET /v1/ping`: is the key valid? | None |
| `GET /v1/balance`, `/v1/pricing`, `/v1/numbers`, `/v1/templates`, `/v1/logs` | None |
| `POST /v1/templates`: create a template (and see it approved or rejected) | None at Geskap |
| `GET /v1/messages/inbound`: read received messages back | None |
| A send refused before the charge (missing variable, template not approved, wrong `from`) | None |
| A send Meta refuses (`502`) | Refunded |

## The cheapest test path

```text
1. GET /v1/ping                       the key works
2. POST /v1/templates                 create your template, wait for APPROVED (no charge)
3. From YOUR phone, write to the connected number
                                      → a message.inbound reaches your webhook, the 24 h window opens
4. POST /v1/messages/reply            answer within 24 h (reduced rate)
5. POST /v1/messages/interactive      test buttons and lists in the same window
6. POST /v1/messages (template)       a single send, to a number you control
```

```bash
# curl
curl -X GET "https://wa-api.geskap.com/v1/ping" \
  -H "Authorization: Bearer $GESKAP_API_KEY"
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/ping", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/ping");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
  ],
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "GET",
    "https://wa-api.geskap.com/v1/ping",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    timeout=15,
)
print(res.status_code, res.json())
```

Steps 4 and 5 use the free-form reply: its rate is 1 credit per 4 messages by default, and its charge **never blocks**, even at a zero balance (it charges 0 if the balance is not enough). You can therefore test a whole conversation, buttons included, without having bought credits. See [Cost of a message](https://console.geskap.com/docs/cout-d-un-message?lang=en).

## Testing a template send at the lowest cost

Step 6 is the only one that really costs. Read the price first: `GET /v1/pricing`, then the smallest pack: `GET /v1/credits/packs`. Send **once**, to a number you control, with an `idempotency_key`: if your test replays, nothing is resent or charged again (see [Never send twice](https://console.geskap.com/docs/idempotence?lang=en)).

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/messages" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+237690000001",
  "idempotency_key": "test-001",
  "template": {
    "name": "rappel_rdv",
    "language": "fr",
    "variables": ["Awa", "demain 9 h"]
  }
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+237690000001",
    "idempotency_key": "test-001",
    "template": {
      "name": "rappel_rdv",
      "language": "fr",
      "variables": ["Awa", "demain 9 h"]
    }
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/messages");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "to" => "+237690000001",
    "idempotency_key" => "test-001",
    "template" => [
      "name" => "rappel_rdv",
      "language" => "fr",
      "variables" => ["Awa", "demain 9 h"],
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/messages",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "to": "+237690000001",
        "idempotency_key": "test-001",
        "template": {
            "name": "rappel_rdv",
            "language": "fr",
            "variables": ["Awa", "demain 9 h"],
        },
    },
    timeout=15,
)
print(res.status_code, res.json())
```

Meta may also bill the send on your Meta account: see [Cost of a message](https://console.geskap.com/docs/cout-d-un-message?lang=en).

## Testing your webhook

There is no test event made by the API. Two ways:

- send a real WhatsApp message to your number and watch `message.inbound` arrive (the address must be HTTPS: in development, expose your machine through an HTTPS tunnel);
- build a signed call to your server yourself, with your webhook's secret (see [Verify a webhook signature](https://console.geskap.com/docs/webhook-verifier-signature?lang=en)).

`GET /v1/logs?category=webhook` shows your server's answer to every `message.inbound` attempted.

## Tools

The Postman collection (`GET /v1/postman.json`, no key) loads every call. For a test that cannot hurt production, create a key dedicated to trials (see [Restricted API key](https://console.geskap.com/docs/cle-api-restreinte?lang=en)) and revoke it afterwards.

> **Pitfall:** "no sandbox" means **every** template sent is real: it reaches the recipient. Never test with a list of real customers.

> **Pitfall:** the free-form reply only works if the test number wrote to you in the last 24 h. Otherwise: `400` "Hors de la fenêtre de 24h". Write to it first from your phone.

> **Pitfall:** an account at zero credits can test free-form replies, but not templates: they answer `402` "Solde de crédits insuffisant".

_Proof — verified in the API source: public_api.py, console_api.py, api_send.py, api_credits.py, dev_api_docs.py._

---

# Tester l'API WhatsApp sans payer : existe-t-il un mode sandbox ou test ?

_Non, il n'y a pas de sandbox : chaque template envoyé coûte des crédits. Mais vous pouvez tout tester à très bas coût : ping, lecture, création de templates et réponses dans les 24 h ne débitent rien ou presque, et un envoi refusé ne coûte rien._

Mots-clés: sandbox, mode test, tester sans payer, essai gratuit, environnement de test, crédits gratuits, tester l'API, développement, test de l'API, envoyer à mon propre numéro, ping, clé de test, gratuit, postman, tester le webhook

## Scénario

Vous intégrez l'API et vous voulez essayer vos appels avant de dépenser. Vous cherchez un mode « sandbox » ou « test ». **Il n'y en a pas.** Aucun drapeau ne bascule les envois en faux : un template envoyé part vraiment chez le destinataire et débite vraiment vos crédits. Un compte neuf démarre à zéro crédit, sans crédits d'essai offerts.

Ce que vous pouvez faire, c'est tester presque tout pour presque rien.

## Ce qui ne coûte rien

| Appel | Débit |
|---|---|
| `GET /v1/ping` : la clé est-elle valable ? | Aucun |
| `GET /v1/balance`, `/v1/pricing`, `/v1/numbers`, `/v1/templates`, `/v1/logs` | Aucun |
| `POST /v1/templates` : créer un template (et le voir approuvé ou refusé) | Aucun chez Geskap |
| `GET /v1/messages/inbound` : relire les messages reçus | Aucun |
| Un envoi refusé avant le débit (variable manquante, template non approuvé, mauvais `from`) | Aucun |
| Un envoi que Meta refuse (`502`) | Remboursé |

## Le parcours de test le moins cher

```text
1. GET /v1/ping                       la clé marche
2. POST /v1/templates                 créez votre template, attendez APPROVED (aucun débit)
3. Depuis VOTRE téléphone, écrivez au numéro connecté
                                      → un message.inbound arrive sur votre webhook, la fenêtre de 24 h s'ouvre
4. POST /v1/messages/reply            répondez dans les 24 h (tarif réduit)
5. POST /v1/messages/interactive      testez boutons et listes dans la même fenêtre
6. POST /v1/messages (template)       un seul envoi, vers un numéro que vous contrôlez
```

```bash
# curl
curl -X GET "https://wa-api.geskap.com/v1/ping" \
  -H "Authorization: Bearer $GESKAP_API_KEY"
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/ping", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/ping");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
  ],
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "GET",
    "https://wa-api.geskap.com/v1/ping",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    timeout=15,
)
print(res.status_code, res.json())
```

Les étapes 4 et 5 utilisent la réponse libre : son tarif est de 1 crédit pour 4 messages par défaut, et son débit **ne bloque jamais**, même à solde nul (il charge 0 si le solde ne suffit pas). Vous pouvez donc tester toute une conversation, boutons compris, sans avoir acheté de crédits. Voir [Coût d'un message](https://console.geskap.com/docs/cout-d-un-message).

## Tester l'envoi d'un template au moindre coût

L'étape 6 est la seule qui coûte vraiment. Lisez d'abord le prix : `GET /v1/pricing`, puis le plus petit pack : `GET /v1/credits/packs`. Envoyez **une** fois, à un numéro que vous contrôlez, avec une `idempotency_key` : si votre test se rejoue, rien n'est renvoyé ni redébité (voir [Ne jamais envoyer deux fois](https://console.geskap.com/docs/idempotence)).

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/messages" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+237690000001",
  "idempotency_key": "test-001",
  "template": {
    "name": "rappel_rdv",
    "language": "fr",
    "variables": ["Awa", "demain 9 h"]
  }
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/messages", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+237690000001",
    "idempotency_key": "test-001",
    "template": {
      "name": "rappel_rdv",
      "language": "fr",
      "variables": ["Awa", "demain 9 h"]
    }
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/messages");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "to" => "+237690000001",
    "idempotency_key" => "test-001",
    "template" => [
      "name" => "rappel_rdv",
      "language" => "fr",
      "variables" => ["Awa", "demain 9 h"],
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/messages",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "to": "+237690000001",
        "idempotency_key": "test-001",
        "template": {
            "name": "rappel_rdv",
            "language": "fr",
            "variables": ["Awa", "demain 9 h"],
        },
    },
    timeout=15,
)
print(res.status_code, res.json())
```

Meta peut aussi facturer l'envoi sur votre compte Meta : voir [Coût d'un message](https://console.geskap.com/docs/cout-d-un-message).

## Tester votre webhook

Il n'y a pas d'événement de test fabriqué par l'API. Deux moyens :

- envoyer un vrai message WhatsApp à votre numéro et regarder arriver `message.inbound` (l'adresse doit être en HTTPS : en développement, exposez votre poste par un tunnel HTTPS) ;
- fabriquer vous-même un appel signé vers votre serveur, avec le secret de votre webhook (voir [Vérifier la signature d'un webhook](https://console.geskap.com/docs/webhook-verifier-signature)).

`GET /v1/logs?category=webhook` montre la réponse de votre serveur à chaque `message.inbound` tenté.

## Outils

La collection Postman (`GET /v1/postman.json`, sans clé) charge tous les appels. Pour un test sans risque pour la production, créez une clé dédiée aux essais (voir [Clé API restreinte](https://console.geskap.com/docs/cle-api-restreinte)) et révoquez-la après.

> **Piège :** « pas de sandbox » veut dire que **chaque** template envoyé est réel : il part chez le destinataire. Ne testez jamais avec une liste de vrais clients.

> **Piège :** la réponse libre ne marche que si le numéro de test vous a écrit dans les dernières 24 h. Sinon : `400` « Hors de la fenêtre de 24h ». Écrivez-lui d'abord depuis votre téléphone.

> **Piège :** un compte à zéro crédit peut tester les réponses libres, mais pas les templates : ils répondent `402` « Solde de crédits insuffisant ».

_Preuve — vérifié dans le code de l'API : public_api.py, console_api.py, api_send.py, api_credits.py, dev_api_docs.py._

Support: WhatsApp +237 6 56 09 88 31 · All recipes: https://wa-api.geskap.com/llms.txt
