store_ credit_ transactions
The store_credit_transactions schema captures individual store credit movements. Use it to trace why store credit changed and which customer, order, company, source, or event a movement belongs to.
Anchor to Use casesUse cases
- Movement by event: Group
credited_store_credit_value,debited_store_credit_value, andexpired_store_credit_valuebystore_credit_eventto break down how much credit was issued, redeemed, and expired. - Movement source: Filter or group by
store_credit_sourceto show where credit movements originated. - Account link: Use
customer_id,order_id, andcompany_idto connect transactions to the affected account or commerce object. - Currency: Compare transaction values by
store_credit_currencyto separate credit movement across the currencies you operate in.
ShopifyQL
Examples
Description
Compare store-credit sources this quarter by `credited_store_credit_value`, with the value redeemed and expired beside it. This example uses [`WITH TOTALS`](/docs/api/shopifyql/2026-01/syntax/with#total-columns) to add the all-source total to every row.
ShopifyQL
FROM store_credit_transactions SHOW credited_store_credit_value, debited_store_credit_value, expired_store_credit_value GROUP BY store_credit_source WITH TOTALS DURING this_quarter ORDER BY credited_store_credit_value DESC VISUALIZE credited_store_credit_value TYPE horizontal_barDescription
Rank the top 100 customers by total store-credit activity, the combined sum of [`credited_store_credit_value`](#storecredittransactionsmetric-propertydetail-creditedstorecreditvalue) and `debited_store_credit_value`. This example aliases that sum as `total_store_credit_value` with `AS`, then orders by it descending so the most active customers rank first.
ShopifyQL
FROM store_credit_transactions SHOW credited_store_credit_value, debited_store_credit_value, credited_store_credit_value + debited_store_credit_value AS total_store_credit_value GROUP BY customer_name, customer_email WITH TOTALS ORDER BY total_store_credit_value DESC LIMIT 100 VISUALIZE total_store_credit_value TYPE horizontal_barDescription
See whether store credit grew or shrank last month by comparing how much was issued, redeemed, and expired against the prior month. This example uses [`WITH PERCENT_CHANGE`](/docs/api/shopifyql/2026-01/syntax/with#percent-change-columns) with [`COMPARE TO previous_period`](/docs/api/shopifyql/2026-01/syntax/compare-to) to add the month-over-month change for each.
ShopifyQL
FROM store_credit_transactions SHOW credited_store_credit_value, debited_store_credit_value, expired_store_credit_value WITH PERCENT_CHANGE DURING last_month COMPARE TO previous_periodDescription
Track weekly `debited_store_credit_value` across last quarter. This example uses [`WITH TOTALS`](/docs/api/shopifyql/2026-01/syntax/with#total-columns) to add a total for last quarter beside the weekly rows.
ShopifyQL
FROM store_credit_transactions SHOW debited_store_credit_value TIMESERIES week WITH TOTALS DURING last_quarter ORDER BY week ASC VISUALIZE debited_store_credit_value TYPE line
Anchor to MetricsMetrics
Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.
Metrics you can use when querying .
- Anchor to credited_store_credit_valuecredited_
store_ credit_ valuecredited_ store_ credit_ value MONEYMONEY - Anchor to debited_store_credit_valuedebited_
store_ credit_ valuedebited_ store_ credit_ value MONEYMONEY - Anchor to expired_store_credit_valueexpired_
store_ credit_ valueexpired_ store_ credit_ value MONEYMONEY
MONEY
A monetary amount representing currency values such as prices, revenue, costs, and discounts.
Anchor to DimensionsDimensions
Attributes of your data that let you look more granularly at aspects of the data. Group and filter by dimensions to shape the rows your query returns.
Dimensions you can use when querying .
- Anchor to company_idcompany_
idcompany_ id IDENTITYIDENTITY - Anchor to company_location_idcompany_
location_ idcompany_ location_ id IDENTITYIDENTITY - Anchor to customer_idcustomer_
idcustomer_ id IDENTITYIDENTITY - Anchor to daydaydayDAY_TIMESTAMPDAY_TIMESTAMP
The day a store credit transaction happened.
- Anchor to day_of_weekday_
of_ weekday_ of_ week DAY_OF_WEEKDAY_OF_WEEK The day of the week a store credit transaction happened, with values Monday through Sunday.
- Anchor to hourhourhourHOUR_TIMESTAMPHOUR_TIMESTAMP
The hour a store credit transaction happened.
- Anchor to hour_of_dayhour_
of_ dayhour_ of_ day HOUR_OF_DAYHOUR_OF_DAY The hour of day a store credit transaction happened, with values 0 through 23.
- Anchor to minuteminuteminuteMINUTE_TIMESTAMPMINUTE_TIMESTAMP
The minute a store credit transaction happened.
- Anchor to monthmonthmonthMONTH_TIMESTAMPMONTH_TIMESTAMP
The month a store credit transaction happened.
- Anchor to month_of_yearmonth_
of_ yearmonth_ of_ year MONTH_OF_YEARMONTH_OF_YEAR The month of year a store credit transaction happened, with values 1 through 12.
- Anchor to order_idorder_
idorder_ id IDENTITYIDENTITY - Anchor to quarterquarterquarterQUARTER_TIMESTAMPQUARTER_TIMESTAMP
The quarter a store credit transaction happened.
- Anchor to secondsecondsecondSECOND_TIMESTAMPSECOND_TIMESTAMP
The second a store credit transaction happened.
- Anchor to shop_idshop_
idshop_ id IDENTITYIDENTITY - Anchor to store_credit_currencystore_
credit_ currencystore_ credit_ currency STRINGSTRING Currency of the store credit transaction
- Anchor to store_credit_eventstore_
credit_ eventstore_ credit_ event STRINGSTRING Values include Adjustment, Order cancellation, Order payment, Order refund, and Payment failure.
- Anchor to store_credit_expires_atstore_
credit_ expires_ atstore_ credit_ expires_ at MINUTE_TIMESTAMPMINUTE_TIMESTAMP The date and time a credited store credit amount is set to expire.
- Anchor to store_credit_idstore_
credit_ idstore_ credit_ id IDENTITYIDENTITY Shopify identifier for the store credit transaction
- Anchor to store_credit_sourcestore_
credit_ sourcestore_ credit_ source STRINGSTRING The origin can appear as Shopify, a staff member's name, or an app name.
- Anchor to weekweekweekWEEK_TIMESTAMPWEEK_TIMESTAMP
The week a store credit transaction happened.
- Anchor to week_of_yearweek_
of_ yearweek_ of_ year WEEK_OF_YEARWEEK_OF_YEAR The week of year a store credit transaction happened, with values 1 through 53.
- Anchor to yearyearyearYEAR_TIMESTAMPYEAR_TIMESTAMP
The year a store credit transaction happened.
- Anchor to company_namecompany_
namecompany_ name STRINGSTRING Name of the company
- Anchor to shop_nameshop_
nameshop_ name STRINGSTRING Name of your store
- Anchor to company_location_namecompany_
location_ namecompany_ location_ name STRINGSTRING Name of the company location
- Anchor to abandoned_checkout_dateabandoned_
checkout_ dateabandoned_ checkout_ date DAY_TIMESTAMPDAY_TIMESTAMP Date the customer most recently abandoned a cart
- Anchor to customer_account_statuscustomer_
account_ statuscustomer_ account_ status STRINGSTRING The customer's account state, with values Declined, Disabled, Enabled, and Invited.
- Anchor to customer_added_datecustomer_
added_ datecustomer_ added_ date DAY_TIMESTAMPDAY_TIMESTAMP The day the customer record was added, reported in your store's time zone.
- Anchor to customer_created_by_app_idcustomer_
created_ by_ app_ idcustomer_ created_ by_ app_ id IDENTITYIDENTITY The Shopify identifier for the app that created the customer.
- Anchor to customer_emailcustomer_
emailcustomer_ email STRINGSTRING Email address of the customer
- Anchor to customer_email_domaincustomer_
email_ domaincustomer_ email_ domain STRINGSTRING The part of the customer's email address after the @ symbol, such as gmail.com or your company's domain.
- Anchor to customer_languagecustomer_
languagecustomer_ language STRINGSTRING Language associated with the customer
- Anchor to customer_namecustomer_
namecustomer_ name STRINGSTRING Full name of the customer
- Anchor to is_b2b_orderis_
b2b_ orderis_ b2b_ order BOOLEANBOOLEAN Whether the order is a B2B order, with values
trueandfalse.- Anchor to is_canceled_orderis_
canceled_ orderis_ canceled_ order BOOLEANBOOLEAN Whether the order is canceled, with values
trueandfalse.- Anchor to order_checkout_currencyorder_
checkout_ currencyorder_ checkout_ currency STRINGSTRING The currency the buyer saw at checkout when placing the order. Values are currency codes such as USD, CAD, EUR, and GBP.
- Anchor to order_fulfillment_statusorder_
fulfillment_ statusorder_ fulfillment_ status STRINGSTRING The order's fulfillment state, with values Fulfilled, Partial, Restocked, and Unfulfilled.
- Anchor to order_includes_dutiesorder_
includes_ dutiesorder_ includes_ duties BOOLEANBOOLEAN Whether the order includes duties, with values
trueandfalse.- Anchor to order_nameorder_
nameorder_ name STRINGSTRING The name or number of the order as the customer sees it.
- Anchor to order_payment_statusorder_
payment_ statusorder_ payment_ status STRINGSTRING The order's payment state, such as Authorized, Paid, Partially refunded, or Pending.
- Anchor to order_sales_channelorder_
sales_ channelorder_ sales_ channel STRINGSTRING The sales channel where the order was placed, shown as a channel name such as Online Store or POS.
- Anchor to order_sales_channel_idorder_
sales_ channel_ idorder_ sales_ channel_ id IDENTITYIDENTITY
IDENTITY
A unique identifier for a Shopify resource such as a customer, product, or order.
DAY_TIMESTAMP
A date value truncated to day precision.
DAY_OF_WEEK
A day within a week, used for weekday-based grouping and filtering.
HOUR_TIMESTAMP
A timestamp truncated to hour precision.
HOUR_OF_DAY
An hour within a day, typically represented as an integer from 0 to 23.
MINUTE_TIMESTAMP
A timestamp truncated to minute precision.
MONTH_TIMESTAMP
A date value representing the start of a month.
MONTH_OF_YEAR
A month number within a year.
QUARTER_TIMESTAMP
A date value representing the start of a fiscal quarter.
SECOND_TIMESTAMP
A timestamp truncated to second precision.
STRING
A sequence of characters representing text data.
WEEK_TIMESTAMP
A date value representing the start of a week.
WEEK_OF_YEAR
A week number within a year.
YEAR_TIMESTAMP
A date value representing the start of a year.
BOOLEAN
A true or false value representing binary states.
store_credit_summaries: Daily balance snapshots aggregated from these transactions.payments: Transaction data when you want to see how store credit fits into the full payment mix.customers: Customer-level data to enrich the top-spender list with lifetime value.