# Cleeng Documentation > Documentation for Cleeng ## Guides - [Launch Subscriptions](https://developers.cleeng.com/docs/launch-subscriptions.md): Start here to get your web checkout, authentication, account and customer care flows live using Cleeng's Hosted Customer Flows on the first day. - [Extend Your Integration](https://developers.cleeng.com/docs/extend-your-integration.md): Week 1 Enhancements. Build on your MVP with minimal-code dashboard configurations. - [Scale Your Integration](https://developers.cleeng.com/docs/scale-your-integration.md): Month 1 Expansion. Take your fully configured web setup to the next level by implementing the advanced, technical tracks required to scale your business. - [Integration Approaches](https://developers.cleeng.com/docs/getting-started-with-cleeng.md) - [Build with LLMs](https://developers.cleeng.com/docs/build-with-llms.md) - [Setting Up Your Development Environment](https://developers.cleeng.com/docs/setting-up-your-development-environment.md) - [Quick Start](https://developers.cleeng.com/docs/quick-start.md) - [Cleeng Sandbox](https://developers.cleeng.com/docs/cleeng-sandbox.md) - [Implementing Hosted Customer Flows](https://developers.cleeng.com/docs/implementing-hosted-customer-flows.md): This guide introduces Cleeng Hosted Customer Flows, outlines the available hosted widgets and global communication methods, and links to the dedicated implementation guides. - [Checkout Hosted Widget ](https://developers.cleeng.com/docs/checkout-hosted-widget.md): This guide illustrates the setup and implementation of the Checkout Hosted Widget, focusing on embedding the widget, user authentication options, and advanced checkout features. - [Auth Hosted Widget](https://developers.cleeng.com/docs/auth-hosted-widget.md): This guide explains the setup and implementation of the Auth Hosted Widget, focusing on embedding the widget, managing user registration and login, and handling password resets. - [Account Hosted Widget ](https://developers.cleeng.com/docs/account-hosted-widget.md): This guide explains the implementation of the Account Hosted Widget, focusing on embedding the widget, configuring account sections, and handling external authentication. - [Customer Care Hosted Widget](https://developers.cleeng.com/docs/customer-care-hosted-widget.md): This guide covers how to embed the Customer Care Hosted Widget into a web application and how to use the message events it emits to respond to its lifecycle and user interactions. - [Redeem Gift Hosted Widget ](https://developers.cleeng.com/docs/redeem-gift-hosted-widget.md): This guide explains how to embed the Redeem Gift Hosted Widget into a web application, including prerequisites, integration steps, optional external authentication configuration, gift redemption flows, and testing. - [Cleeng Hosted Widgets: Global Communication Methods](https://developers.cleeng.com/docs/cleeng-hosted-widgets-global-communication-methods.md): This guide explains how Cleeng Hosted Widgets communicate with your website to share authentication state and UI events, such as checkout and payment updates. - [Hosted Widgets: Retrieving Customer Details](https://developers.cleeng.com/docs/hosted-widgets-retrieving-customer-details.md): This guide explains how to extract authentication data from Cleeng hosted widgets and use it to fetch customer details via the MediaStore API. - [Implementing Offer Pricing Page](https://developers.cleeng.com/docs/implementing-offer-pricing-page.md) - [Implementing Mobile Apps](https://developers.cleeng.com/docs/payments_on_mobile_tv_apps_intro.md) - [Apple In-App Purchase - SK2](https://developers.cleeng.com/docs/apple-in-app-purchase-storekit-2.md): This tutorial will help you integrate Apple in-app purchases using the StoreKit 2 framework. - [Android [Deprecated]](https://developers.cleeng.com/docs/android.md) - [Google Play Billing](https://developers.cleeng.com/docs/google-play-billing.md) - [Restoring In-App Purchases](https://developers.cleeng.com/docs/restoring-in-app-purchases.md): Restore a customer's in-app purchase so their Cleeng entitlement is reinstated after they reinstall your app or sign in on a new device with an existing account. - [Unlocking Content with Entitlements](https://developers.cleeng.com/docs/unlocking-content-with-entitlements.md): This article explains how to unlock content for your subscribers with Cleeng entitlements. - [Entitlements - Example Code Snippets ](https://developers.cleeng.com/docs/entitlements-example-code-snippets.md) - [Migrating to Cleeng](https://developers.cleeng.com/docs/migrating-to-cleeng.md) - [Testing and Debugging](https://developers.cleeng.com/docs/testing-and-debugging.md) - [Load Testing Online Video Platform](https://developers.cleeng.com/docs/load-testing-online-video-platform.md) - [Testing Recurring Payments](https://developers.cleeng.com/docs/testing-recurring-payments.md) - [Integration Hub Overview](https://developers.cleeng.com/docs/integration-hub-overview.md) - [Identity Management](https://developers.cleeng.com/docs/identity-management-sso.md) - [Device Login Flow (PIN Pair)](https://developers.cleeng.com/docs/device-login-flow-pin-pair.md) - [Google reCAPTCHA](https://developers.cleeng.com/docs/fraud-prevention-solution-with-google-recaptcha.md) - [Fraud prevention with Google reCAPTCHA for MediaStore API](https://developers.cleeng.com/docs/fraud-prevention-solution-with-google-recaptcha-mediastore-api.md) - [Fraud prevention with Google reCAPTCHA for MediaStore Components](https://developers.cleeng.com/docs/fraud-prevention-solution-with-google-recaptcha-mediastore-components.md) - [Integrating with Auth0 [Early Access]](https://developers.cleeng.com/docs/integrating-with-auth0.md) - [Data](https://developers.cleeng.com/docs/data-ingestion-export.md) - [Payment](https://developers.cleeng.com/docs/payment.md) - [Adding a Payment Connector](https://developers.cleeng.com/docs/adding-a-payment-connector.md) - [Prerequisites](https://developers.cleeng.com/docs/prerequisites-1.md) - [Subscription Initial Purchase](https://developers.cleeng.com/docs/subscription-initial-purchase.md) - [Subscription Recurring Billing](https://developers.cleeng.com/docs/subscription-recurring-billing.md) - [Cleeng-Managed Purchases - Recurring Billing](https://developers.cleeng.com/docs/cleeng-managed-recurring-billing.md) - [Externally-Managed Purchases - Recurring Billing](https://developers.cleeng.com/docs/externally-managed-recurring-billing.md) - [Update Payment Details](https://developers.cleeng.com/docs/update-payment-details.md) - [Connector Checklist](https://developers.cleeng.com/docs/connector-checklist.md): Once you have followed all the steps for **[adding a payment connector](https://developers.cleeng.com/docs/adding-a-payment-connector)**, use the checklist below to make sure the necessary functions are supported. - [Reference Materials](https://developers.cleeng.com/docs/reference-materials.md) - [Multi-Channel Billing](https://developers.cleeng.com/docs/multi-channel-billing.md) - [Multi-Channel Billing Use Cases](https://developers.cleeng.com/docs/multi-channel-billing-use-cases.md) - [Integrating Multi-Channel Billing](https://developers.cleeng.com/docs/integrating-multi-channel-billing.md) - [Externally-Managed Subscriptions](https://developers.cleeng.com/docs/externally-managed-subscriptions.md) - [Externally-Managed Passes](https://developers.cleeng.com/docs/externally-managed-passes.md) - [Payments on TV Apps](https://developers.cleeng.com/docs/payments-on-tv-apps.md) - [Amazon FireTV](https://developers.cleeng.com/docs/amazon-firetv.md) - [Roku](https://developers.cleeng.com/docs/roku.md) - [Samsung TV](https://developers.cleeng.com/docs/samsung-tv-integration.md): This tutorial will help you integrate purchases made via Samsung TV. - [Vizio](https://developers.cleeng.com/docs/vizio.md): This tutorial will help you integrate purchases made via Vizio. - [Marketing](https://developers.cleeng.com/docs/marketing-and-communications.md) - [Braze](https://developers.cleeng.com/docs/braze.md) - [Subscription Lifecycle Flows](https://developers.cleeng.com/docs/subscription-lifecycle-flows.md) - [Webhooks Overview](https://developers.cleeng.com/docs/webhook-overview.md) - [Webhooks Configuration](https://developers.cleeng.com/docs/webhooks-configuration.md) - [Webhook Topics](https://developers.cleeng.com/docs/webhook-topics-overview.md) - [Webhook - General Topics](https://developers.cleeng.com/docs/webhook-topics.md) - [Webhooks - Offer Topics](https://developers.cleeng.com/docs/webhooks-offer-topics.md) - [Webhook - Subscription Topics](https://developers.cleeng.com/docs/webhook-subscription-topics.md) - [Webhook - Pass Topics [Early Access]](https://developers.cleeng.com/docs/webhook-pass-topics.md) - [Webhooks - In-App Purchase Topics](https://developers.cleeng.com/docs/webhooks-in-app-purchase-topics.md) - [Webhooks - In-App Purchase Validation](https://developers.cleeng.com/docs/webhooks-in-app-purchase-validation.md) - [Dunning Action Settings](https://developers.cleeng.com/docs/dunning-action-settings.md) - [Implementing Web Checkout (react.js)](https://developers.cleeng.com/docs/implementing-web-checkout-reactjs.md) - [Integration Guide](https://developers.cleeng.com/docs/components-integration-guide.md) - [Payment Configuration](https://developers.cleeng.com/docs/payment-configuration.md) - [MediaStore SDK Components Library](https://developers.cleeng.com/docs/components-library.md) - [Translations](https://developers.cleeng.com/docs/translations.md) - [One-Click Coupons](https://developers.cleeng.com/docs/one-click-coupons.md): To optimize further your coupon campaigns or grant free access for the so-called VIP checkouts, you can apply one-click coupons. - [Gift Subscriptions Setup via Components](https://developers.cleeng.com/docs/gift-subscriptions-setup-via-mediastore-components.md) - [Purchase Flow via API](https://developers.cleeng.com/docs/identity-management-1.md) - [Identity Management](https://developers.cleeng.com/docs/registration.md) - [Offer Display (Web)](https://developers.cleeng.com/docs/offer-display.md) - [Checkout Implementation (Web)](https://developers.cleeng.com/docs/payments-overview.md) - [Adyen Payment Setup](https://developers.cleeng.com/docs/extended-adyen-payment-setup.md) - [Merchant Payment Methods Filtering](https://developers.cleeng.com/docs/merchant-payment-methods-filtering.md) - [PayPal Payment Setup](https://developers.cleeng.com/docs/paypal-payment-setup.md) - [Payment-free Setup](https://developers.cleeng.com/docs/payment-free-setup.md) - [Gift Subscriptions Setup via API](https://developers.cleeng.com/docs/gift-subscriptions-setup-via-mediastore-api.md): Follow the steps to implement [gift subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/11005568853404-Gift-Subscriptions) with MediaStore SDK API. - [My Account (Web) via API](https://developers.cleeng.com/docs/my-account-1.md) - [Current Plan Setup](https://developers.cleeng.com/docs/current-plan-setup.md) - [Payment Information](https://developers.cleeng.com/docs/payment-information.md) - [User Profile Management](https://developers.cleeng.com/docs/user-profile-management.md) - [User Support](https://developers.cleeng.com/docs/viewer-support-1.md) - [Pause Setup via API ](https://developers.cleeng.com/docs/pause-setup-via-api.md) - [Single Sign-on (SSO)](https://developers.cleeng.com/docs/sso.md) - [Customer Anonymization](https://developers.cleeng.com/docs/customer-anonymization.md) - [Email Templates Customization](https://developers.cleeng.com/docs/email-templates-customization.md) - [Entitlements Caching](https://developers.cleeng.com/docs/entitlements-caching.md) - [Hi5 end-user authentication](https://developers.cleeng.com/docs/hi5-end-user-authentication.md) - [How to Create Introductory Offers](https://developers.cleeng.com/docs/how-to-create-introductory-offers.md) - [How to Create Add-On Offers](https://developers.cleeng.com/docs/how-to-create-add-on-offers.md): This guide provides a step-by-step approach to support add-on style purchasing in Cleeng using standard offers, custom offer parameters, entitlement checks, and storefront logic. - [How to Implement Automated Subscription and Pass Bundle](https://developers.cleeng.com/docs/how-to-implement-automated-subscription-and-pass-bundle.md): This guide explains how to create a bundle combining a recurring subscription with a fixed-term pass. ## API Reference - [API Reference Overview](https://developers.cleeng.com/reference/apireference-overview.md) - [Best Practices](https://developers.cleeng.com/reference/best-practices.md) - [API Caching](https://developers.cleeng.com/reference/api-caching.md) - [How to Understand and Resolve Common API Errors (401, 429)](https://developers.cleeng.com/reference/how-to-understand-and-resolve-common-api-errors-401-429.md) - [Register](https://developers.cleeng.com/reference/register.md): Use `/customers` endpoint to register user. After registration customer is related with your account and you will see him in Cleeng Dashboard > Customer Accounts. Customers are recognized in Cleeng by `customerId`, which is encoded in <>.
> đźš§ Important > > It is recommended that customerIP is passed as it is required for correct price calculation because tax rate depends on the country. If customerIP is NOT given, the price will be calculated for request source IP address. > > Please note that when using Cleeng Merchant, customerIP should be available for the purpose of proper tax calculation in the US and Canada. It is recommended that customerIP is passed in the register, [login](https://developers.cleeng.com/reference/login) and [create order](https://developers.cleeng.com/reference/create-order) methods. - [Login](https://developers.cleeng.com/reference/login.md): Use `/auths` endpoint to log in the user. Customer authorization is based on <>, which contains `customerId`, `publisherId` and `expiration date`. There are two ways of login, by `offerId` (if a customer has already chosen an offer) or by `publisherId` (in case a customer will choose an offer after authorization). - [Refresh token](https://developers.cleeng.com/reference/refresh-token.md): This endpoint can be used to grant a new JWT in order to extend user session. Refresh token passed in request body will be invalidated. A new JWT and a new refresh token will be returned in response. JWT is valid for 15 minutes and a refresh token is valid for 100 days. - [Fetch publisher consents](https://developers.cleeng.com/reference/fetch-publisher-consents.md): Use /publishers/:publisherId/consents to fetch publisher's consents. It returns the actual consensts version, label. Consents should be shown on the registration page to enable accept/decline it by customer. Customers shouldn't be redirected to the offer page if the required terms are not accepted. - [Update customer's consents](https://developers.cleeng.com/reference/update-customers-consents.md): Use `/customers/:customerId/consents` to set or update customer's consents.
This endpoint should be used just after registration (for checkout) or to enable consents management (myAccount).
There are two types of consents: required terms and conditions (Cleeng terms and your terms), and not required marketing consents (if enabled you). - [Update password](https://developers.cleeng.com/reference/update-password.md): Use /customers/passwords endpoint to save a new customer password, in case you defined a custom reset password page. - [Create order](https://developers.cleeng.com/reference/create-order.md): Use `/orders` endpoint to create an order. Orders are used to handle customers' payments of previously defined offers. Orders expire after 24 hours unless the payment is captured. **Payment method is required in order entity for payment but can be added in `update order` and fetch in `/payment-methods`.** **AUTHORIZATION** [Authorization](https://developers.cleeng.com/reference/getting-started#authorization) with <> is required. - [List campaigns](https://developers.cleeng.com/reference/msd-list-campaigns.md): This endpoint lets you list all your campaign details based on a coupon code. [Authorization](https://developers.cleeng.com/reference/getting-started#authorization) with <> is required. - [Get entitlements](https://developers.cleeng.com/reference/get-entitlements.md): This API allows you to check entitlements (access rights) of a customer to a given offer. Access is granted based on a purchased offer or tags (that are checked in the backend). Here you can check the [benefits of tagging offers](https://publisher.support.cleeng.com/hc/en-us/articles/226253648-Using-Tags-to-Build-Unique-Offers#benefits-of-using-tags).

If there are two or more subscriptions / passes for the same `offerId` for the same customer, it will return one object with the latest `expiresAt` date. - [Fetch offers](https://developers.cleeng.com/reference/fetch-offers.md): This endpoint lets you list all your offers that meet the requirements given in the API request. For example, it allows you to filter offers by offer type or offer status. Additional **response header:** **x-total-count**. It will show the number of offers. - [Fetch offer details](https://developers.cleeng.com/reference/fetch-offer-details.md): Use `/offers/:offerId` endpoint to get basic offer details.

This endpoint returns details of offer localizations matching a particular country or location. The country or location is determined based on the customer IP address.

You can query using the offer short ID - without a country suffix (e.g. S123123123) to dynamically retrieve details of the offer localization matching the current country of the user. You can query using the offer long ID - with country suffix e.g. (S123123123_US) to retrieve details of the offer localization for a particular country.

If you want to fetch offer details for a specific customer use [this endpoint](https://developers.cleeng.com/reference#fetch-offer-details-for-specific-customer).

**Note:**
Please note that this endpoint **will not return taxes for the USA and Canada**. Taxes will only be shown during the checkout process (they are returned in the order method: [Create order](https://developers.cleeng.com/reference/create-order) or [Get an order](https://developers.cleeng.com/reference/msd-get-order)). - [[V2] Fetch offer details](https://developers.cleeng.com/reference/v2-fetch-offer-details.md): Use `v2/offers/{offerId}` endpoint to get basic offer details. This endpoint returns also price rules for [seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions) (special price rules for initial purchase of a seasonal subscription that define promotional prices that a publisher wants to offer in certain periods (e.g. before the season begins or once the season is halfway through)). - [Get a gift](https://developers.cleeng.com/reference/get-a-gift.md): This endpoint retrieves details of a given gift that was previously purchased. - [Update a gift](https://developers.cleeng.com/reference/update-a-gift.md): This endpoint gives possibility to update delivery details of a given gift that was previously purchased. - [Verify a gift](https://developers.cleeng.com/reference/verify-a-gift.md): Use this endpoint to verify whether a gift code provided by the user is valid. The gift code has to be verified before a gift is redeemed. - [Redeem a gift](https://developers.cleeng.com/reference/redeem-a-gift.md): Use this endpoint to redeem a gift. A gift can be redeemed after a successful verification with [Verify a gift](https://developers.cleeng.com/reference/verify-a-gift) (GET /gifts/verification/{code}) endpoint. - [Get Adyen payment methods](https://developers.cleeng.com/reference/get-adyen-payment-methods.md): Use `/connectors/adyen/payment-methods` endpoint to query payment methods for payment with Adyen. This is required to render a front-end Drop-in component using [Adyen advanced flow](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=Web&integration=Drop-in&version=6.0.3). - [Payment with Adyen](https://developers.cleeng.com/reference/adyen-initial-payment.md): Use `/connectors/adyen/initial-payment` endpoint to perform payment with Adyen (that means payment with card with 3D Secure support, Apple Pay or Google Pay). - [Finalize payment with Adyen](https://developers.cleeng.com/reference/finalize-initial-payment.md): Use `/connectors/adyen/initial-payment/finalize` to finalize payments that require additional action from customers. If initial payment returns `action` object, call this endpoint to finalize payment. It is used for 3D Secure. - [Payment with PayPal Express Checkout](https://developers.cleeng.com/reference/payment-with-paypal-connector-v1.md): Use `/connectors/paypal/v1/tokens` endpoint to perform payment with Paypal Express Checkout. Payment is executed on PayPal site and after success / error / cancel customer is redirected to predefined routes. - [Android Payment [Deprecated]](https://developers.cleeng.com/reference/android-payment.md): **This endpoint is deprecated.**

Use this endpoint to notify Cleeng about the successful Android in-app payment (Initial Purchase) and create a subscription in Cleeng. **Note:** This endpoint uses <> for [authorization](https://developers.cleeng.com/reference/getting-started#authorization). - [Roku Payment](https://developers.cleeng.com/reference/roku-payment-ms.md): Use this endpoint to notify Cleeng about the successful Roku in-app payment (Initial Purchase) and create a subscription in Cleeng. **Note:** This endpoint uses <> for [authorization](https://developers.cleeng.com/reference/getting-started#authorization). - [Purchase without payment details](https://developers.cleeng.com/reference/payment-without-payment-details.md): Use `/payments` endpoint to perform purchase without payment details.
Use in cases:

- customer applied 100% coupon code and the publisher doesn't expect the payment details (option to set during coupon creation) - for this purchase flow, please use a payment method with a name “Manual” that has “Coupon” as payment gateway.
- offer is free and the publisher wants to give access to offer - for this purchase flow, please use a payment method with a name “Manual” that has “Free-offer” as payment gateway.

**Important Note**
It is crucial that an appropriate **payment method** is used during **order** creation (“Manual” with “Coupon” or “Free-offer” as payment gateway). While it’s possible to use any payment gateway in this checkout flow, we strongly recommend utilizing the above for reporting clarity. - [Fetch customer's data](https://developers.cleeng.com/reference/fetch-customers-data.md): Use `/customers/:customerId` endpoint to fetch customer's data. - [Update customer's data](https://developers.cleeng.com/reference/update-customers-data.md): Use `/customers/:customerId` endpoint to update customer's data like firstName, lastName or email. - [Fetch customer's subscriptions](https://developers.cleeng.com/reference/fetch-customers-subscriptions.md): Use `/customers/:customerId/subscriptions` endpoint to fetch customer's subscriptions. This endpoint lists all active and stopped subscriptions, but it doesn't return expired ones. You can find details about customer subscriptions here, like status, expiration date, price, payment method, or period. >**NOTE:** This API requires <> to run. It should be put in the request header. See more in [Authorization](https://developers.cleeng.com/reference/getting-started#authorization). - [Fetch customer's passes](https://developers.cleeng.com/reference/fetch-customers-passes.md): This endpoint returns passes for the provided customer. This endpoint lists only active passes (`status` = `active`).

**NOTE:** This API requires <> to run. It should be put in the request header. See more in [Authorization](https://developers.cleeng.com/reference/getting-started#authorization). - [Fetch customer's payment details](https://developers.cleeng.com/reference/fetch-customers-payment-details.md): Use `customers/:customerId/payment_details` endpoint to fetch a customer payment details. Payment details hold selected information (e.g. card expiration date) of the complete set of payment details or tokens to reference this data. - [Fetch customer's consents](https://developers.cleeng.com/reference/fetch-customers-consents.md): Use `/customers/:customerId/consents` to fetch customer's consents. Display fetched consents to enable consents management. This endpoint shows actual status of customer's consents. It returns useful information like: status (accepted/declined), is it required, is it the actual version of consents, the label for it. - [Fetch available switches](https://developers.cleeng.com/reference/fetch-available-switches.md): This endpoint returns all available offers to which a customer can switch from the current subscription in `available` array. Offers to which customer can't switch are returned in `unavailable` array with the reason why the switch is not possible. - [Apply coupon](https://developers.cleeng.com/reference/apply-coupon.md): Use this endpoint to apply coupon on existing subscription. The coupon previously has to be configured in **Cleeng Dashboard -> Offers & Coupons -> Coupon Management**. - [Add Adyen payment details](https://developers.cleeng.com/reference/adyen-add-payment-details.md): Use this method to add Adyen payment details (for example a card with 3D Secure support, Apple Pay or Google Pay), so that new payment details can be used for recurring payments. Example use case: a customer updates a card or wants to switch payment method to a card. Adding payment details may not be finished after calling this endpoint. If payment details were successfully added to Cleeng, you will receive the `paymentDetails` object. If there is an additional action needed, you will receive an `action` object. - [Finalize add Adyen payment details](https://developers.cleeng.com/reference/finalize-add-adyen-payment-details.md): Use `/connectors/adyen/payment-details/finalize` to finalize payments that require additional action from customers. It is used in 3D Secure. - [Delete payment details](https://developers.cleeng.com/reference/delete-payment-details.md): Use this method to delete payment details.

**Note:** Removing payment details that are attached to subscriptions will prevent those subscriptions from being renewed if a customer doesn't add new payment details. - [Pause subscription](https://developers.cleeng.com/reference/ms-pause-subscription.md): Use this endpoint to pause a subscription. You can only pause active and canceled subscriptions (you cannot pause in-trial or terminated subscriptions).

Transition from active state to pause is tied to subscription anniversary date (the pause will start with a new billing cycle). - [Resume subscription ](https://developers.cleeng.com/reference/ms-resume-subscription.md): Use this endpoint to resume a subscription from a scheduled pause or to immediately resume from the pause that is ongoing. With immediate resume from the pause which is in progress, a payment attempt is made and the customer is charged. - [SSO Login](https://developers.cleeng.com/reference/sso-login.md): **Important: This is an exception because, unlike other MediaStore SDK endpoints, this one requires `publisherToken` for authorization.** Use this endpoint to generate a customer <> for a customer who has been authenticated with a third-party Single Sign-on (SSO) provider without passing the credentials. This will enable the customer to use other MediaStore SDK features (e.g. Checkout or My Account) without the need to log in. The authentication takes place in the background. You can use this endpoint by itself for new customers. For existing customer accounts that you already have with a third-party identity provider, please remember to first set up corresponding customer accounts in Cleeng. You can create them via API or by migrating them. Calling this endpoint updates the customer’s `lastLoginDate` that you can check with the [Fetch customer's data](ref:fetch-customers-data) endpoint. If a customer IP address is also passed, `lastUserIP` field will be updated with this value. - [Getting Started With Core API](https://developers.cleeng.com/reference/api31.md) - [Dunning actions](https://developers.cleeng.com/reference/dunning-actions.md): Dunning is the process of retrying payment attempts and sending payment reminders to customers when a payment gets rejected. With Cleeng you can configure payment retries at intervals to ensure payment will be recovered and subscription can continue its cycles. Cleeng allows to setup retries and notifications in terms of subscription due to date, they can be set before and after up to what is your retries strategy. Cleeng as default gives you a smart retries setup that can guarantee an efficient recovery process. - [Create an order](https://developers.cleeng.com/reference/create-an-order.md): To create an order, you use orders resource. Order resources are used to handle customers' payments of previously defined offers. Orders expire after 24 hours unless the payment is captured. Payment method is required in order entity for payment but can be added in update order. > You should add `paymentOperation` and `subscriptionId` parameters for recurring orders. - [Get an order](https://developers.cleeng.com/reference/get-an-order.md): To get an order, you use publisher token and order id. Orders expire after 24 hours unless the payment is captured. - [Update an order](https://developers.cleeng.com/reference/31-update-an-order.md): To update an order, you use orders resource. Orders expire after 24 hours unless the payment is captured. - [Update a payment](https://developers.cleeng.com/reference/update-a-payment.md): To update a payment, you use payments resource. They are a reference of the actual payment that happens at the payment gateway. Payments handle customers' actual payments of previously defined order. - [Delete payment details](https://developers.cleeng.com/reference/31-delete-payment-details.md): Use this endpoint to delete a customer’s payment details (e.g. an expired credit card).

Please note that **removing payment details that are attached to subscriptions will prevent those subscriptions from being renewed**. [Update subscription](https://developers.cleeng.com/reference/update-subscription) endpoint can be used to assign other payment details to a subscription for best user experience.

**Important: Deletion is an irreversible process.** - [Register customer](https://developers.cleeng.com/reference/register-customer.md): Use this endpoint to register customers. - [List customers](https://developers.cleeng.com/reference/list-customers.md): This endpoint returns customers that match the requirements given in the API request. For example, it allows you to filter customers based on `externalId` or `email`.

**Note:** One of the parameters: either `externalId` or `email` is required.

The recommended limit for checking if a user is registered using an email address is: 1. - [Update customer](https://developers.cleeng.com/reference/update-customer.md): Use this endpoint to update a customer's data, for example first name, last name. - [Request password reset](https://developers.cleeng.com/reference/request-password-reset.md): Use this API to initiate the password reset flow, so that your customer can define a new password. Using this endpoint will trigger an email to the customer. The email contains a link which directs the customer to a password reset page on the web. - [Delete customer](https://developers.cleeng.com/reference/delete-customer.md): Use this endpoint to delete customer data (anonymize a <>) in Cleeng. Customer data is anonymized for reporting reasons, and also to comply with privacy legislation (such as GDPR).

The following personal customer data will be anonymized/deleted: email, password, first name, last name, address, company name, phone number, capture custom answers, IP addresses.

You **cannot** remove a customer’s data if the customer has an active entitlement (e.g. active subscription).

**Important: Please note that anonymization is an irreversible process.** - [Create an offer](https://developers.cleeng.com/reference/create-an-offer.md): Use this endpoint to create offers. Supported offer types include subscription (including [seasonal subscription](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions)), pass, live event (previously called live pay-per-view), and one-time purchase (previously called TVOD). (For more information on offers, see [What is a Cleeng offer?](https://publisher.support.cleeng.com/hc/en-us/articles/360012552919-What-is-a-Cleeng-offer-)). With this endpoint, you can also create offer localizations - versions of your offer for different countries and currencies. - [List offers](https://developers.cleeng.com/reference/list-offers.md): This endpoint lets you list all your offers that meet the requirements given in the API request. For example, it allows you to filter offers by offer type or offer status.

Additional **response header:** **x-total-count**. It will show the number of offers.

This endpoint supports [conditional requests](https://developers.cleeng.com/reference/api31#conditional-requests). - [Get an offer](https://developers.cleeng.com/reference/get-an-offer.md): Use this endpoint to get basic offer details.
This endpoint supports [conditional requests](https://developers.cleeng.com/reference/api31#conditional-requests). - [Update an offer](https://developers.cleeng.com/reference/update-an-offer.md) - [Activate an offer](https://developers.cleeng.com/reference/activate-an-offer.md): Use this endpoint to activate an offer.
This endpoint supports [conditional requests](https://developers.cleeng.com/reference/api31#conditional-requests). - [Deactivate an offer](https://developers.cleeng.com/reference/deactivate-an-offer.md): Use this endpoint to deactivate an offer.
This endpoint supports [conditional requests](https://developers.cleeng.com/reference/api31#conditional-requests). - [Create offer localization](https://developers.cleeng.com/reference/create-offer-localization.md) - [Activate offer localization](https://developers.cleeng.com/reference/activate-offer-localization.md): Use this endpoint to activate an offer localization.
This endpoint supports [conditional requests](https://developers.cleeng.com/reference/api31#conditional-requests). - [Deactivate offer localization](https://developers.cleeng.com/reference/deactivate-offer-localization.md): Use this endpoint to deactivate an offer localization.
This endpoint supports [conditional requests](https://developers.cleeng.com/reference/api31#conditional-requests). - [Update offer localization](https://developers.cleeng.com/reference/update-offer-localization.md) - [Create a season group](https://developers.cleeng.com/reference/create-a-season-group.md): Use this endpoint to create a season group (called seasonal schedule in the Cleeng dashboard setup) - a group of seasons, each with its start and end date defined.

Creating season groups enables you to manage and organize seasonal subscription offers effectively. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).) - [Update a season group](https://developers.cleeng.com/reference/update-a-season-group.md): Use this endpoint to update a season group (called seasonal schedule in the Cleeng dashboard setup) - a group of seasons, each with its start and end date defined. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).) - [List season groups](https://developers.cleeng.com/reference/list-season-groups.md): This endpoint lets you list all season groups.

A season group (called seasonal schedule in the Cleeng dashboard setup) is a group of seasons, each with its start and end date defined. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).) - [Get a season group](https://developers.cleeng.com/reference/get-a-season-group.md): Use this endpoint to retrieve a season group by ID.

A season group (called seasonal schedule in the Cleeng dashboard setup) is a group of seasons, each with its start and end date defined. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).) - [Delete a season group](https://developers.cleeng.com/reference/delete-a-season-group.md): Use this endpoint to delete a season group (called seasonal schedule in the Cleeng dashboard setup) - a group of seasons, each with its start and end date defined. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).)

**Important: Please note that deletion is an irreversible process.** - [Create a season in a season group](https://developers.cleeng.com/reference/create-a-season-in-a-season-group.md): Use this endpoint to create a season in a season group (called seasonal schedule in the Cleeng dashboard setup) - a group of seasons, each with its start and end date defined. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).) - [Update a season within a season group](https://developers.cleeng.com/reference/update-a-season-within-a-season-group.md): Use this endpoint to update a season in a season group (called seasonal schedule in the Cleeng dashboard setup) - a group of seasons, each with its start and end date defined. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).) - [Delete a season from a season group](https://developers.cleeng.com/reference/delete-a-season-from-a-season-group.md): Use this endpoint to delete a season from a season group (called seasonal schedule in the Cleeng dashboard setup) - a group of seasons, each with its start and end date defined. (For more information, see [Seasonal subscriptions](https://publisher.support.cleeng.com/hc/en-us/articles/9565373130268-Seasonal-Subscriptions).)

**Important: Please note that deletion is an irreversible process.** - [Subscriptions](https://developers.cleeng.com/reference/31-subscriptions.md): Core API (API 3.1) provides endpoints which allow you to manage subscriptions - [Create subscription](https://developers.cleeng.com/reference/create-subscription.md): Use this endpoint to create [externally-managed subscriptions](https://developers.cleeng.com/docs/externally-managed-subscriptions) - subscriptions whose lifecycle is managed outside of Cleeng.

You can create [multiple subscriptions for the same offer and customer](https://developers.cleeng.com/docs/externally-managed-subscriptions#multiple-subscriptions-per-offer) with this endpoint. But the endpoint prevents duplicate subscriptions with the same external ID and source. It only allows new subscriptions if there isn't already an active subscription from the same source and with the same external ID.

**Important**
This endpoint can only be used for creating subscriptions (offers with recurring payments). It **cannot be used for one-time payment offers** such as passes, live events (previously called live pay-per-view), or one-time purchase (previously called TVOD). (For more information on offers, see [What is a Cleeng offer?](https://publisher.support.cleeng.com/hc/en-us/articles/360012552919-What-is-a-Cleeng-offer)). - [Get a subscription](https://developers.cleeng.com/reference/get-a-subscription.md): Use this endpoint to get subscription details based on subscription ID. - [List subscriptions](https://developers.cleeng.com/reference/list-subscriptions.md): This endpoint returns subscriptions that match the specified criteria (`transactionId`, `paymentMethodId`, `externalId`, `customerId` or `offerId` and `customerId` together). Please bear in mind that if you don't provide any parameters, an empty list will be returned.

**Note:** Filtering by `customerId` and `offerId` might return multiple active subscriptions instead of one if [multiple subscriptions have been created for the same offer](https://developers.cleeng.com/docs/externally-managed-subscriptions#multiple-subscriptions-per-offer). - [Update subscription](https://developers.cleeng.com/reference/update-subscription.md): Use this endpoint to update an existing subscription, for example apply a coupon or to update payment details. - [Activate subscription](https://developers.cleeng.com/reference/activate-subscription.md): Use this endpoint to activate a subscription. - [Cancel subscription](https://developers.cleeng.com/reference/cancel-subscription.md): Use this endpoint to cancel a subscription. - [Terminate subscription](https://developers.cleeng.com/reference/terminate-subscription.md): Use this endpoint to terminate a subscription. - [Fetch available switches](https://developers.cleeng.com/reference/31-fetch-available-switches.md): This endpoint returns all available offers to which a customer can switch from the current subscription in `available` array. Offers to which customer can't switch are returned in `unavailable` array with the reason why the switch is not possible. - [Switch subscription](https://developers.cleeng.com/reference/31-switch-subscription.md): This endpoint is used to upgrade or downgrade a subscription to another subscription plan. Use either `subscriptionId` OR `customerId` and `fromOfferId` together (`customerId` and `fromOfferId` can only be used with Cleeng-managed subscriptions where the whole lifecycle is under the control of Cleeng). As these last two parameters are deprecated, `subscriptionId` is going to be the only option to use this endpoint.

**Important**
Subscription upgrade and downgrade feature requires compatibility of the payment connector and payment gateway. Currently the feature is fully supported for the following: [Adyen](https://publisher.support.cleeng.com/hc/en-us/articles/4406573398930), [PayPal](https://publisher.support.cleeng.com/hc/en-us/articles/4406573425042). Please contact [Cleeng Support Team](https://publisher.support.cleeng.com/hc/en-us/requests/new) if you wish to use other payment connectors/gateways. - [List switches](https://developers.cleeng.com/reference/31-list-switches.md): This endpoint lets you list all subscription switches (e.g. upgrades, downgrades) that meet the requirements given in the API request. For example, it allows you to filter switches by status or subscription ID.

**Important**
Subscription upgrade and downgrade feature requires compatibility of the payment connector and payment gateway. Currently the feature is fully supported for the following: [Adyen](https://publisher.support.cleeng.com/hc/en-us/articles/4406573398930), [PayPal](https://publisher.support.cleeng.com/hc/en-us/articles/4406573425042). Please contact [Cleeng Support Team](https://publisher.support.cleeng.com/hc/en-us/requests/new) if you wish to use other payment connectors/gateways. - [Fetch switch details](https://developers.cleeng.com/reference/31-fetch-switch-details.md): This endpoint retrieves details of a given subscription switch (e.g. upgrade, downgrade).

**Important**
Subscription upgrade and downgrade feature requires compatibility of the payment connector and payment gateway. Currently the feature is fully supported for the following: [Adyen](https://publisher.support.cleeng.com/hc/en-us/articles/4406573398930), [PayPal](https://publisher.support.cleeng.com/hc/en-us/articles/4406573425042). Please contact [Cleeng Support Team](https://publisher.support.cleeng.com/hc/en-us/requests/new) if you wish to use other payment connectors/gateways. - [Update switch](https://developers.cleeng.com/reference/31-update-switch.md): Use this endpoint to manage a subscription switch.

Currently, this endpoint supports cancelling a pending switch. (Pending is the status of the switch between the subscription switch request and the actual switch processing.)

Cancelling a pending switch triggers a [`subscriptionSwitchCancelled`](https://developers.cleeng.com/docs/webhook-subscription-topics#subscriptionswitchcancelled) webhook.

**Important**
Subscription upgrade and downgrade feature requires compatibility of the payment connector and payment gateway. Currently the feature is fully supported for the following: [Adyen](https://publisher.support.cleeng.com/hc/en-us/articles/4406573398930), [PayPal](https://publisher.support.cleeng.com/hc/en-us/articles/4406573425042). Please contact [Cleeng Support Team](https://publisher.support.cleeng.com/hc/en-us/requests/new) if you wish to use other payment connectors/gateways. - [Transfer subscription](https://developers.cleeng.com/reference/transfer-subscription.md): Use this endpoint to transfer [externally-managed subscriptions](https://developers.cleeng.com/docs/externally-managed-subscriptions) (EMS) - subscriptions whose life cycle is managed outside of Cleeng.

Subscription is transferred if there is already an active subscription in Cleeng that belongs to a customer with a different email address. Then a new subscription is created for the "new customer" (the one using the new email address) and the subscription assigned to the "old customer" (the one using the old email address) is terminated.

**Note:** For subscription transfer [subscription resource payload](https://developers.cleeng.com/reference/create-subscription#response-description) should be returned in response with non-empty `replacedBy` property. - [Revive subscription](https://developers.cleeng.com/reference/subscription-revive.md): This endpoint is used to revive terminated [externally-managed subscriptions](https://developers.cleeng.com/docs/externally-managed-subscriptions) (EMS) - subscriptions whose life cycle is managed outside of Cleeng.

A terminated externally managed subscription is revived by creating a new subscription based on the terminated one.

The data is copied from the terminated subscription (e.g. original purchase date, payment details), however, the old expiration date will be overriden if a new one is provided.

**Note:** You can only revive **terminated** subscriptions.

For subscription revival [subscription resource payload](https://developers.cleeng.com/reference/create-subscription#response-description) should be returned in response with non-empty `replacedBy` property. - [Renew subscription](https://developers.cleeng.com/reference/renew-subscription.md): Use this endpoint to renew [externally-managed subscriptions](https://developers.cleeng.com/docs/externally-managed-subscriptions) (EMS) - subscriptions whose life cycle is managed outside of Cleeng. - [Pause subscription ](https://developers.cleeng.com/reference/pause-subscription.md): Use this endpoint to pause a subscription. You can only pause active and canceled subscriptions (you cannot pause in-trial or terminated subscriptions).

Transition from active state to pause is tied to subscription anniversary date (the pause will start with a new billing cycle). - [Resume subscription](https://developers.cleeng.com/reference/resume-subscription.md): Use this endpoint to resume a subscription from a scheduled pause or to immediately resume from the pause that is ongoing. With immediate resume from the pause which is in progress, a payment attempt is made and the customer is charged. - [Gift Subscriptions](https://developers.cleeng.com/reference/31-gift-subscriptions.md) - [Get a gift](https://developers.cleeng.com/reference/31-get-a-gift.md): This endpoint retrieves details of a given gift that was previously purchased. - [Update a gift](https://developers.cleeng.com/reference/31-update-a-gift.md): This endpoint gives possibility to update delivery details of a given gift that was previously purchased. - [Verify a gift](https://developers.cleeng.com/reference/31-verify-a-gift.md): Use this endpoint to verify whether a gift code provided by the user is valid. The gift code has to be verified before a gift is redeemed. - [Redeem a gift](https://developers.cleeng.com/reference/31-redeem-a-gift.md): Use this endpoint to redeem a gift. A gift can be redeemed after a successful verification. - [Passes](https://developers.cleeng.com/reference/passes.md) - [Create a pass](https://developers.cleeng.com/reference/create-pass.md): Use this endpoint to create externally-managed passes.

The life cycle of externally-managed passes is managed outside of Cleeng so it is up to a publisher to notify Cleeng about pass status changes, e.g. the change of pass expiration date or pass termination if auto-termination is not enabled (if auto-termination is not enabled for the payment method, Cleeng platform will not terminate the pass when expiry date is reached, and the publisher will need to send the termination request to revoke access).

You can create [multiple passes for the same offer and customer](https://developers.cleeng.com/docs/externally-managed-passes#multiple-passes-per-offer) with this endpoint. But the endpoint prevents duplicate passes with the same external ID and source. It only allows new passes if there isn't already an active pass from the same source and with the same external ID. - [Get a pass](https://developers.cleeng.com/reference/get-pass.md): Use this endpoint to get pass details based on pass ID. - [List passes](https://developers.cleeng.com/reference/list-passes.md): This endpoint returns passes that match the specified criteria (`transactionId`, `paymentMethodId`, `externalId`, `customerId` or `offerId` and `customerId` together). Please bear in mind that if you don't provide any parameters, an empty list will be returned.

**Note:** Filtering by `customerId` and `offerId` might return multiple active passes instead of one if [multiple passes have been created for the same offer](https://developers.cleeng.com/docs/externally-managed-passes#multiple-passes-per-offer). - [Update a pass](https://developers.cleeng.com/reference/update-pass.md): Use this endpoint to update a pass using ID. Only a single property can be updated during one request. - [Terminate a pass](https://developers.cleeng.com/reference/terminate-pass.md): Use this endpoint to terminate a pass using its ID. - [Transfer a pass](https://developers.cleeng.com/reference/transfer-a-pass.md): Use this endpoint to transfer externally-managed passes between customers.

The life cycle of externally-managed passes is managed outside of Cleeng so it is up to a publisher to notify Cleeng about pass status changes, e.g. the change of pass expiration date. - [List entitlements](https://developers.cleeng.com/reference/list-entitlements.md): You can use this endpoint to list a customer's entitlements and calculate a subscription's length. You can fetch entitlements for the following types of offer: **subscriptions**, **passes**, and **one-time purchases** (lifetime purchases and time-limited rentals). (For more information on offers, see [What is a Cleeng offer?](https://publisher.support.cleeng.com/hc/en-us/articles/360012552919-What-is-a-Cleeng-offer-)).

If there are two or more subscriptions or passes for the same offer and the same customer, there will be as many entitlements returned as there are subscriptions / passes. - [Get entitlements](https://developers.cleeng.com/reference/get-entitlement.md): You can use this endpoint to check entitlements to a specific offer.

If there are two or more subscriptions / passes for the same `offerId` and the same `customerId`, it will return one object with the latest `expiresAt` date. - [List campaigns](https://developers.cleeng.com/reference/list-campaigns.md): This endpoint lets you list all your campaign details based on a coupon code. - [Android [Deprecated]](https://developers.cleeng.com/reference/android-1.md): **This endpoint is deprecated.**

Use this endpoint to notify Cleeng about the successful Android in-app payment (Initial Purchase) and create a subscription in Cleeng.

The relevant endpoints are:
- Production URL: https://api.cleeng.com/android/payment
- Sandbox URL: https://api.sandbox.cleeng.com/android/payment

**Note:**
For integrations utilizing <> authorization please use the MediaStore SDK API [Android Payment](ref:android-payment) endpoint. - [Roku](https://developers.cleeng.com/reference/roku-payment.md): Use this endpoint to notify Cleeng about the successful Roku in-app payment (Initial Purchase) and create a subscription in Cleeng.

The relevant endpoints are:
- Production URL: https://api.cleeng.com/roku/payment
- Sandbox URL: https://api.sandbox.cleeng.com/roku/payment

**Note:**
For integrations utilizing <> authorization please use the MediaStore SDK API [Roku Payment](ref:roku-payment-ms) endpoint. - [Amazon FireTV](https://developers.cleeng.com/reference/amazonfiretv.md): Use this endpoint to notify Cleeng about the successful Amazon FireTV in-app payment (Initial Purchase) and create a subscription in Cleeng.

The relevant endpoints are:
- Production URL: https://api.cleeng.com/amazon/payment
- Sandbox URL: https://api.sandbox.cleeng.com/amazon/payment

**Note:**
For integrations utilizing <> authorization please use the MediaStore SDK API [Amazon FireTV Payment](ref:amazon-firetv-payment) endpoint. - [Getting Started With In-App API](https://developers.cleeng.com/reference/getting-started-with-inapp-api.md) - [Samsung TV](https://developers.cleeng.com/reference/samsung-tv.md): Use this endpoint to notify Cleeng about Samsung TV in-app payment and to validate the purchase.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. - [Check Samsung TV purchase status](https://developers.cleeng.com/reference/check-samsung-tv-purchase-status.md): Use this endpoint to check the status of a Samsung TV in-app purchase.
The status returned in response can have three values:

- `pending` - purchase is still being processed
- `success` - purchase processing has finished with a positive result
- `failure` - purchase processing has finished with a negative result, an error occurred during processing.

Please note that <> (Bearer) token authorization **should be used** for this endpoint. # Errors | HTTP Status Code | Error Code | Message | | :--------------- | :----------------- | :----------------------- | | 400 | REQ0002 | Invalid query parameters | | 404 | REQ0100 | Entity not found | | 500 | SXXXX (X - number) | Internal Server Error | - [Register Apple SK2 purchase](https://developers.cleeng.com/reference/register-apple-sk2-purchase.md): Use this endpoint to register a purchase made via Apple StoreKit2 to initiate an asynchronous synchronization process. This process involves verifying the purchase with Apple and updating the user's entitlement status in Cleeng's system.

Due to the time required for Apple'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.

The `cleengCustomerId` is used to identify the user in Cleeng's system and associate the purchase with their account.

**Important:** Only one synchronization process can be active for a given `transactionId` at a time. If a new request is made for the same `transactionId` while a previous synchronization is still in progress, a `409` `Conflict` error will be returned.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. You can then use the following methods to check the status of the synchronization process: * **Polling:** Use the `/purchases/synchronizations/{synchronizationId}` endpoint to periodically retrieve the status. This endpoint provides a concise response with the essential status information. * **Webhooks:** Subscribe to the `inappPurchaseSyncResult` webhook to receive real-time updates on the synchronization status. The webhook payload (`WebhookSynchronizationStatus`) includes detailed information about the synchronization, including the `synchronizationId`, transaction details (`transactionId`, `cleengCustomerId`, `originalTransactionId`), `accessGranted`, `offerId`, and `result`. You can choose to use either the polling mechanism, the webhook, or both, depending on your needs. # Errors | HTTP Status Code | Error Code | Message | | :--------------- | :----------------- | :-------------------------------------------------------------- | | 400 | REQ0001 | Invalid body | | 400 | REQ0004 | Invalid headers | | 409 | SK2C0101 | The resource is temporarily locked due to a concurrent request. | | 422 | SK2C0100 | Unable to find customer | | 500 | SK2C0004 | StoreKit2 integration not activated | | 500 | SXXXX (X - number) | Internal Server Error | - [Transfer Apple SK2 purchase](https://developers.cleeng.com/reference/transfer-apple-sk2-purchase.md): Use this endpoint to transfer an existing **active** purchase from one user to another. This allows re-assigning access to a subscription or in-app purchase.

The transfer process is asynchronous. Upon successful registration, the API will return a `202` `Accepted` status with a unique `synchronizationId` in the response body.

**Note:** Only active purchases can be transferred.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. You can then use the following methods to check the status of the transfer process: * **Polling:** Use the `/purchases/synchronizations/{synchronizationId}` endpoint to periodically retrieve the status. This endpoint provides a concise response with the essential status information. * **Webhooks:** Subscribe to the `inappPurchaseSyncResult` webhook to receive real-time updates on the status. The webhook payload (`WebhookSynchronizationStatus`) includes detailed information about the transfer, including the `synchronizationId`, transaction details (`transactionId`, `cleengCustomerId`, `originalTransactionId`), `accessGranted`, `offerId`, and `result`. You can choose to use either the polling mechanism, the webhook, or both, depending on your needs. # Errors | HTTP Status Code | Error Code | Message | | :--------------- | :----------------- | :-------------------------------------------------------------- | | 400 | REQ0001 | Invalid body | | 400 | REQ0004 | Invalid headers | | 409 | SK2C0103 | The resource is temporarily locked due to a concurrent request. | | 409 | SK2C0104 | The resource is temporarily locked due to a concurrent request. | | 422 | SK2C0005 | The migration is in progress. | | 422 | SK2C0100 | Unable to find customer | | 500 | SK2C0004 | StoreKit2 integration not activated | | 500 | SXXXX (X - number) | Internal Server Error | - [Check Apple SK2 purchase synchronization status](https://developers.cleeng.com/reference/check-apple-sk2-purchase-synchronization-status.md): Use this endpoint to retrieve the status and result of a purchase synchronization or transfer process initiated by the [/purchases](https://developers.cleeng.com/reference/register-apple-sk2-purchase) or [/purchases/transfers](https://developers.cleeng.com/reference/transfer-apple-sk2-purchase) endpoint. This endpoint provides a concise response with the essential status information, including `status`, `accessGranted`, `offerId`, and `result`.

The status field indicates the current stage of the synchronization process:
- `processing`: The synchronization is in progress.
- `retrying:` The synchronization encountered an error and is being retried. This status may appear multiple times.
- `finalized:` The synchronization process has completed.

The `result` field provides more detailed information about the outcome of the synchronization and is only available when `status` is `finalized`. The `accessGranted` field indicates whether the user is entitled to the offer. The `offerId` field provides the ID of the offer. You can see some possible scenarios and the corresponding response fields in the [polling](https://developers.cleeng.com/docs/apple-in-app-purchase-storekit-2#polling) section of the integration tutorial.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. # Response description | Response | Type | Description | | :--- | :--- | :--- | | `status` (required) | string | One of: `processing`, `retrying`, `finalized`. The current status of the synchronization process. Possible values:
  • processing: The synchronization is in progress. The status will change to finalized once the process is complete and didn't face any unexpected errors alongside.
  • retrying: The synchronization encountered an error and is being retried. This status may take a while before turning into finalized. Be aware that the process may fail after several retries and, till it won't finalize, other requests will be rejected for the same transactionId.
  • finalized: The synchronization process has completed. The final result of the synchronization will be available in the result field. Other requests for the same transactionId can be accepted now.
| | `accessGranted` | boolean | The field is available only when the synchronization status is `finalized`. The value is `true` if the user is entitled to the offer, `false` otherwise. | | `offerId` | string | The offer id associated with the purchase. The offer id will be available only if user is entitled to this specific offer. | | `correlationId` | string | (correlationId) <= 256 characters
Correlation ID provided in the initial request, which helps link the initial purchase registration or transfer request with the synchronization process. This ID is crucial for tracking the entire flow of a purchase or transfer operation, from the initial request to the final synchronization result. | | `result` | string | (synchronizationResult)
The result is only available when the synchronization status is `finalized`. It is not possible to obtain it earlier in the process. The result of the purchase processing. Possible values:
  • RECEIVED_EXPIRED_PURCHASE: The purchase was already expired when received. This could be due to an old purchase being selected, an attempt to hack the system, or an application malfunction.
  • TRANSACTION_ID_NOT_FOUND: The transaction ID was not found in Apple's system. This could indicate an attempt to hack the system, a client app malfunction, or the purchase being cleared from the user's Apple account before it was registered.
  • ACCESS_EXPIRED: The purchase was successfully synchronized, but access to the offer has already expired. This could be due to a wrongly selected purchase or the user not extending access to the Apple offer.
  • OWNED_BY_ANOTHER_USER: The purchase is already owned by another user in the system. A transfer needs to be made to grant access to the requesting user.
  • SYNCHRONIZATION_UNPROCESSABLE: An unexpected system behavior prevented the synchronization process. This likely requires escalation to support.
  • RESOURCE_TEMPORARY_LOCKED_FOR_PROCESSING: The resource is temporarily locked due to a concurrent request. Retrying the request later should resolve the issue.
  • PRODUCT_TYPE_NOT_SUPPORTED: The product type is not supported by the system. Offers settings should be changed to make sure only supported products are available. Retrying the request doesn't make any positive effect before fixing offers configuration on Apple side and mappings in Cleeng's Dashboard.
  • PURCHASE_RESTORED: A purchase was found in the system that was not assigned to the end-user. Having data available from the request, the purchase was transferred from the system's unidentified user to the real user from the request. Real user have now granted access to the offer.
  • PURCHASE_OWNERSHIP_TRANSFERRED: The purchase was successfully transferred to another user. The new user now has access to the offer. The situation can occur only between real users.
  • PURCHASE_SYNCHRONIZED: The purchase was successfully synchronized.
| # Errors | HTTP Status Code | Error Code | Message | | :--------------- | :----------------- | :---------------------- | | 400 | REQ0003 | Invalid path parameters | | 400 | REQ0004 | Invalid headers | | 404 | REQ0100 | Entity not found | | 500 | SXXXX (X - number) | Internal Server Error | - [Register Google Play purchase](https://developers.cleeng.com/reference/register-google-play-purchase.md): 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.

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.

You can then use the following methods to check the status of the synchronization process:

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

- **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`.

You can choose to use either the polling mechanism, the webhook, or both, depending on your needs.

The `cleengCustomerId` is used to identify the user in Cleeng's system and associate the purchase with their account.

**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`.

The `productType` field determines which Google Play API is used to verify the purchase:
-`subscription` - uses `purchases.subscriptionsv2.get`

**Scope:** Only `subscription` is supported. One-time products are not supported - requests with any other `productType` are rejected with `400`.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. - [Transfer Google Play purchase](https://developers.cleeng.com/reference/transfer-google-play-purchase.md): Use this endpoint to transfer an existing **active** subscription from one user to another. This allows re-assigning access to a subscription.

**Scope:** Only `productType=subscription` is supported. One-time product transfers are not supported and return `400`.

The transfer process is asynchronous. Upon successful registration, the API will return a `202` `Accepted` status with a unique `synchronizationId` in the response body.

You can then use the following methods to check the status of the transfer process:

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

- **Webhooks:** Subscribe to the [`inappPurchaseSyncResult`](https://developers.cleeng.com/docs/webhooks-in-app-purchase-topics#inapppurchasesyncresult) webhook to receive real-time updates on the status. The webhook payload (`WebhookSynchronizationStatus`) includes detailed information about the transfer, including the `synchronizationId`, purchase details (`purchaseToken`, `packageName`, `cleengCustomerId`), `accessGranted`, `offerId`, and `result`.

You can choose to use either the polling mechanism, the webhook, or both, depending on your needs.

**Note:** Only active purchases can be transferred.

**Transfer-only semantics:** This operation performs ownership transfer only - it does NOT run a synchronization with Google Play. The processor finalizes the synchronization record with `PURCHASE_OWNERSHIP_TRANSFERRED` (or `PURCHASE_OWNERSHIP_UNCHANGED` when the ownership is already aligned), and emits an `inappPurchaseSyncResult` event.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. - [Check Google Play purchase synchronization status](https://developers.cleeng.com/reference/check-google-play-purchase-synchronization-status.md): Use this endpoint to retrieve the status and result of a purchase synchronization or transfer process initiated by the [`/purchases`](https://developers.cleeng.com/reference/register-google-play-purchase) or [`/purchases/transfers`](https://developers.cleeng.com/reference/transfer-google-play-purchase) endpoint. This endpoint provides a concise response with the essential status information, including `status`, `accessGranted`, `offerId`, and `result`.

For real-time updates on the synchronization status, you can also subscribe to the [`inappPurchaseSyncResult`](https://developers.cleeng.com/docs/webhooks-in-app-purchase-topics#inapppurchasesyncresult) webhook, which provides a more detailed payload (`WebhookSynchronizationStatus`) with additional information about the transaction.

The `status` field indicates the current stage of the synchronization process:
- `processing`: The synchronization is in progress.
- `retrying:` The synchronization encountered an error and is being retried. This status may appear multiple times.
- `finalized:` The synchronization process has completed.

The `result` field provides more detailed information about the outcome of the synchronization and is only available when `status` is `finalized`. The `accessGranted` field indicates whether the user is entitled to the offer. The `offerId` field provides the ID of the offer. You can see some possible scenarios and the corresponding response fields in the [polling](https://developers.cleeng.com/docs/google-play-billing#polling-statuses) section of the integration tutorial.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. - [Vizio](https://developers.cleeng.com/reference/vizio-purchase-validation.md): Use this endpoint to notify Cleeng about Vizio in-app payment and to validate the purchase.

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 <> or X-Publisher-Token header authorization.

**Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation**. - [Check Vizio purchase status](https://developers.cleeng.com/reference/check-vizio-purchase-status.md): Use this endpoint to check the status of a Vizio in-app purchase.
The status returned in response can have three values:

- `pending` - purchase is still being processed
- `success` - purchase processing has finished with a positive result
- `failure` - purchase processing has finished with a negative result, an error occurred during processing.

Please note that <> (Bearer) token authorization **should be used** for this endpoint. # Errors | HTTP Status Code | Error Code | Message | | :--------------- | :----------------- | :-------------------- | | 404 | REQ0100 | Entity not found | | 500 | SXXXX (X - number) | Internal Server Error | - [Getting Started with Webhooks API](https://developers.cleeng.com/reference/getting-started-with-webhooks-api.md) - [Create a webhook endpoint](https://developers.cleeng.com/reference/create-a-webhook-endpoint.md): Creates a new webhook endpoint with auto-generated signing secret.
**Note:** The signing secret is returned only in this response - store it securely. - [List webhook endpoints](https://developers.cleeng.com/reference/list-webhook-endpoints.md): Returns all endpoints for the authenticated publisher with cursor-based pagination. - [Get a webhook endpoint](https://developers.cleeng.com/reference/get-a-webhook-endpoint.md): Returns a single endpoint by ID. The signing secret is not included. - [Update a webhook endpoint ](https://developers.cleeng.com/reference/update-a-webhook-endpoint.md): Partially updates an endpoint. Only provided fields are changed; omitted fields remain unchanged. Immutable fields (`id`, `signing`, `createdAt`) cannot be updated. - [Delete a webhook endpoint](https://developers.cleeng.com/reference/delete-a-webhook-endpoint.md): Deletes an endpoint and all its event subscriptions atomically. - [Rotate endpoint signing secret](https://developers.cleeng.com/reference/rotate-endpoint-signing-secret.md): Generates a new signing secret for the endpoint. The old secret is immediately invalidated. The new secret is returned only in this response - store it securely. - [List available event types](https://developers.cleeng.com/reference/list-available-event-types.md): Returns all available event types grouped by domain. - [List endpoints subscribed to an event type](https://developers.cleeng.com/reference/list-endpoints-subscribed-to-an-event-type.md): Returns all endpoints for the authenticated publisher that subscribe to a specific event type. - [Getting Started With Authentication API](https://developers.cleeng.com/reference/getting-started-with-authentication-api.md) - [Hi5 Chatbot token](https://developers.cleeng.com/reference/hi5-chatbot-token.md): Use this endpoint to exchange Cleeng <> for Hi5 Chatbot token. - [Device Login Flow (PIN Pair) ](https://developers.cleeng.com/reference/device-login-flow.md) - [Generate code](https://developers.cleeng.com/reference/generate-code.md): Use this endpoint to generate a code for a specific device in Device Flow Login (PIN Pair) functionality. - [Authorize code](https://developers.cleeng.com/reference/authorize-code.md): Use this endpoint to verify the code and authorize the device in Device Flow Login (PIN Pair) functionality. - [Check code](https://developers.cleeng.com/reference/check-code.md): Use this endpoint for Device Flow Login (PIN Pair) functionality to check if the generated code has been authorized. - [JSON Web Key Set](https://developers.cleeng.com/reference/json-web-key-set.md): Use this endpoint to validate Cleeng’s JWTs (JSON Web Tokens).
This endpoint does not require authorization. - [Auth0 - Generate token [Early Access]](https://developers.cleeng.com/reference/auth0_generate-token.md): Receives user authentication events from Auth0 post-login/post-registration action. Creates a new customer or updates existing customer data (if changes detected). Generates Cleeng access token (JWT) with configurable expiration.

**Authorization**: Requires Bearer token (JWT). The token value must match the **secret** in publisher configuration.

**IMPORTANT NOTE: This feature is currently in [Early Access](https://publisher.support.cleeng.com/hc/en-us/articles/10037994501532-Early-Access-Features). This means it's ready for real-world use while we gather user feedback to enhance its functionality and address any minor issues.** ## Changelog - [Release Notes](https://developers.cleeng.com/changelog/relase-noteshttpspublishersupportcleengcomhcen-ussections4620091486108-release-notes.md)