---
title: "Register Google Play purchase"
method: POST
path: "/google-play/purchases"
---

# Register Google Play purchase

`POST /google-play/purchases`

Use this endpoint to register a purchase made via Google Play Billing to initiate an asynchronous synchronization process. This process involves verifying the purchase with Google Play and updating the user's entitlement status in Cleeng's system. <br><br> Due to the time required for Google's verification, this operation is asynchronous. Upon successful registration, the API will return a `202` `Accepted` status with a unique `synchronizationId` in the response body. <br><br> You can then use the following methods to check the status of the synchronization process: <br><br> - **Polling:** Use the [`/purchases/synchronizations/{synchronizationId}`](https://developers.cleeng.com/reference/check-google-play-purchase-synchronization-status) endpoint to periodically retrieve the status. This endpoint provides a concise response with the essential status information. <br><br> - **Webhooks:** Subscribe to the [`inappPurchaseSyncResult`](https://developers.cleeng.com/docs/webhooks-in-app-purchase-topics#inapppurchasesyncresult) webhook to receive real-time updates on the synchronization status. The webhook payload (`WebhookSynchronizationStatus`) includes detailed information about the synchronization, including the `synchronizationId`, purchase details (`purchaseToken`, `packageName`, `cleengCustomerId`), `accessGranted`, `offerId`, and `result`.  <br><br> You can choose to use either the polling mechanism, the webhook, or both, depending on your needs. <br><br> The `cleengCustomerId` is used to identify the user in Cleeng's system and associate the purchase with their account. <br><br> **Important:** Requests to this endpoint are idempotent by `purchaseToken`. If a duplicate request is detected - whether a synchronization is already in progress or was already completed for the given `purchaseToken` - a `409 Conflict` error will be returned containing the existing `synchronizationId`.  <br><br> The `productType` field determines which Google Play API is used to verify the purchase:  <br> -`subscription` - uses `purchases.subscriptionsv2.get` <br><br> **Scope:** Only `subscription` is supported. One-time products are not supported - requests with any other `productType` are rejected with `400`. <br><br>Please note that **this endpoint can be authorized with a publisher (X-Publisher-Token) or JWT (Bearer) token**. Depending on how you integrate with Cleeng (directly or through middleware), use either a <<glossary:JWT>> or X-Publisher-Token header authorization. <br> <br> <span style="color:green">**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**.</span>

## Headers

- `Authorization` string
- `X-Publisher-Token` string
- `Correlation-Id` string
- `X-App-Version` string
- `X-Device-Id` string
- `X-Device-Type` string
- `X-User-Action` string

## Request body

- object
  - `cleengCustomerId` integer, required — Cleeng's unique identifier for the customer who made the purchase.
  - `purchaseToken` string, required — Google Play's unique purchase token for the purchase. This token is used to verify the purchase with Google Play and track its status in Cleeng's system.
  - `packageName` string, required — Android application package name (e.g., com.example.app). Used to identify the correct configuration profile for this publisher.
  - `productType` string, required — The type of Google Play product being purchased. Only `subscription` is supported; one-time products are not supported (`400` is returned for any other value).
  - `ipAddress` string — IP address of the customer who made the purchase. This information will be stored in the user's profile as the IP address of their latest activity. Accepted: IPv4, IPv6. <br><br> The parameter **is required** in backend intergrations (with middleware) to ensure the correct customer IP address (address of their latest activity) is stored

## Response `202`

202

## Other responses

- `400` — 400
- `409` — 409
- `422` — 422
- `500` — 500

---

[API](https://skmtc.net/cleeng/apis/mediastore-api.md) · [All operations](https://skmtc.net/cleeng/apis/mediastore-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cleeng/mediastore-api/versions/00cbfe7998a4/schema)
