JSData & Media Start a project

← All connectors

Schema · Entity relationship diagram

Stay AI tables and relationships

Shopify subscriptions from Stay AI (formerly Retextion): subscriptions with status, cancellation, dunning and churn risk, subscription line items, subscription orders and their line items, customers with LTV, the subscription product catalog and selling plan groups.

Live8 tables · 9 relationships
ConnectPaste an API key
Default schemastay_ai
Source API docsdocs.stay.ai
DestinationsAmazon Redshift, Google BigQuery, Snowflake, PostgreSQL, Amazon S3
  • Column names follow Stay AI's own API field names. Shopify ids (order, customer, product, variant, subscription contract) are stored as numbers, so they join to your Shopify tables.
  • Emails, names, phone numbers and street addresses load empty unless you turn on personal data; customer ids, city, state and country are kept.
  • Retention (cancel-flow) sessions, churn reports and customer-portal events are not included: Stay AI only offers them as emailed or webhook-delivered exports, not through its read API.
CATALOGproduct_variants.product_id → products.product_idsubscription_line_items.stay_subscription_id → subscriptions.idorders.stay_subscription_id → subscriptions.idorders.stay_customer_id → customers.stay_customer_idorder_line_items.order_id joins orders.order_id (A checkout that starts two subscriptions is two rows in orders with the same order_id; its lines are stored once.)subscriptions.customer_id joins customers.shopify_customer_idorders.customer_id joins customers.shopify_customer_idsubscription_line_items.shopify_variant_id joins product_variants.variant_idorder_line_items.shopify_variant_id joins product_variants.variant_idcustomerscustomers22stay_customer_id VARCHAR(64) · primary keystay_customer_idvarcharshopify_customer_id BIGINTshopify_customer_idbigintemail VARCHAR(512)emailvarcharfirst_name VARCHAR(256)first_namevarcharlast_name VARCHAR(256)last_namevarcharphone VARCHAR(128)phonevarcharstatus VARCHAR(32)statusvarcharcreated_at TIMESTAMPcreated_attimestampupdated_at TIMESTAMPupdated_attimestampcancelled_at TIMESTAMPcancelled_attimestampltv DECIMAL(18,4)ltvdecimalorders_on_stay_count INTEGERorders_on_stay_countintsubscription_count INTEGERsubscription_countintsubscription_ids VARCHAR(65535)subscription_idsvarcharorigin_stay_order_id VARCHAR(64)origin_stay_order_idvarcharorigin_order_id BIGINTorigin_order_idbigintorigin_order_name VARCHAR(128)origin_order_namevarcharorigin_order_total_price DECIMAL(18,4)origin_order_total_pricedecimalorigin_order_currency VARCHAR(8)origin_order_currencyvarcharorigin_order_processed_at TIMESTAMPorigin_order_processed_attimestamporigin_order_created_at TIMESTAMPorigin_order_created_attimestamp_jsdata_synced TIMESTAMP_jsdata_syncedtimestampsubscription_line_itemssubscription_line_items15_jsdata_key VARCHAR(32) · primary key_jsdata_keyvarcharstay_subscription_id VARCHAR(64) · → subscriptions.idstay_subscription_idvarcharshopify_variant_id BIGINT · → product_variants.variant_idshopify_variant_idbigintsubscription_id BIGINTsubscription_idbigintline_id VARCHAR(128)line_idvarcharshopify_product_id BIGINTshopify_product_idbigintproduct_title VARCHAR(1024)product_titlevarcharvariant_title VARCHAR(1024)variant_titlevarcharsku VARCHAR(256)skuvarcharquantity INTEGERquantityintunit_price DECIMAL(18,4)unit_pricedecimalsubtotal_price DECIMAL(18,4)subtotal_pricedecimalis_one_time BOOLEANis_one_timeboolsubscription_updated_at TIMESTAMPsubscription_updated_attimestamp_jsdata_synced TIMESTAMP_jsdata_syncedtimestampsubscriptionssubscriptions47id VARCHAR(64) · primary keyidvarcharcustomer_id BIGINT · → customers.shopify_customer_idcustomer_idbigintsubscription_id BIGINTsubscription_idbigintemail VARCHAR(512)emailvarcharfirst_name VARCHAR(256)first_namevarcharlast_name VARCHAR(256)last_namevarcharstatus VARCHAR(32)statusvarcharbilling_status VARCHAR(64)billing_statusvarcharcreated_at TIMESTAMPcreated_attimestampupdated_at TIMESTAMPupdated_attimestamplast_charge_date TIMESTAMPlast_charge_datetimestampnext_billing_date TIMESTAMPnext_billing_datetimestamppaused_until TIMESTAMPpaused_untiltimestampcancelled_at TIMESTAMPcancelled_attimestampchurned_at TIMESTAMPchurned_attimestampcancellation_reason VARCHAR(2048)cancellation_reasonvarcharis_in_dunning BOOLEANis_in_dunningbooldunning_started_at TIMESTAMPdunning_started_attimestampdunning_exited_at TIMESTAMPdunning_exited_attimestampfailed_payment_billing_attempts INTEGERfailed_payment_billing_attemptsintout_of_stock_billing_attempts INTEGERout_of_stock_billing_attemptsintprice DECIMAL(18,4)pricedecimaldelivery_price DECIMAL(18,4)delivery_pricedecimalcurrency VARCHAR(8)currencyvarcharorder_interval_frequency INTEGERorder_interval_frequencyintorder_interval_unit VARCHAR(16)order_interval_unitvarcharcompleted_orders_count INTEGERcompleted_orders_countinttotal_orders_count INTEGERtotal_orders_countintprepaid BOOLEANprepaidboolprepaid_next_delivery_date TIMESTAMPprepaid_next_delivery_datetimestampprepaid_shipments_remaining INTEGERprepaid_shipments_remainingintchurn_risk_status VARCHAR(64)churn_risk_statusvarcharchurn_risk DECIMAL(18,6)churn_riskdecimalline_item_count INTEGERline_item_countintdelivery_first_name VARCHAR(256)delivery_first_namevarchardelivery_last_name VARCHAR(256)delivery_last_namevarchardelivery_company VARCHAR(512)delivery_companyvarchardelivery_address1 VARCHAR(512)delivery_address1varchardelivery_address2 VARCHAR(512)delivery_address2varchardelivery_city VARCHAR(256)delivery_cityvarchardelivery_province VARCHAR(256)delivery_provincevarchardelivery_province_code VARCHAR(16)delivery_province_codevarchardelivery_zip VARCHAR(64)delivery_zipvarchardelivery_country VARCHAR(128)delivery_countryvarchardelivery_country_code VARCHAR(8)delivery_country_codevarchardelivery_phone VARCHAR(128)delivery_phonevarchar_jsdata_synced TIMESTAMP_jsdata_syncedtimestampproduct_variantsproduct_variants19variant_id BIGINT · primary keyvariant_idbigintproduct_id BIGINT · → products.product_idproduct_idbiginttitle VARCHAR(1024)titlevarcharstatus VARCHAR(32)statusvarcharimage_url VARCHAR(2048)image_urlvarcharprice DECIMAL(18,4)pricedecimalis_out_of_stock BOOLEANis_out_of_stockboolposition INTEGERpositionintenable_subscription_in_cp BOOLEANenable_subscription_in_cpboolenable_one_time_in_cp BOOLEANenable_one_time_in_cpboolsubscription_discount_type VARCHAR(32)subscription_discount_typevarcharsubscription_discount_amount VARCHAR(64)subscription_discount_amountvarcharone_time_discount_type VARCHAR(32)one_time_discount_typevarcharone_time_discount_amount VARCHAR(64)one_time_discount_amountvarcharsubscription_markdown DECIMAL(18,4)subscription_markdowndecimalone_time_markdown DECIMAL(18,4)one_time_markdowndecimalsubscription_price DECIMAL(18,4)subscription_pricedecimalone_time_price DECIMAL(18,4)one_time_pricedecimal_jsdata_synced TIMESTAMP_jsdata_syncedtimestampordersorders42_jsdata_key VARCHAR(32) · primary key_jsdata_keyvarcharorder_id BIGINTorder_idbigintcustomer_id BIGINT · → customers.shopify_customer_idcustomer_idbigintstay_customer_id VARCHAR(64) · → customers.stay_customer_idstay_customer_idvarcharstay_subscription_id VARCHAR(64) · → subscriptions.idstay_subscription_idvarcharorder_name VARCHAR(128)order_namevarcharorder_number INTEGERorder_numberintsubscription_id BIGINTsubscription_idbigintsource VARCHAR(64)sourcevarcharcreated_at TIMESTAMPcreated_attimestampupdated_at TIMESTAMPupdated_attimestampfulfillment_status VARCHAR(64)fulfillment_statusvarcharcurrency VARCHAR(8)currencyvarchartotal_price DECIMAL(18,4)total_pricedecimalcart_discount_amount DECIMAL(18,4)cart_discount_amountdecimalcurrent_total_tax DECIMAL(18,4)current_total_taxdecimaltotal_shipping_price DECIMAL(18,4)total_shipping_pricedecimaltags VARCHAR(4096)tagsvarcharline_item_count INTEGERline_item_countintline_items_price DECIMAL(18,4)line_items_pricedecimalline_discount DECIMAL(18,4)line_discountdecimalline_items_price_discounted DECIMAL(18,4)line_items_price_discounteddecimalshipping_price DECIMAL(18,4)shipping_pricedecimalshipping_discount DECIMAL(18,4)shipping_discountdecimalshipping_price_discounted DECIMAL(18,4)shipping_price_discounteddecimalorder_discount DECIMAL(18,4)order_discountdecimaltotal_discount DECIMAL(18,4)total_discountdecimaltotal_tax DECIMAL(18,4)total_taxdecimalshipping_source VARCHAR(64)shipping_sourcevarcharshipping_first_name VARCHAR(256)shipping_first_namevarcharshipping_last_name VARCHAR(256)shipping_last_namevarcharshipping_company VARCHAR(512)shipping_companyvarcharshipping_address1 VARCHAR(512)shipping_address1varcharshipping_address2 VARCHAR(512)shipping_address2varcharshipping_city VARCHAR(256)shipping_cityvarcharshipping_province VARCHAR(256)shipping_provincevarcharshipping_province_code VARCHAR(16)shipping_province_codevarcharshipping_zip VARCHAR(64)shipping_zipvarcharshipping_country VARCHAR(128)shipping_countryvarcharshipping_country_code VARCHAR(8)shipping_country_codevarcharshipping_phone VARCHAR(128)shipping_phonevarchar_jsdata_synced TIMESTAMP_jsdata_syncedtimestamporder_line_itemsorder_line_items17_jsdata_key VARCHAR(32) · primary key_jsdata_keyvarcharorder_id BIGINT · → orders.order_idorder_idbigintshopify_variant_id BIGINT · → product_variants.variant_idshopify_variant_idbigintline_id BIGINTline_idbigintshopify_product_id BIGINTshopify_product_idbigintproduct_title VARCHAR(1024)product_titlevarcharvariant_title VARCHAR(1024)variant_titlevarcharsku VARCHAR(256)skuvarcharquantity INTEGERquantityintsubtotal_price DECIMAL(18,4)subtotal_pricedecimaloriginal_line_price DECIMAL(18,4)original_line_pricedecimalline_discount DECIMAL(18,4)line_discountdecimalis_one_time BOOLEANis_one_timeboolsubscription_id BIGINTsubscription_idbigintcustom_attributes VARCHAR(65535)custom_attributesvarcharorder_updated_at TIMESTAMPorder_updated_attimestamp_jsdata_synced TIMESTAMP_jsdata_syncedtimestampproductsproducts9product_id BIGINT · primary keyproduct_idbiginttitle VARCHAR(1024)titlevarcharstatus VARCHAR(32)statusvarcharimage_url VARCHAR(2048)image_urlvarcharis_bundle_parent BOOLEANis_bundle_parentboolcarousel_position INTEGERcarousel_positionintsort_position INTEGERsort_positionintvariant_count INTEGERvariant_countint_jsdata_synced TIMESTAMP_jsdata_syncedtimestampselling_plan_groupsselling_plan_groups18id VARCHAR(64) · primary keyidvarcharshopify_selling_plan_group_id BIGINTshopify_selling_plan_group_idbigintcustom_label VARCHAR(1024)custom_labelvarcharcustom_description VARCHAR(4096)custom_descriptionvarchargroup_type VARCHAR(32)group_typevarcharbundle_line_type VARCHAR(32)bundle_line_typevarcharbundle_minimum INTEGERbundle_minimumintbundle_maximum INTEGERbundle_maximumintskip_one_product_enabled BOOLEANskip_one_product_enabledboolcutoff_days INTEGERcutoff_daysintanchor_calculation_use_billing_interval BOOLEANanchor_calculation_use_billing_intervalboolallow_gifting BOOLEANallow_giftingboolprepaid_allow_renewal BOOLEANprepaid_allow_renewalboolcreated_at TIMESTAMPcreated_attimestampupdated_at TIMESTAMPupdated_attimestampanchors VARCHAR(65535)anchorsvarcharbundle_map VARCHAR(65535)bundle_mapvarchar_jsdata_synced TIMESTAMP_jsdata_syncedtimestamp
Primary keyForeign keyReferencesJoins on (not a key)

