Skip to Content
docs
API

Purchases

POST /v1/purchases. A shortcut that writes a $purchase event.

The body is a purchase plus player_id (or device_id). It is the same as sending a $purchase event with a revenue block through Ingest batch.

POST
/v1/purchases

Authorization

key
headerAuthorizationBearer <uc_pub_dev_…>

A development key (uc_pub_dev_…) from Settings ▸ Keys in the app. The playground only accepts development keys.

Request Body

application/json
  1. body

The revenue block of a $purchase event. POST /v1/purchases (and the SDKs' UC.Purchase / Uncorrelate.purchase) is sugar that accepts this object plus player_id and writes the $purchase event. The SDK sends what the store gave it, including the receipt. The server validates the receipt with Apple or Google asynchronously and writes the result as $purchase_validated (or $purchase_rejected); revenue charts count validated purchases by default. The client-reported price is kept for display but is never treated as truth. See docs/recipe/05-ingestion-and-sdks.md#receipts.

store*unknown
Value in"app_store""google_play""steam""web""other"
sku*string
transaction_id*string

Store transaction id. Dedup key for revenue: a transaction counts once, whatever the insert_id.

original_transaction_id?string

Subscriptions: ties renewals together.

kind?unknown
Default"consumable"
Value in"consumable""non_consumable""subscription""subscription_renewal""refund"
quantity?integer
Range1 <= value
Default1
price?number

Local price as the store showed it, in currency. Client-reported.

currency?string
Match^[A-Z]{3}$
is_sandbox?boolean
Defaultfalse
receipt?|||

What the store returned. A string is accepted as-is (base64 App Store receipt, StoreKit 2 JWS, or Play purchase token; the server detects which from store and the shape). The object forms are explicit and preferred.

player_id?string
Lengthlength <= 128
device_id?string
Lengthlength <= 128

Response Body

Accepted; validation is pending.

application/json
  1. response
insert_id?string
validation?"pending"
Value in"pending"
Example Request
curl -X POST 'https://ingest.uncorrelate.com/v1/purchases' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{  "player_id": "p_8812",  "store": "app_store",  "sku": "gems_pack_500",  "transaction_id": "2000000812345678",  "price": 4.99,  "currency": "USD",  "receipt": {    "jws": "eyJhbGciOiJFUzI1NiIsIng1YyI6WyJ..."  }}'
Example Response
{  "insert_id": "string",  "validation": "pending"}

Validation happens in the background; the result arrives as $purchase_validated or $purchase_rejected in the player's stream.