# Accept One-Time Crypto Payments

**How it Works:**

1. Create a **Checkout Session** using the API.
2. Redirect the customer to the hosted checkout page (`url` from API response).
3. Copperx handles on-chain payment tracking.
4. Copperx redirects the customer to `successUrl` or `cancelUrl` based on payment completion.
5. Optionally, receive payment status updates through webhooks.

\
**Example API Call:**

```bash
curl --request POST \
  --url https://api.copperx.dev/api/v1/checkout/sessions \
  --header 'Authorization: Bearer {API_KEY}' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "successUrl": "https://example.com/success",
    "cancelUrl": "https://example.com/cancel",
    "lineItems": {
      "data": [
        {
          "priceData": {
            "currency": "usdc",
            "unitAmount": "100000000",
            "productData": {
              "name": "Pro Plan",
              "description": "One-time access"
            }
          }
        }
      ]
    }
  }'
```

**Best Practices:**

* Validate the session’s status using API or webhooks.
* Use test mode and Copperx’s faucet for testing.
