> For the complete documentation index, see [llms.txt](https://onestore-dev.gitbook.io/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/references/classes/purchaseclient.builder.md).

# PurchaseClient.Builder

public static final class PurchaseClient.Builder\
java.lang.Object    ↳ com.gaa.sdk.iap.PurchaseClient.Builder

\
A builder that helps create a [PurchaseClient](/dev/eng/tools/billing/v21/references/classes/purchaseclient.md) instance easily.

\
Public Methods <a href="#id-en-purchaseclient.builder-publicmethods" id="id-en-purchaseclient.builder-publicmethods"></a>
-------------------------------------------------------------------------------------------------------------------------

***

### setBase64PublicKey <a href="#id-en-purchaseclient.builder-setbase64publickey" id="id-en-purchaseclient.builder-setbase64publickey"></a>

@UiThreadpublic PurchaseClient.Builder setBase64PublicKey(String base64PublicKey)\
Please specify the public key that is issued from the developer center to check the validity of purchase information.

| **Parameters:**        |                        |
| ---------------------- | ---------------------- |
| base64PublicKey        | base64EncodedPublicKey |
| **Returns**            |                        |
| PurchaseClient.Builder | <p><br></p>            |

### setListener <a href="#id-en-purchaseclient.builder-setlistener" id="id-en-purchaseclient.builder-setlistener"></a>

@UiThreadpublic PurchaseClient.Builder setListener(PurchasesUpdatedListener[ ](https://dev.onestore.co.kr/wiki/en/doc/en-purchasesupdatedlistener-38077521.html)listener)\
Please specify to receive onPurchasesUpdated event.

| **Parameters:**        |                                                                                                          |
| ---------------------- | -------------------------------------------------------------------------------------------------------- |
| listener               | [PurchasesUpdatedListener](/dev/eng/tools/billing/v21/references/interfaces/purchasesupdatedlistener.md) |
| **Returns:**           |                                                                                                          |
| PurchaseClient.Builder | <p><br></p>                                                                                              |

### build <a href="#id-en-purchaseclient.builder-build" id="id-en-purchaseclient.builder-build"></a>

@UiThreadpublic PurchaseClient[ ](https://dev.onestore.co.kr/wiki/en/doc/en-purchaseclient-38077503.html)build()\
Creates a PurchaseClient's instance.

| **Return:**                                                                       |                                                  |
| --------------------------------------------------------------------------------- | ------------------------------------------------ |
| [PurchaseClient](/dev/eng/tools/billing/v21/references/classes/purchaseclient.md) | <p><br></p>                                      |
| **Throws:**                                                                       |                                                  |
| java.lang.IllegalArgumentException                                                | Occurs if the context or listener is not normal. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
