---
title: "Create a purchase"
method: POST
path: "/users/{user_id}/purchases"
tags: ["Purchases"]
---

# Create a purchase

`POST /users/{user_id}/purchases`

Records a purchase for a user. Stripe and Paddle are the recommended paths when calling this
API directly; App Store and Play Store purchases normally flow through the Qonversion SDK and
rarely need to be POSTed manually.

Provide exactly one of `stripe_store_data`, `paddle_store_data`, `app_store_data`, or `play_store_data`.

## Path parameters

- `user_id` string, required

## Request body

- object
  - `currency` string, required — Three-letter ISO 4217 currency code (case-insensitive; normalised to uppercase server-side)
  - `price` string, required — Monetary amount (decimal string, e.g. "12.99")
  - `purchased` integer, required — Unix epoch seconds of the transaction
  - `stripe_store_data` StripeStoreData
    - `subscription_id` string, required — Stripe subscription identifier
    - `product_id` string, required — Stripe product identifier
  - `paddle_store_data` PaddleStoreData
    - `type` 'subscription' | 'non_recurring', required — Purchase type
    - `transaction_id` string, required — Paddle transaction identifier. Always present.
    - `subscription_id` string — Paddle subscription identifier. Required when `type` is `subscription`; omitted for `non_recurring` purchases.
    - `product_id` string, required — Paddle product identifier
  - `app_store_data` object — App Store transaction data. Use only when posting App Store purchases manually instead of via the SDK.
    - `transaction_id` string, required
    - `original_transaction_id` string, required
    - `product_id` string, required
    - `receipt` string — Base64-encoded App Store receipt
  - `play_store_data` object — Google Play transaction data. Use only when posting Play purchases manually instead of via the SDK.
    - `order_id` string, required
    - `purchase_token` string, required
    - `product_id` string, required
    - `type` 'subscription' | 'non_recurring', required

## Response `201`

Purchase created

- Purchase — The response echoes whichever store-data variant was provided in the request: exactly one of `stripe_store_data`, `paddle_store_data`, `app_store_data`, or `play_store_data` will be present.
  - `user_id` string, required — Qonversion User ID
  - `currency` string — Three-letter ISO 4217 currency code (uppercase)
  - `price` string — Monetary amount (decimal string)
  - `purchased` integer — Unix epoch seconds of the transaction
  - `stripe_store_data` StripeStoreData
    - `subscription_id` string, required — Stripe subscription identifier
    - `product_id` string, required — Stripe product identifier
  - `paddle_store_data` PaddleStoreData
    - `type` 'subscription' | 'non_recurring', required — Purchase type
    - `transaction_id` string, required — Paddle transaction identifier. Always present.
    - `subscription_id` string — Paddle subscription identifier. Required when `type` is `subscription`; omitted for `non_recurring` purchases.
    - `product_id` string, required — Paddle product identifier
  - `app_store_data` object — App Store transaction data. Echoed only when the purchase was created with `app_store_data`.
    - `transaction_id` string
    - `original_transaction_id` string
    - `product_id` string
    - `receipt` string — Base64-encoded App Store receipt
  - `play_store_data` object — Google Play transaction data. Echoed only when the purchase was created with `play_store_data`.
    - `order_id` string
    - `purchase_token` string
    - `product_id` string
    - `type` 'subscription' | 'non_recurring'

## Other responses

- `400` — Invalid data
- `401` — Unauthorized
- `404` — Returned when the user is not found (`User not found`) or when the referenced product cannot be located (`Qonversion product with the specified ID not found`).

---

[API](https://skmtc.net/qonversion/apis/qonversion-rest-api-v4.md) · [All operations](https://skmtc.net/qonversion/apis/qonversion-rest-api-v4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qonversion/qonversion-rest-api-v4/revisions/e3f72cf8951c/schema)
