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

# Send Stripe Purchases to Qonversion

To process purchases via Stripe, you need to create a Stripe Checkout Session on your server and send the purchase data to Qonversion after a successful payment.

## 1. Create a Checkout Session

Create a [Stripe Checkout Session](https://docs.stripe.com/api/checkout/sessions/create) on your server using the Stripe API. Refer to the [Stripe documentation](https://docs.stripe.com/checkout/quickstart) for detailed instructions.

## 2. Send Purchase to Qonversion

After a successful payment, retrieve the Stripe Session data and send the purchase information to Qonversion using the API:

```bash theme={null}
curl -X POST \
  https://api.qonversion.io/v3/users/{user_id}/purchases \
  -H "Authorization: Bearer {project_key}" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "USD",
    "price": "9.99",
    "stripe_store_data": {
      "subscription_id": "{stripe_subscription_id}",
      "product_id": "{qonversion_product_id}"
    }
  }'
```

Replace `{stripe_subscription_id}` with the Stripe subscription ID from the Checkout Session and `{qonversion_product_id}` with the product ID configured in Qonversion.

| Field                               | Source                           |
| ----------------------------------- | -------------------------------- |
| `currency`                          | `stripe_session.currency`        |
| `price`                             | `stripe_session.amount_total`    |
| `stripe_store_data.subscription_id` | `stripe_session.subscription.id` |
| `stripe_store_data.product_id`      | Your Stripe Product ID           |

### Getting the User ID

The `{user_id}` in the request URL is the Qonversion User ID. You can obtain it in two ways:

* **From the SDK** — call the `userInfo()` method and use the `qonversionId` property from the result. See [User Identifiers](/docs/user-identifiers) for details.
* **Via API** — create a user by calling `POST /v3/users/{id}`. See the API reference for details.

## Web SDK

If you are using Qonversion on the web, you can also use the [Qonversion Web SDK](/docs/web-sdk) to handle purchases.

See the full [Stripe Integration guide](/docs/stripe-integration) for details.
