Check Apple SK2 purchase synchronization status

Use this endpoint to retrieve the status and result of a purchase synchronization or transfer process initiated by the /purchases or /purchases/transfers 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 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 JWT 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

ResponseTypeDescription
status (required)stringOne 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.
accessGrantedbooleanThe field is available only when the synchronization status is finalized. The value is true if the user is entitled to the offer, false otherwise.
offerIdstringThe offer id associated with the purchase. The offer id will be available only if user is entitled to this specific offer.
correlationIdstring(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.
resultstring(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 CodeError CodeMessage
400REQ0003Invalid path parameters
400REQ0004Invalid headers
404REQ0100Entity not found
500SXXXX (X - number)Internal Server Error
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Unique identifier for the synchronization process. This ID is included in the response to the /purchases and /purchases/transfers endpoints. It can be used to track the status of the asynchronous purchase synchronization or transfer process using the /purchases/synchronizations/{synchronizationId} endpoint. The synchronizationId will be the same as the Correlation-Id provided in the request header, if one is supplied. If no Correlation-Id is provided, a unique synchronizationId will be generated automatically. Format: uuid.

Headers
string

Can be used within both server-to-server and client integrations. Either a JWT or X-Publisher-Token header authorization is required, depending on how you integrate with Cleeng.
Please use JWT (Bearer) token to try out the endpoint in the API console in this documentation.

string

Can be used only within server-to-server integrations. Either a JWT or X-Publisher-Token header authorization is required, depending on how you integrate with Cleeng.

int32
required

Unique identifier for the publisher integrating with the API.
This header is crucial for tracking the source of requests and identifying which publisher's application is making the API call. It helps in isolating issues, monitoring usage patterns, and providing targeted support to specific publishers.

string

Version of the publisher's application making the API request.
This header helps you track which versions of the publisher's app are being used and how they interact with Cleeng API. It can be valuable in identifying compatibility issues, understanding the impact of app updates on API usage, and providing support for different app versions.

string

Unique identifier for the device making the request (if applicable).
This header is useful for tracking requests at the device level, especially in mobile app integrations. It can help you identify issues related to specific devices, analyze user behavior across devices, and gather insights into device-specific usage patterns.

string

Specifies the type of device the request is coming from.
This header provides additional context about the device making the request, beyond just its unique ID. It helps you categorize devices (e.g., "iPhone 13", "Samsung Galaxy S21", "Web Browser") and identify potential issues or trends related to specific device types.

This information can be particularly useful for debugging, as it allows you to narrow down issues that may be specific to certain device models or types. It also helps in understanding user behavior and preferences across different device categories. Example: Apple TV

string

Specifies the action performed by the user in the publisher's application.
This header provides additional context about the user's actions within the app, such as "Purchase", "Restore Purchase", "Updating Plan", "Content Access", etc. It helps you understand user behavior, track specific actions that trigger API requests, and analyze usage patterns based on user actions.

By capturing user actions in the app, you can gain insights into user engagement, preferences, and interactions with your API. This information can be valuable for optimizing the user experience, tailoring content recommendations, and improving app performance.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json