Drag to pan, scroll or pinch to zoom, click a table to see what it joins to.

Table reference

8 tables · click a table for its columns
subscriptions47 columns · Subscriptionsshow in diagram

Primary key: id

ColumnTypeKeyDescription
idPrimary key. Stay AI's own subscription id; subscription_id is the Shopify subscription contract id.varchar(64)PK Primary key. Stay AI's own subscription id; subscription_id is the Shopify subscription contract id.
subscription_idbigint
customer_idJoins to customers.shopify_customer_id.bigintFKJoins to customers.shopify_customer_id.
emailvarchar(512)
first_namevarchar(256)
last_namevarchar(256)
statusvarchar(32)
billing_statusvarchar(64)
created_attimestamp
updated_attimestamp
last_charge_datetimestamp
next_billing_datetimestamp
paused_untiltimestamp
cancelled_attimestamp
churned_attimestamp
cancellation_reasonvarchar(2048)
is_in_dunningboolean
dunning_started_attimestamp
dunning_exited_attimestamp
failed_payment_billing_attemptsinteger
out_of_stock_billing_attemptsinteger
pricedecimal(18,4)
delivery_pricedecimal(18,4)
currencyvarchar(8)
order_interval_frequencyinteger
order_interval_unitvarchar(16)
completed_orders_countinteger
total_orders_countinteger
prepaidboolean
prepaid_next_delivery_datetimestamp
prepaid_shipments_remaininginteger
churn_risk_statusvarchar(64)
churn_riskdecimal(18,6)
line_item_countinteger
delivery_first_namevarchar(256)
delivery_last_namevarchar(256)
delivery_companyvarchar(512)
delivery_address1varchar(512)
delivery_address2varchar(512)
delivery_cityvarchar(256)
delivery_provincevarchar(256)
delivery_province_codevarchar(16)
delivery_zipvarchar(64)
delivery_countryvarchar(128)
delivery_country_codevarchar(8)
delivery_phonevarchar(128)
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
subscription_line_items15 columns · Subscriptionsshow in diagram

