# PurchaseData

public class PurchaseData extends Object\
java.lang.Object    ↳ com.gaa.sdk.iap.PurchaseData

\
Indicates the purchase data of in-app's purchases.

\
Summary <a href="#id-en-purchasedata-summary" id="id-en-purchasedata-summary"></a>
----------------------------------------------------------------------------------

***

| **Nested classes** |                                                                                                                     |
| ------------------ | ------------------------------------------------------------------------------------------------------------------- |
| @interface         | [PurchaseData.AcknowledgeState](/dev/eng/tools/billing/v21/references/annptations/purchasedata.acknowledgestate.md) |
| @interface         | [PurchaseData.PurchaseState](/dev/eng/tools/billing/v21/references/annptations/purchasedata.purchasestate.md)       |
| @interface         | [PurchaseData.RecurringState](/dev/eng/tools/billing/v21/references/annptations/purchasedata.recurringstate.md)     |

| **Public constructors**                                 |
| ------------------------------------------------------- |
| PurchaseData(String jsonPurchaseData)                   |
| PurchaseData(String jsonPurchaseData, String signature) |

## Public methods <a href="#id-en-purchasedata-publicmethods" id="id-en-purchasedata-publicmethods"></a>

***

### getOrderId <a href="#id-en-purchasedata-getorderid" id="id-en-purchasedata-getorderid"></a>

String getOrderId()\
Restores the order ID of purchases.

| **Returns:** |             |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPackageName <a href="#id-en-purchasedata-getpackagename" id="id-en-purchasedata-getpackagename"></a>

String getPackageName()\
Restores the package name of the application that started to purchase.

| **Returns:** |             |
| ------------ | ----------- |
| String       | <p><br></p> |

### getProductId <a href="#id-en-purchasedata-getproductid" id="id-en-purchasedata-getproductid"></a>

String getProductId()\
Restores the ID of purchased in-app products.

| **Returns:** |             |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPurchaseTime <a href="#id-en-purchasedata-getpurchasetime" id="id-en-purchasedata-getpurchasetime"></a>

long getPurchaseTime()\
Restores the purchased time of in-app products to unit in seconds.

| **Returns:** |             |
| ------------ | ----------- |
| long         | <p><br></p> |

### isAcknowledged <a href="#id-en-purchasedata-isacknowledged" id="id-en-purchasedata-isacknowledged"></a>

boolean isAcknowledged()\
Indicates whether the purchase is acknowledged.

| **Returns:** |             |
| ------------ | ----------- |
| boolean      | <p><br></p> |

### getDeveloperPayload <a href="#id-en-purchasedata-getdeveloperpayload" id="id-en-purchasedata-getdeveloperpayload"></a>

String getDeveloperPayload()\
Delivers the payload of the developer that was specified when the purchase was acknowledged or consumed.

| **Returns:** |             |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPurchaseId <a href="#id-en-purchasedata-getpurchaseid" id="id-en-purchasedata-getpurchaseid"></a>

@DeprecatedString getPurchaseId()\
Restores the ID that distinguishes the purchased data uniquely (not used in API v6).

| **Returns:**       |             |
| ------------------ | ----------- |
| String             | <p><br></p> |
| **See Also:**      |             |
| getPurchaseToken() | <p><br></p> |

### getPurchaseToken <a href="#id-en-purchasedata-getpurchasetoken" id="id-en-purchasedata-getpurchasetoken"></a>

String getPurchaseToken()\
Restores the token that distinguishes the purchased data uniquely.

| **Returns:** |             |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPurchaseState <a href="#id-en-purchasedata-getpurchasestate" id="id-en-purchasedata-getpurchasestate"></a>

int getPurchaseState()\
Restores the one of [PurchaseData.PurchaseState](/dev/eng/tools/billing/v21/references/annptations/purchasedata.purchasestate.md) as indicating the value of the purchased state.

| **Returns:** |             |
| ------------ | ----------- |
| int          | <p><br></p> |

### getRecurringState <a href="#id-en-purchasedata-getrecurringstate" id="id-en-purchasedata-getrecurringstate"></a>

int getRecurringState()\
Restores the one of [PurchaseData.RecurringState](/dev/eng/tools/billing/v21/references/annptations/purchasedata.recurringstate.md) as indicating the value of the monthly auto-renewal state.

| **Returns:** |             |
| ------------ | ----------- |
| int          | <p><br></p> |

### getQuantity <a href="#id-en-purchasedata-getquantity" id="id-en-purchasedata-getquantity"></a>

int getQuantity()\
Restores the quantity of the products.

| **Returns:** |             |
| ------------ | ----------- |
| int          | <p><br></p> |

### getSignature <a href="#id-en-purchasedata-getsignature" id="id-en-purchasedata-getsignature"></a>

String getSignature()\
Restores the string which includes the signature of the purchased data signed by the personal key of the developer.

| **Returns:** |             |
| ------------ | ----------- |
| String       | <p><br></p> |

### getOriginalJson <a href="#id-en-purchasedata-getoriginaljson" id="id-en-purchasedata-getoriginaljson"></a>

String getOriginalJson()\
Restores the JSON formatted string which includes detailed information of the purchased data.

| **Returns:** |             |
| ------------ | ----------- |
| String       | <p><br></p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/references/classes/purchasedata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
