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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.copperx.io/integrate-payments/accept-one-time-crypto-payments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
