> For the complete documentation index, see [llms.txt](https://daton-sarasanalytics.gitbook.io/daton/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daton-sarasanalytics.gitbook.io/daton/integrations/data-sources/saas-integrations/smartrr-v2/schema-information.md).

# Schema Information

## Tables/APIs&#x20;

The following is the list of tables or APIs associated with the Smartrr v2 connector:

* [Bills](#bills)&#x20;
* [Customers](#customers)&#x20;
* [Purchasestate](#purchasestate)&#x20;
* [Purchasestateline\_items](#purchasestateline_items)&#x20;
* [Orders](#orders)

#### Bills&#x20;

The Bills API allows you to manage financial transactions and invoices within the Smartrr platform. You can create, update, retrieve, and delete bills, ensuring efficient financial record-keeping.

For more information, see [Bills](https://api.smartrr.com/docs/redoc/?_gl=1*1kf0a87*_gcl_au*NzQ5Mjk1NjEyLjE2OTAzOTI4NzA.#tag/Bill).

<table><thead><tr><th width="186">Field Name</th><th width="83">Data Type</th></tr></thead><tbody><tr><td>createdDate</td><td>TIMESTAMP</td></tr><tr><td>updatedDate</td><td>TIMESTAMP</td></tr><tr><td>id</td><td>NUMERIC</td></tr><tr><td>uniqueId</td><td>STRING</td></tr><tr><td>uniqueShopifyId</td><td>STRING</td></tr><tr><td>status</td><td>STRING</td></tr><tr><td>billingDate</td><td>TIMESTAMP</td></tr><tr><td>billAmount</td><td>STRING</td></tr><tr><td>billCurrency</td><td>STRING</td></tr><tr><td>subscriptionBillingAttemptId</td><td>STRING</td></tr><tr><td>metadata</td><td>RECORD</td></tr><tr><td>error</td><td>STRING</td></tr><tr><td>retryCount</td><td>NUMERIC</td></tr><tr><td>st</td><td>RECORD</td></tr></tbody></table>

#### Customers&#x20;

The Customers API provides functionality to manage customer profiles and information. You can use this API to create, update, retrieve, and delete customer records, helping you maintain a database of your clientele.

For more information, see [Customers](https://api.smartrr.com/docs/redoc/?_gl=1*1kf0a87*_gcl_au*NzQ5Mjk1NjEyLjE2OTAzOTI4NzA.#tag/Customer).

<table><thead><tr><th width="169">Field Name</th><th width="83">Data Type</th></tr></thead><tbody><tr><td>createdDate</td><td>TIMESTAMP</td></tr><tr><td>updatedDate</td><td>TIMESTAMP</td></tr><tr><td>id</td><td>STRING</td></tr><tr><td>shopifyId</td><td>STRING</td></tr><tr><td>receivedFromShopifyDate</td><td>TIMESTAMP</td></tr><tr><td>shopifyUpdateDate</td><td>TIMESTAMP</td></tr><tr><td>email</td><td>STRING</td></tr><tr><td>firstName</td><td>STRING</td></tr><tr><td>lastName</td><td>STRING</td></tr><tr><td>role</td><td>STRING</td></tr><tr><td>customerCurrency</td><td>STRING</td></tr><tr><td>hasLoggedIn</td><td>BOOLEAN</td></tr><tr><td>orderCount</td><td>NUMERIC</td></tr><tr><td>totalOrderCount</td><td>NUMERIC</td></tr><tr><td>totalSpent</td><td>STRING</td></tr><tr><td>otpEntryAttempts</td><td>NUMERIC</td></tr><tr><td>otpSendAttempts</td><td>NUMERIC</td></tr><tr><td>otpVerified</td><td>BOOLEAN</td></tr></tbody></table>

#### Purchasestate&#x20;

The PurchaseState API helps you handle the different states or statuses associated with purchases. It allows you to manage the lifecycle of purchases, from initiation to completion, by creating, updating, retrieving, and deleting purchase states.

For more information, see [Purchasestate](https://api.smartrr.com/docs/redoc/?_gl=1*1kf0a87*_gcl_au*NzQ5Mjk1NjEyLjE2OTAzOTI4NzA.#tag/Purchase-State).

<table><thead><tr><th width="222">Field Name</th><th width="83">Data Type</th></tr></thead><tbody><tr><td>createdDate</td><td>TIMESTAMP</td></tr><tr><td>updatedDate</td><td>TIMESTAMP</td></tr><tr><td>id</td><td>STRING</td></tr><tr><td>shopifyId</td><td>STRING</td></tr><tr><td>shopifyUpdateDate</td><td>TIMESTAMP</td></tr><tr><td>nextBillingDate</td><td>TIMESTAMP</td></tr><tr><td>purchaseStateStatus</td><td>STRING</td></tr><tr><td>initialSubmissionDate</td><td>TIMESTAMP</td></tr><tr><td>createdViaCustomerPortal</td><td>BOOLEAN</td></tr><tr><td>isRepeatCustomer</td><td>BOOLEAN</td></tr><tr><td>sellingPlanId</td><td>STRING</td></tr><tr><td>totalEstimatedTax</td><td>STRING</td></tr><tr><td>totalFromLineItems</td><td>STRING</td></tr><tr><td>totalLineItemsDiscount</td><td>STRING</td></tr><tr><td>totalLineItemsAfterDiscount</td><td>STRING</td></tr><tr><td>totalShipping</td><td>STRING</td></tr><tr><td>totalShippingDiscount</td><td>STRING</td></tr><tr><td>totalDiscount</td><td>STRING</td></tr><tr><td>totalEstimatedNet</td><td>STRING</td></tr><tr><td>currency</td><td>STRING</td></tr><tr><td>shippingAddress</td><td>RECORD</td></tr><tr><td>externalSubscriptionId</td><td>STRING</td></tr><tr><td>externalSubscriptionType</td><td>STRING</td></tr><tr><td>externalSubscriptionStatus</td><td>STRING</td></tr><tr><td>originalExternalSubscriptionStatus</td><td>STRING</td></tr><tr><td>containsBundle</td><td>BOOLEAN</td></tr><tr><td>hasUsedRetentionDiscount</td><td>BOOLEAN</td></tr><tr><td>custRel</td><td>RECORD</td></tr><tr><td>schedule</td><td>RECORD</td></tr><tr><td>stLineItems</td><td>RECORD</td></tr><tr><td>cancelledAt</td><td>TIMESTAMP</td></tr></tbody></table>

#### Purchasestateline\_items&#x20;

This API is designed for managing the line items associated with purchase states. It enables you to add, modify, retrieve, or remove specific items related to a purchase state.

For more information, see [Purchasestateline\_items](https://api.smartrr.com/docs/redoc/?_gl=1*1kf0a87*_gcl_au*NzQ5Mjk1NjEyLjE2OTAzOTI4NzA.#tag/Purchase-State-Line-Item).

<table><thead><tr><th width="164">Field Name</th><th width="83">Data Type</th></tr></thead><tbody><tr><td>createdDate</td><td>TIMESTAMP</td></tr><tr><td>updatedDate</td><td>TIMESTAMP</td></tr><tr><td>id</td><td>STRING</td></tr><tr><td>shopifyId</td><td>STRING</td></tr><tr><td>shopifyUpdateDate</td><td>TIMESTAMP</td></tr><tr><td>idempotencyKey</td><td>STRING</td></tr><tr><td>basePrice</td><td>STRING</td></tr><tr><td>priceAfterDiscounts</td><td>STRING</td></tr><tr><td>priceCurrency</td><td>STRING</td></tr><tr><td>pricingPolicy</td><td>RECORD</td></tr><tr><td>quantity</td><td>NUMERIC</td></tr><tr><td>sellingPlanId</td><td>STRING</td></tr><tr><td>isAddOn</td><td>BOOLEAN</td></tr><tr><td>isRedeemed</td><td>BOOLEAN</td></tr><tr><td>vnt</td><td>RECORD</td></tr><tr><td>cps</td><td>RECORD</td></tr></tbody></table>

#### Orders

The Orders API is a versatile tool for managing orders within the Smartrr system. You can create new orders, update existing ones, retrieve order details, and even delete orders when necessary.

For more information, see [Orders](https://api.smartrr.com/docs/redoc/?_gl=1*1kf0a87*_gcl_au*NzQ5Mjk1NjEyLjE2OTAzOTI4NzA.#tag/Order).

<table><thead><tr><th width="216">Field Name</th><th width="89">Data Type</th></tr></thead><tbody><tr><td>createdDate</td><td>TIMESTAMP</td></tr><tr><td>updatedDate</td><td>TIMESTAMP</td></tr><tr><td>id</td><td>STRING</td></tr><tr><td>shopifyId</td><td>STRING</td></tr><tr><td>receivedFromShopifyDate</td><td>TIMESTAMP</td></tr><tr><td>shopifyUpdateDate</td><td>TIMESTAMP</td></tr><tr><td>shopifyOrderLabel</td><td>STRING</td></tr><tr><td>orderProcessedDate</td><td>TIMESTAMP</td></tr><tr><td>shippingLineItems</td><td>RECORD</td></tr><tr><td>discountApplications</td><td>RECORD</td></tr><tr><td>totalFromLineItems</td><td>STRING</td></tr><tr><td>totalLineItemsDiscount</td><td>STRING</td></tr><tr><td>totalLineItemsAfterDiscount</td><td>STRING</td></tr><tr><td>totalShipping</td><td>STRING</td></tr><tr><td>totalTax</td><td>STRING</td></tr><tr><td>totalDiscount</td><td>STRING</td></tr><tr><td>totalTip</td><td>STRING</td></tr><tr><td>totalRefund</td><td>STRING</td></tr><tr><td>totalBeforeDiscountsAndRefunds</td><td>STRING</td></tr><tr><td>totalNetBeforeRefunds</td><td>STRING</td></tr><tr><td>shopIncome</td><td>STRING</td></tr><tr><td>totalNet</td><td>STRING</td></tr><tr><td>totalOneTimeShopIncome</td><td>STRING</td></tr><tr><td>totalSubscriptionShopIncome</td><td>STRING</td></tr><tr><td>totalAddonShopIncome</td><td>STRING</td></tr><tr><td>orderCurrency</td><td>STRING</td></tr><tr><td>orderSource</td><td>STRING</td></tr><tr><td>orderStatus</td><td>STRING</td></tr><tr><td>financialStatus</td><td>STRING</td></tr><tr><td>fulfillmentStatus</td><td>STRING</td></tr><tr><td>deliveryLatitude</td><td>NUMERIC</td></tr><tr><td>deliveryLongitude</td><td>NUMERIC</td></tr><tr><td>deliveryProvinceCode</td><td>STRING</td></tr><tr><td>deliveryCountryCode</td><td>STRING</td></tr><tr><td>deliveryAddress</td><td>RECORD</td></tr><tr><td>isGifted</td><td>BOOLEAN</td></tr><tr><td>editedBundleOrder</td><td>BOOLEAN</td></tr><tr><td>containsSmartrrBundle</td><td>BOOLEAN</td></tr><tr><td>bundleEditStatus</td><td>STRING</td></tr><tr><td>items</td><td>RECORD</td></tr><tr><td>custRel</td><td>RECORD</td></tr><tr><td>pmtMthJson</td><td>RECORD</td></tr><tr><td>deliveryLongitude_bn</td><td>BIGNUMERIC</td></tr><tr><td>deliveryLatitude_bn</td><td>BIGNUMERIC</td></tr><tr><td>trackingInfo</td><td>RECORD</td></tr><tr><td>taxLineItems</td><td>RECORD</td></tr><tr><td>sts</td><td>RECORD</td></tr></tbody></table>


---

# 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://daton-sarasanalytics.gitbook.io/daton/integrations/data-sources/saas-integrations/smartrr-v2/schema-information.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.