Primary key: _jsdata_key

ColumnTypeKeyDescription
_jsdata_keyPrimary key.varchar(32)PK Primary key.
stay_subscription_idReferences subscriptions.id.varchar(64)FKReferences subscriptions.id.
subscription_idbigint
line_idvarchar(128)
shopify_product_idbigint
shopify_variant_idJoins to product_variants.variant_id.bigintFKJoins to product_variants.variant_id.
product_titlevarchar(1024)
variant_titlevarchar(1024)
skuvarchar(256)
quantityinteger
unit_pricedecimal(18,4)
subtotal_pricedecimal(18,4)
is_one_timeboolean
subscription_updated_atThe parent subscription's updated_at when this line was last seen. Older than subscriptions.updated_at means the line was removed in Stay AI.timestampThe parent subscription's updated_at when this line was last seen. Older than subscriptions.updated_at means the line was removed in Stay AI.
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
customers22 columns · Subscriptionsshow in diagram

Primary key: stay_customer_id

ColumnTypeKeyDescription
stay_customer_idPrimary key.varchar(64)PK Primary key.
shopify_customer_idbigint
emailvarchar(512)
first_namevarchar(256)
last_namevarchar(256)
phonevarchar(128)
statusvarchar(32)
created_attimestamp
updated_attimestamp
cancelled_attimestamp
ltvdecimal(18,4)
orders_on_stay_countinteger
subscription_countinteger
subscription_idsvarchar(65535)
origin_stay_order_idvarchar(64)
origin_order_idbigint
origin_order_namevarchar(128)
origin_order_total_pricedecimal(18,4)
origin_order_currencyvarchar(8)
origin_order_processed_attimestamp
origin_order_created_attimestamp
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
orders42 columns · Ordersshow in diagram

