---
title: store_credit_transactions
description: >-
  Reference for the ShopifyQL `store_credit_transactions` table. Every metric
  and dimension, paired with worked example queries.
api_version: 2026-07
source_url:
  html: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/store_credit_transactions
  md: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/store_credit_transactions.md
api_name: shopifyql
---

# store\_​credit\_​transactions

The `store_credit_transactions` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) 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.

### Use cases

* **Movement by event**: Group [`credited_store_credit_value`](#storecredittransactionsmetric-propertydetail-creditedstorecreditvalue), [`debited_store_credit_value`](#storecredittransactionsmetric-propertydetail-debitedstorecreditvalue), and [`expired_store_credit_value`](#storecredittransactionsmetric-propertydetail-expiredstorecreditvalue) by [`store_credit_event`](#storecredittransactionsdimension-propertydetail-storecreditevent) to break down how much credit was issued, redeemed, and expired.
* **Movement source**: Filter or group by [`store_credit_source`](#storecredittransactionsdimension-propertydetail-storecreditsource) to show where credit movements originated.
* **Account link**: Use [`customer_id`](#storecredittransactionsdimension-propertydetail-customerid), [`order_id`](#storecredittransactionsdimension-propertydetail-orderid), and [`company_id`](#storecredittransactionsdimension-propertydetail-companyid) to connect transactions to the affected account or commerce object.
* **Currency**: Compare transaction values by [`store_credit_currency`](#storecredittransactionsdimension-propertydetail-storecreditcurrency) to separate credit movement across the currencies you operate in.

Examples

### 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/latest/syntax/with#total-columns) to add the all-source total to every row.

  ##### ShopifyQL

  ```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_bar
  ```

* ####

  ##### Description

  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

  ```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_bar
  ```

* ####

  ##### Description

  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/latest/syntax/with#percent-change-columns) with \[\`COMPARE TO previous\_period\`]\(/docs/api/shopifyql/latest/syntax/compare-to) to add the month-over-month change for each.

  ##### ShopifyQL

  ```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_period
  ```

* ####

  ##### Description

  Track weekly \`debited\_store\_credit\_value\` across last quarter. This example uses \[\`WITH TOTALS\`]\(/docs/api/shopifyql/latest/syntax/with#total-columns) to add a total for last quarter beside the weekly rows.

  ##### ShopifyQL

  ```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
  ```

***

## Metrics

Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.

Metrics you can use when querying `FROM store_credit_transactions`.

* **credited\_​store\_​credit\_​value**

  **MONEY**

  The value of store credit added to customer balances by transactions in your results. Use [`store_credit_currency`](#storecredittransactionsdimension-propertydetail-storecreditcurrency) to see the currency for those amounts.

* **debited\_​store\_​credit\_​value**

  **MONEY**

  The value of store credit taken from customer balances by transactions in your results. Use [`store_credit_currency`](#storecredittransactionsdimension-propertydetail-storecreditcurrency) to see the currency for those amounts.

* **expired\_​store\_​credit\_​value**

  **MONEY**

  The value of store credit that expired in transactions in your results. Use [`store_credit_currency`](#storecredittransactionsdimension-propertydetail-storecreditcurrency) to see the currency for those amounts.

### MONEY

A monetary amount representing currency values such as prices, revenue, costs, and discounts.

```ts
```

***

## Dimensions

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 `FROM store_credit_transactions`.

* **company\_​id**

  **IDENTITY**

  [`company_id`](#storecredittransactionsdimension-propertydetail-companyid) is the unique Shopify identifier for the B2B company linked to the store credit transaction. Use it with [`company_name`](#storecredittransactionsdimension-propertydetail-companyname) to show readable labels.

* **company\_​location\_​id**

  **IDENTITY**

  [`company_location_id`](#storecredittransactionsdimension-propertydetail-companylocationid) is the unique Shopify identifier for the company location linked to the store credit transaction. Use it with [`company_location_name`](#storecredittransactionsdimension-propertydetail-companylocationname) to show readable labels.

* **customer\_​id**

  **IDENTITY**

  [`customer_id`](#storecredittransactionsdimension-propertydetail-customerid) is the unique Shopify identifier for the customer linked to the store credit transaction. Use it with [`customer_name`](#storecredittransactionsdimension-propertydetail-customername) or [`customer_email`](#storecredittransactionsdimension-propertydetail-customeremail) to show readable labels.

* **day**

  **DAY\_TIMESTAMP**

  The day a store credit transaction happened.

* **day\_​of\_​week**

  **DAY\_OF\_WEEK**

  The day of the week a store credit transaction happened, with values Monday through Sunday.

* **hour**

  **HOUR\_TIMESTAMP**

  The hour a store credit transaction happened.

* **hour\_​of\_​day**

  **HOUR\_OF\_DAY**

  The hour of day a store credit transaction happened, with values 0 through 23.

* **minute**

  **MINUTE\_TIMESTAMP**

  The minute a store credit transaction happened.

* **month**

  **MONTH\_TIMESTAMP**

  The month a store credit transaction happened.

* **month\_​of\_​year**

  **MONTH\_OF\_YEAR**

  The month of year a store credit transaction happened, with values 1 through 12.

* **order\_​id**

  **IDENTITY**

  [`order_id`](#storecredittransactionsdimension-propertydetail-orderid) is the unique Shopify identifier for the order linked to the store credit transaction. Use it with [`order_name`](#storecredittransactionsdimension-propertydetail-ordername) to show the customer-facing order name or number.

* **quarter**

  **QUARTER\_TIMESTAMP**

  The quarter a store credit transaction happened.

* **second**

  **SECOND\_TIMESTAMP**

  The second a store credit transaction happened.

* **shop\_​id**

  **IDENTITY**

  The unique Shopify identifier for your store. Use [`shop_id`](#storecredittransactionsdimension-propertydetail-shopid) with [`shop_name`](#storecredittransactionsdimension-propertydetail-shopname) to show readable store labels.

* **store\_​credit\_​currency**

  **STRING**

  Currency of the store credit transaction

* **store\_​credit\_​event**

  **STRING**

  Values include Adjustment, Order cancellation, Order payment, Order refund, and Payment failure.

* **store\_​credit\_​expires\_​at**

  **MINUTE\_TIMESTAMP**

  The date and time a credited store credit amount is set to expire.

* **store\_​credit\_​id**

  **IDENTITY**

  Shopify identifier for the store credit transaction

* **store\_​credit\_​source**

  **STRING**

  The origin can appear as Shopify, a staff member's name, or an app name.

* **week**

  **WEEK\_TIMESTAMP**

  The week a store credit transaction happened.

* **week\_​of\_​year**

  **WEEK\_OF\_YEAR**

  The week of year a store credit transaction happened, with values 1 through 53.

* **year**

  **YEAR\_TIMESTAMP**

  The year a store credit transaction happened.

* **company\_​name**

  **STRING**

  Name of the company

* **shop\_​name**

  **STRING**

  Name of your store

* **company\_​location\_​name**

  **STRING**

  Name of the company location

* **abandoned\_​checkout\_​date**

  **DAY\_TIMESTAMP**

  Date the customer most recently abandoned a cart

* **customer\_​account\_​status**

  **STRING**

  The customer's account state, with values Declined, Disabled, Enabled, and Invited.

* **customer\_​added\_​date**

  **DAY\_TIMESTAMP**

  The day the customer record was added, reported in your store's time zone.

* **customer\_​created\_​by\_​app\_​id**

  **IDENTITY**

  The Shopify identifier for the app that created the customer.

* **customer\_​email**

  **STRING**

  Email address of the customer

* **customer\_​email\_​domain**

  **STRING**

  The part of the customer's email address after the @ symbol, such as gmail.com or your company's domain.

* **customer\_​language**

  **STRING**

  Language associated with the customer

* **customer\_​name**

  **STRING**

  Full name of the customer

* **is\_​b2b\_​order**

  **BOOLEAN**

  Whether the order is a B2B order, with values `true` and `false`.

* **is\_​canceled\_​order**

  **BOOLEAN**

  Whether the order is canceled, with values `true` and `false`.

* **order\_​checkout\_​currency**

  **STRING**

  The currency the buyer saw at checkout when placing the order. Values are currency codes such as USD, CAD, EUR, and GBP.

* **order\_​fulfillment\_​status**

  **STRING**

  The order's fulfillment state, with values Fulfilled, Partial, Restocked, and Unfulfilled.

* **order\_​includes\_​duties**

  **BOOLEAN**

  Whether the order includes duties, with values `true` and `false`.

* **order\_​name**

  **STRING**

  The name or number of the order as the customer sees it.

* **order\_​payment\_​status**

  **STRING**

  The order's payment state, such as Authorized, Paid, Partially refunded, or Pending.

* **order\_​sales\_​channel**

  **STRING**

  The sales channel where the order was placed, shown as a channel name such as Online Store or POS.

* **order\_​sales\_​channel\_​id**

  **IDENTITY**

  The unique Shopify identifier for the order's sales channel. Use [`order_sales_channel_id`](#storecredittransactionsdimension-propertydetail-ordersaleschannelid) with [`order_sales_channel`](#storecredittransactionsdimension-propertydetail-ordersaleschannel) to show readable channel labels.

### IDENTITY

A unique identifier for a Shopify resource such as a customer, product, or order.

```ts
```

### DAY\_TIMESTAMP

A date value truncated to day precision.

```ts
```

### DAY\_OF\_WEEK

A day within a week, used for weekday-based grouping and filtering.

```ts
```

### HOUR\_TIMESTAMP

A timestamp truncated to hour precision.

```ts
```

### HOUR\_OF\_DAY

An hour within a day, typically represented as an integer from 0 to 23.

```ts
```

### MINUTE\_TIMESTAMP

A timestamp truncated to minute precision.

```ts
```

### MONTH\_TIMESTAMP

A date value representing the start of a month.

```ts
```

### MONTH\_OF\_YEAR

A month number within a year.

```ts
```

### QUARTER\_TIMESTAMP

A date value representing the start of a fiscal quarter.

```ts
```

### SECOND\_TIMESTAMP

A timestamp truncated to second precision.

```ts
```

### STRING

A sequence of characters representing text data.

```ts
```

### WEEK\_TIMESTAMP

A date value representing the start of a week.

```ts
```

### WEEK\_OF\_YEAR

A week number within a year.

```ts
```

### YEAR\_TIMESTAMP

A date value representing the start of a year.

```ts
```

### BOOLEAN

A true or false value representing binary states.

```ts
```

***

## MATCHES expressions

Use these expressions inside a [`MATCHES`](https://shopify.dev/docs/api/shopifyql/latest/syntax/where#matches) filter to keep `store_credit_transactions` rows that have at least one related record matching the parameters. Each parameter filters on a dimension or metric of the related records.

* **customer.​orders\_​placed**

  **StoreCreditTransactionsCustomerOrdersPlacedConditions**

  Orders the customer placed, filterable by order date, source app, location, order count, and spend.

* **customer.​products\_​purchased**

  **StoreCreditTransactionsCustomerProductsPurchasedConditions**

  Products the customer bought, filterable by product ID, purchase date, quantity per order, and total quantity.

* **customer.​shopify\_​email.​bounced**

  **StoreCreditTransactionsCustomerShopifyEmailBouncedConditions**

  Emails that bounced for the customer, filterable by marketing activity, bounce date, and bounce count.

* **customer.​shopify\_​email.​clicked**

  **StoreCreditTransactionsCustomerShopifyEmailClickedConditions**

  Emails the customer clicked, filterable by marketing activity, click date, and click count.

* **customer.​shopify\_​email.​delivered**

  **StoreCreditTransactionsCustomerShopifyEmailDeliveredConditions**

  Emails delivered to the customer, filterable by marketing activity, delivery date, and delivery count.

* **customer.​shopify\_​email.​marked\_​as\_​spam**

  **StoreCreditTransactionsCustomerShopifyEmailMarkedAsSpamConditions**

  Emails the customer marked as spam, filterable by marketing activity, spam-report date, and spam-report count.

* **customer.​shopify\_​email.​opened**

  **StoreCreditTransactionsCustomerShopifyEmailOpenedConditions**

  Emails the customer opened, filterable by marketing activity, open date, and open count.

* **customer.​shopify\_​email.​unsubscribed**

  **StoreCreditTransactionsCustomerShopifyEmailUnsubscribedConditions**

  Email unsubscribe events for the customer, filterable by marketing activity, unsubscribe date, and unsubscribe count.

* **customer.​store\_​credit\_​accounts**

  **StoreCreditTransactionsCustomerStoreCreditAccountsConditions**

  Store credit accounts for the customer, filterable by balance, currency, expiry date, and most recent credit date.

* **customer.​storefront\_​event.​collection\_​viewed**

  **StoreCreditTransactionsCustomerStorefrontEventCollectionViewedConditions**

  Collection pages the customer viewed, filterable by collection ID, view date, and view count.

* **customer.​storefront\_​event.​product\_​viewed**

  **StoreCreditTransactionsCustomerStorefrontEventProductViewedConditions**

  Product pages the customer viewed, filterable by product ID, view date, and view count.

* **customer.​within\_​distance**

  **StoreCreditTransactionsCustomerWithinDistanceConditions**

  Customers with an address within a distance of a location, filterable by coordinates and radius.

### StoreCreditTransactionsCustomerOrdersPlacedConditions

Fields you can use inside \`customer.orders\_placed MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* amount

  Filter. Amount spent per order.

  ```ts
  MONEY
  ```

* app\_id

  Filter. App ID associated with the order.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date the order was placed.

  ```ts
  TIMESTAMP
  ```

* location\_id

  Filter. Location ID associated with the order.

  ```ts
  IDENTITY
  ```

* count

  Metric. Number of orders placed.

  ```ts
  INTEGER
  ```

* sum\_amount

  Metric. Amount spent in the date range.

  ```ts
  MONEY
  ```

### TIMESTAMP

A full-precision timestamp including date and time.

```ts
```

### INTEGER

A whole number without decimal places, used for counts, quantities, and other discrete numeric values.

```ts
```

### StoreCreditTransactionsCustomerProductsPurchasedConditions

Fields you can use inside \`customer.products\_purchased MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* date

  Filter. Date the product(s) were purchased.

  ```ts
  TIMESTAMP
  ```

* id

  Filter. Product IDs.

  ```ts
  IDENTITY
  ```

* quantity

  Filter. Number purchased per order.

  ```ts
  INTEGER
  ```

* sum\_quantity

  Metric. Number purchased within the date range.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerShopifyEmailBouncedConditions

Fields you can use inside \`customer.shopify\_email.bounced MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was bounced.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was bounced.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerShopifyEmailClickedConditions

Fields you can use inside \`customer.shopify\_email.clicked MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was clicked.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was clicked.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerShopifyEmailDeliveredConditions

Fields you can use inside \`customer.shopify\_email.delivered MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was delivered.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was delivered.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerShopifyEmailMarkedAsSpamConditions

Fields you can use inside \`customer.shopify\_email.marked\_as\_spam MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was marked as spam.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was marked as spam.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerShopifyEmailOpenedConditions

Fields you can use inside \`customer.shopify\_email.opened MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was opened.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was opened.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerShopifyEmailUnsubscribedConditions

Fields you can use inside \`customer.shopify\_email.unsubscribed MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* activity\_id

  Filter. Marketing activity ID of the email campaign.

  ```ts
  IDENTITY
  ```

* date

  Filter. Date on which the email was unsubscribed.

  ```ts
  TIMESTAMP
  ```

* count

  Metric. Exact number of times an email was unsubscribed.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerStoreCreditAccountsConditions

Fields you can use inside \`customer.store\_credit\_accounts MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* balance

  Filter. Amount available to spend.

  ```ts
  FLOAT
  ```

* currency

  Filter. Currency associated with the account.

  ```ts
  STRING
  ```

* last\_credit\_date

  Filter. Date when credits were last added.

  ```ts
  TIMESTAMP
  ```

* next\_expiry\_date

  Filter. Date when credits expire.

  ```ts
  TIMESTAMP
  ```

### FLOAT

A floating-point number used for measurements, rates, and other continuous numeric values.

```ts
```

### StoreCreditTransactionsCustomerStorefrontEventCollectionViewedConditions

Fields you can use inside \`customer.storefront\_event.collection\_viewed MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* date

  Filter. Date collection was viewed.

  ```ts
  TIMESTAMP
  ```

* id

  Filter. Collection ID.

  ```ts
  IDENTITY
  ```

* count

  Metric. Times collection was viewed.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerStorefrontEventProductViewedConditions

Fields you can use inside \`customer.storefront\_event.product\_viewed MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* date

  Filter. Date product was viewed.

  ```ts
  TIMESTAMP
  ```

* id

  Filter. Product ID.

  ```ts
  IDENTITY
  ```

* count

  Metric. Times product was viewed.

  ```ts
  INTEGER
  ```

### StoreCreditTransactionsCustomerWithinDistanceConditions

Fields you can use inside \`customer.within\_distance MATCHES (...)\` when querying \`FROM store\_credit\_transactions\`.

* coordinates

  Filter. Latitude and longitude of location. Required.

  ```ts
  GEO_COORDINATE
  ```

* distance\_km

  Filter. Maximum distance from location, in kilometers. Required: provide one of the \`distance\_km/mi\` group.

  ```ts
  FLOAT
  ```

* distance\_mi

  Filter. Maximum distance from location, in miles. Required: provide one of the \`distance\_km/mi\` group.

  ```ts
  FLOAT
  ```

### GEO\_COORDINATE

A geographic coordinate value.

```ts
```

***

## Related schemas

* [`store_credit_summaries`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/store_credit_summaries): Daily balance snapshots aggregated from these transactions.
* [`payments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payments): Transaction data when you want to see how store credit fits into the full payment mix.
* [`customers`](https://shopify.dev/docs/api/shopifyql/latest/schemas/customers/customers): Customer-level data to enrich the top-spender list with lifetime value.

***
