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

# Testing

> Develop and test your integration without real funds

Crycket provides a full test mode for developing and debugging your integration without moving real funds.

## Test mode API keys

Use your `pk_test_` API key for test mode. Test and live mode use the same base URL (`https://api.crycketpay.com/v1`) and the same code path — test mode routes to testnets automatically.

| Key format          | Environment | Chains                                      |
| ------------------- | ----------- | ------------------------------------------- |
| `pk_live_<32chars>` | Production  | Solana mainnet, Base mainnet, Tempo mainnet |
| `pk_test_<32chars>` | Test mode   | Solana devnet, Base Sepolia, Tempo Moderato |

## Simulating state transitions

The simulate endpoint lets you force state transitions without waiting for real chain confirmations:

```bash theme={null}
curl -X POST https://api.crycketpay.com/v1/test/intents/pi_abc123.../simulate \
  -H "Authorization: Bearer pk_test_..." \
  -H "Content-Type: application/json" \
  -d '{ "targetState": "confirmed" }'
```

### Available transitions

| Target state | Description                             |
| ------------ | --------------------------------------- |
| `confirmed`  | Simulate a successful confirmation      |
| `failed`     | Simulate an on-chain failure            |
| `expired`    | Simulate TTL expiry                     |
| `dropped`    | Simulate a dropped transaction (Solana) |

### Failure reasons

When simulating a `failed` state, you can optionally specify a reason:

```json theme={null}
{
  "targetState": "failed",
  "failureReason": "insufficient_balance"
}
```

Available reasons: `insufficient_balance`, `revert`, `slippage`.

## Test chain endpoints

| Chain  | Testnet RPC                      |
| ------ | -------------------------------- |
| Solana | `https://api.devnet.solana.com`  |
| Base   | `https://sepolia.base.org`       |
| Tempo  | `https://rpc.moderato.tempo.xyz` |

## Webhooks in test mode

Webhooks fire in test mode the same way they do in production. The `livemode` field in the webhook payload is `false` for test events, letting your server distinguish between test and live traffic.
