> ## 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.

# Quickstart

> Create your first Payment Intent in minutes

## 1. Get your API key

Sign up at the [Crycket dashboard](https://dashboard.crycketpay.com) to get your API keys. You receive two keys:

| Key format          | Environment                               |
| ------------------- | ----------------------------------------- |
| `pk_live_<32chars>` | Production — real funds, real chains      |
| `pk_test_<32chars>` | Test mode — testnets, no real funds, free |

Use your test key during development. Both keys use the same base URL and code path.

## 2. Create a Payment Intent

A Payment Intent represents a single payment request. Create one by calling the API:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.crycketpay.com/v1/intents \
    -H "Authorization: Bearer pk_test_..." \
    -H "Content-Type: application/json" \
    -d '{
      "chain": "solana:5eykt4UsFv8P8NJdTREpY1vzqKq2Kvdp",
      "token": "USDC",
      "amount": "10.50",
      "requestor": "7xKXtg2...",
      "idempotencyKey": "order_982734",
      "metadata": { "orderId": "982734" }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.crycketpay.com/v1/intents', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer pk_test_...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      chain: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKq2Kvdp',
      token: 'USDC',
      amount: '10.50',
      requestor: '7xKXtg2...',
      idempotencyKey: 'order_982734',
      metadata: { orderId: '982734' },
    }),
  });

  const { intent } = await response.json();
  console.log(intent.id); // "pi_abc123..."
  ```
</CodeGroup>

The response includes the full Payment Intent object in `created` state.

## 3. Track the payment

Poll the intent status or use [webhooks](/guides/webhooks) to get notified on state transitions:

```bash theme={null}
curl https://api.crycketpay.com/v1/intents/pi_abc123... \
  -H "Authorization: Bearer pk_test_..."
```

The `state` field tells you where the payment is in its lifecycle:

| State       | Meaning                                                      |
| ----------- | ------------------------------------------------------------ |
| `created`   | Intent exists, no transaction submitted yet                  |
| `pending`   | Transaction broadcast, awaiting confirmation                 |
| `confirmed` | Sufficient confirmations — **user-facing completion signal** |
| `finalized` | Chain-level finality (background signal)                     |

## 4. Simulate in test mode

Use the simulate endpoint to test your integration 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" }'
```

<Tip>
  The simulate endpoint is only available with `pk_test_` keys. See the [testing guide](/guides/testing) for more details.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Payment intents" icon="money-bill-transfer" href="/concepts/payment-intents">
    Understand the full Payment Intent lifecycle and state machine.
  </Card>

  <Card title="SDK integration" icon="puzzle-piece" href="/sdk/overview">
    Add Crycket to your mobile app with the SDK.
  </Card>

  <Card title="Webhooks" icon="bell" href="/guides/webhooks">
    Set up real-time notifications for payment events.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/introduction">
    Explore all available endpoints.
  </Card>
</CardGroup>