Primary key: _jsdata_key

ColumnTypeKeyDescription
_jsdata_keyPrimary key. md5(order_id, stay_subscription_id). One row per Stay order record: a checkout that starts two subscriptions appears twice with the same order_id and totals, so count distinct order_id when summing revenue.varchar(32)PK Primary key. md5(order_id, stay_subscription_id). One row per Stay order record: a checkout that starts two subscriptions appears twice with the same order_id and totals, so count distinct order_id when summing revenue.
order_idbigint
order_namevarchar(128)
order_numberinteger
customer_idJoins to customers.shopify_customer_id.bigintFKJoins to customers.shopify_customer_id.
stay_customer_idReferences customers.stay_customer_id.varchar(64)FKReferences customers.stay_customer_id.
subscription_idbigint
stay_subscription_idReferences subscriptions.id.varchar(64)FKReferences subscriptions.id.
sourcevarchar(64)
created_attimestamp
updated_attimestamp
fulfillment_statusvarchar(64)
currencyvarchar(8)
total_pricedecimal(18,4)
cart_discount_amountdecimal(18,4)
current_total_taxdecimal(18,4)
total_shipping_pricedecimal(18,4)
tagsvarchar(4096)
line_item_countinteger
line_items_pricedecimal(18,4)
line_discountdecimal(18,4)
line_items_price_discounteddecimal(18,4)
shipping_pricedecimal(18,4)
shipping_discountdecimal(18,4)
shipping_price_discounteddecimal(18,4)
order_discountdecimal(18,4)
total_discountdecimal(18,4)
total_taxdecimal(18,4)
shipping_sourcevarchar(64)
shipping_first_namevarchar(256)
shipping_last_namevarchar(256)
shipping_companyvarchar(512)
shipping_address1varchar(512)
shipping_address2varchar(512)
shipping_cityvarchar(256)
shipping_provincevarchar(256)
shipping_province_codevarchar(16)
shipping_zipvarchar(64)
shipping_countryvarchar(128)
shipping_country_codevarchar(8)
shipping_phonevarchar(128)
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
order_line_items17 columns · Ordersshow in diagram

