> For the complete documentation index, see [llms.txt](https://docs.onside.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onside.io/sdk/purchase-validation/merchant-api/models.md).

# Models

## The TransactionHistory object

```json
{"openapi":"3.0.3","info":{"title":"Onside Purchase Validation API","version":"1.0.0"},"components":{"schemas":{"TransactionHistory":{"type":"object","properties":{"transactions":{"type":"array","items":{"$ref":"#/components/schemas/InAppPurchase"}}},"required":["transactions"]},"InAppPurchase":{"type":"object","properties":{"app_account_token":{"type":"string","nullable":true,"description":"The user account ID."},"bundle_id":{"type":"string","description":"The bundle ID."},"currency":{"type":"string","description":"The currency code (ISO 4217)."},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"The subscription expiration date. None if not a subscription."},"order_id":{"type":"string","format":"uuid","description":"The transaction ID."},"original_order_id":{"type":"string","format":"uuid","description":"The original transaction ID."},"original_purchase_date":{"type":"string","format":"date-time","description":"The original purchase date."},"price":{"type":"integer","format":"int64","description":"The price in the smallest currency unit."},"product_id":{"type":"string","description":"The product ID."},"product_slug":{"type":"string","nullable":true,"description":"The product slug."},"product_type":{"$ref":"#/components/schemas/InAppProductType"},"purchase_date":{"type":"string","format":"date-time","description":"The purchase or renewal date."},"quantity":{"type":"integer","minimum":1,"description":"The quantity."},"revocation_date":{"type":"string","format":"date-time","nullable":true,"description":"The revocation date. None if not revoked."},"revocation_reason":{"$ref":"#/components/schemas/RevocationReason","nullable":true},"fetched_at":{"type":"string","format":"date-time","description":"The time of the data fetch."},"subscription_id":{"type":"string","nullable":true,"description":"The subscription group ID. None if not a subscription."},"transaction_reason":{"$ref":"#/components/schemas/TransactionReason"},"user_country":{"type":"string","minLength":2,"maxLength":2,"description":"The user country (ISO 3166-1 alpha-2)."}},"required":["bundle_id","currency","order_id","original_order_id","original_purchase_date","price","product_id","product_type","purchase_date","quantity","fetched_at","transaction_reason","user_country"]},"InAppProductType":{"type":"string","enum":["NON_CONSUMABLE","CONSUMABLE","SUBSCRIPTION"],"description":"The type of in-app product."},"RevocationReason":{"type":"string","enum":["Refund"],"description":"Transaction revocation reason."},"TransactionReason":{"type":"string","enum":["PURCHASE","RENEWAL","REFUND","CHARGEBACK"],"description":"The reason for the transaction."}}}}
```

## The InAppPurchase object

```json
{"openapi":"3.0.3","info":{"title":"Onside Purchase Validation API","version":"1.0.0"},"components":{"schemas":{"InAppPurchase":{"type":"object","properties":{"app_account_token":{"type":"string","nullable":true,"description":"The user account ID."},"bundle_id":{"type":"string","description":"The bundle ID."},"currency":{"type":"string","description":"The currency code (ISO 4217)."},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"The subscription expiration date. None if not a subscription."},"order_id":{"type":"string","format":"uuid","description":"The transaction ID."},"original_order_id":{"type":"string","format":"uuid","description":"The original transaction ID."},"original_purchase_date":{"type":"string","format":"date-time","description":"The original purchase date."},"price":{"type":"integer","format":"int64","description":"The price in the smallest currency unit."},"product_id":{"type":"string","description":"The product ID."},"product_slug":{"type":"string","nullable":true,"description":"The product slug."},"product_type":{"$ref":"#/components/schemas/InAppProductType"},"purchase_date":{"type":"string","format":"date-time","description":"The purchase or renewal date."},"quantity":{"type":"integer","minimum":1,"description":"The quantity."},"revocation_date":{"type":"string","format":"date-time","nullable":true,"description":"The revocation date. None if not revoked."},"revocation_reason":{"$ref":"#/components/schemas/RevocationReason","nullable":true},"fetched_at":{"type":"string","format":"date-time","description":"The time of the data fetch."},"subscription_id":{"type":"string","nullable":true,"description":"The subscription group ID. None if not a subscription."},"transaction_reason":{"$ref":"#/components/schemas/TransactionReason"},"user_country":{"type":"string","minLength":2,"maxLength":2,"description":"The user country (ISO 3166-1 alpha-2)."}},"required":["bundle_id","currency","order_id","original_order_id","original_purchase_date","price","product_id","product_type","purchase_date","quantity","fetched_at","transaction_reason","user_country"]},"InAppProductType":{"type":"string","enum":["NON_CONSUMABLE","CONSUMABLE","SUBSCRIPTION"],"description":"The type of in-app product."},"RevocationReason":{"type":"string","enum":["Refund"],"description":"Transaction revocation reason."},"TransactionReason":{"type":"string","enum":["PURCHASE","RENEWAL","REFUND","CHARGEBACK"],"description":"The reason for the transaction."}}}}
```

## The InAppProductType object

```json
{"openapi":"3.0.3","info":{"title":"Onside Purchase Validation API","version":"1.0.0"},"components":{"schemas":{"InAppProductType":{"type":"string","enum":["NON_CONSUMABLE","CONSUMABLE","SUBSCRIPTION"],"description":"The type of in-app product."}}}}
```

## The TransactionReason object

```json
{"openapi":"3.0.3","info":{"title":"Onside Purchase Validation API","version":"1.0.0"},"components":{"schemas":{"TransactionReason":{"type":"string","enum":["PURCHASE","RENEWAL","REFUND","CHARGEBACK"],"description":"The reason for the transaction."}}}}
```

## The RevocationReason object

```json
{"openapi":"3.0.3","info":{"title":"Onside Purchase Validation API","version":"1.0.0"},"components":{"schemas":{"RevocationReason":{"type":"string","enum":["Refund"],"description":"Transaction revocation reason."}}}}
```


---

# 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://docs.onside.io/sdk/purchase-validation/merchant-api/models.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.