Primary key: _jsdata_key

ColumnTypeKeyDescription
_jsdata_keyPrimary key.varchar(32)PK Primary key.
order_idJoins to orders.order_id (A checkout that starts two subscriptions is two rows in orders with the same order_id; its lines are stored once.).bigintFKJoins to orders.order_id (A checkout that starts two subscriptions is two rows in orders with the same order_id; its lines are stored once.).
line_idbigint
shopify_product_idbigint
shopify_variant_idJoins to product_variants.variant_id.bigintFKJoins to product_variants.variant_id.
product_titlevarchar(1024)
variant_titlevarchar(1024)
skuvarchar(256)
quantityinteger
subtotal_pricedecimal(18,4)
original_line_pricedecimal(18,4)
line_discountdecimal(18,4)
is_one_timeboolean
subscription_idbigint
custom_attributesShopify line item properties as JSON; keys that look personal (email, phone, name, address) are blanked unless personal data is included.varchar(65535)Shopify line item properties as JSON; keys that look personal (email, phone, name, address) are blanked unless personal data is included.
order_updated_attimestamp
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
products9 columns · Catalogshow in diagram

Primary key: product_id

ColumnTypeKeyDescription
product_idPrimary key.bigintPK Primary key.
titlevarchar(1024)
statusvarchar(32)
image_urlvarchar(2048)
is_bundle_parentboolean
carousel_positioninteger
sort_positioninteger
variant_countinteger
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
product_variants19 columns · Catalogshow in diagram

Primary key: variant_id

ColumnTypeKeyDescription
variant_idPrimary key.bigintPK Primary key.
product_idReferences products.product_id.bigintFKReferences products.product_id.
titlevarchar(1024)
statusvarchar(32)
image_urlvarchar(2048)
pricedecimal(18,4)
is_out_of_stockboolean
positioninteger
enable_subscription_in_cpboolean
enable_one_time_in_cpboolean
subscription_discount_typevarchar(32)
subscription_discount_amountvarchar(64)
one_time_discount_typevarchar(32)
one_time_discount_amountvarchar(64)
subscription_markdowndecimal(18,4)
one_time_markdowndecimal(18,4)
subscription_pricedecimal(18,4)
one_time_pricedecimal(18,4)
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.
selling_plan_groups18 columns · Catalogshow in diagram

Primary key: id

ColumnTypeKeyDescription
idPrimary key.varchar(64)PK Primary key.
shopify_selling_plan_group_idbigint
custom_labelvarchar(1024)
custom_descriptionvarchar(4096)
group_typevarchar(32)
bundle_line_typevarchar(32)
bundle_minimuminteger
bundle_maximuminteger
skip_one_product_enabledboolean
cutoff_daysinteger
anchor_calculation_use_billing_intervalboolean
allow_giftingboolean
prepaid_allow_renewalboolean
created_attimestamp
updated_attimestamp
anchorsvarchar(65535)
bundle_mapvarchar(65535)
_jsdata_syncedWhen jsdata last wrote this row.timestampWhen jsdata last wrote this row.

Connect Stay AI All connectors