---
title: payment_attempts
description: >-
  Reference for the ShopifyQL `payment_attempts` 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/payment_attempts
  md: >-
    https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payment_attempts.md
api_name: shopifyql
---

# payment\_​attempts

The `payment_attempts` [schema](https://shopify.dev/docs/api/shopifyql/latest/schemas) captures attempts to authorize payment at checkout, with one row per group of attempts. Use it to analyze authorization rates and retries.

### Use cases

* **Authorization rate**: Group [`payment_authorization_rate`](#paymentattemptsmetric-propertydetail-paymentauthorizationrate) by [`payment_method`](#paymentattemptsdimension-propertydetail-paymentmethod) to compare authorization performance across methods.
* **Retries**: Compare [`unique_payment_attempts`](#paymentattemptsmetric-propertydetail-uniquepaymentattempts) and [`total_payment_attempts`](#paymentattemptsmetric-propertydetail-totalpaymentattempts) to account for retried attempts.
* **Failure breakdown**: Break down [`failed_payment_attempts`](#paymentattemptsmetric-propertydetail-failedpaymentattempts) by [`payment_card_brand`](#paymentattemptsdimension-propertydetail-paymentcardbrand), [`payment_card_wallet`](#paymentattemptsdimension-propertydetail-paymentcardwallet), or [`payment_card_bin_country`](#paymentattemptsdimension-propertydetail-paymentcardbincountry) to find where checkout failures concentrate.
* **In-person vs. online**: Filter [`is_in_person_payment`](#paymentattemptsdimension-propertydetail-isinpersonpayment) to separate in-person payment attempts from online attempts.

Examples

### Examples

* ####

  ##### Description

  Track weekly \`payment\_authorization\_rate\` through the current quarter, with attempt and outcome counts. This example uses \[\`WITH PERCENT\_CHANGE\`]\(/docs/api/shopifyql/latest/syntax/with#percent-change-columns) for the change column, with \[\`COMPARE TO last\_quarter\`]\(/docs/api/shopifyql/latest/syntax/compare-to) aligning each week to the matching week last quarter.

  ##### ShopifyQL

  ```shopifyql
  FROM payment_attempts
    SHOW total_payment_attempts, successful_payments, failed_payment_attempts,
      payment_authorization_rate
    TIMESERIES week WITH PERCENT_CHANGE
    DURING this_quarter
    COMPARE TO last_quarter
    ORDER BY week ASC
  VISUALIZE payment_authorization_rate TYPE line
  ```

* ####

  ##### Description

  Rank the 30 card-issuer countries with the lowest \`payment\_authorization\_rate\` last month. This example uses \[\`HAVING\`]\(/docs/api/shopifyql/latest/syntax/having) \`unique\_payment\_attempts > 50\` to drop low-volume countries from the ranking.

  ##### ShopifyQL

  ```shopifyql
  FROM payment_attempts
    SHOW payment_authorization_rate, unique_payment_attempts
    GROUP BY payment_card_bin_country
    HAVING unique_payment_attempts > 50
    DURING last_month
    ORDER BY payment_authorization_rate ASC
    LIMIT 30
  VISUALIZE payment_authorization_rate TYPE bar
  ```

* ####

  ##### Description

  Track the weekly \`payment\_authorization\_rate\_raw\` across this quarter, each week compared to the quarter before. This example uses \[\`COMPARE TO previous\_period\`]\(/docs/api/shopifyql/latest/syntax/compare-to) to benchmark your date range against the equal-length period right before it.

  ##### ShopifyQL

  ```shopifyql
  FROM payment_attempts
    SHOW payment_authorization_rate_raw
    TIMESERIES week WITH PERCENT_CHANGE
    DURING this_quarter
    COMPARE TO previous_period
    ORDER BY week ASC
  VISUALIZE payment_authorization_rate_raw TYPE line
  ```

* ####

  ##### Description

  Rank the 10 \`payment\_attempt\_group\` values with the most \`successful\_payments\` last month. This example uses \[\`GROUP BY\`]\(/docs/api/shopifyql/latest/syntax/group-by) \`payment\_attempt\_group\` to collapse attempts into one row per group before \`LIMIT 10\` trims the result.

  ##### ShopifyQL

  ```shopifyql
  FROM payment_attempts
    SHOW successful_payments
    GROUP BY payment_attempt_group WITH TOTALS
    DURING last_month
    ORDER BY successful_payments DESC
    LIMIT 10
  VISUALIZE successful_payments TYPE horizontal_bar
  ```

***

## 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 payment_attempts`.

* **failed\_​payment\_​attempts**

  **INTEGER**

  Number of failed payment attempts

* **payment\_​authorization\_​rate**

  **PERCENT**

  The share of purchase payment attempts that succeed, with retries for the same purchase counted one time.

  `Payment authorization rate = successful_payments / unique_payment_attempts`

* **payment\_​authorization\_​rate\_​raw**

  **PERCENT**

  The share of all payment attempts that succeed, including retried payments.

  `Payment authorization rate (raw) = successful_payments / total_payment_attempts`

* **successful\_​payments**

  **INTEGER**

  Number of successful payments

* **total\_​payment\_​attempts**

  **INTEGER**

  Total number of payment attempts, with retried payments counted as separate attempts

* **unique\_​payment\_​attempts**

  **INTEGER**

  The number of purchase payment attempts, with retries for the same purchase counted once. Use [`unique_payment_attempts`](#paymentattemptsmetric-propertydetail-uniquepaymentattempts) to track payment attempt volume without retry activity inflating the result.

### INTEGER

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

```ts
```

### PERCENT

A percentage value represented as a decimal, where 0.25 represents 25%.

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

* **day**

  **DAY\_TIMESTAMP**

  The day a payment was first attempted.

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

  **DAY\_OF\_WEEK**

  The day of the week the first payment attempt happened, with values Monday through Sunday.

* **hour**

  **HOUR\_TIMESTAMP**

  The hour a payment was first attempted.

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

  **HOUR\_OF\_DAY**

  The hour of day the first payment attempt happened, with values 0 through 23.

* **is\_​in\_​person\_​payment**

  **BOOLEAN**

  Label indicating whether the payment was made in person

* **minute**

  **MINUTE\_TIMESTAMP**

  The minute a payment was first attempted.

* **month**

  **MONTH\_TIMESTAMP**

  The month a payment was first attempted.

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

  **MONTH\_OF\_YEAR**

  The month of the year the first payment attempt happened, with values 1 through 12.

* **order\_​id**

  **IDENTITY**

  The unique Shopify identifier for the order tied to the payment attempt. Use [`order_id`](#paymentattemptsdimension-propertydetail-orderid) to filter to a specific order, or use it with [`order_name`](#paymentattemptsdimension-propertydetail-ordername) to show a customer-facing label.

* **payment\_​attempt\_​amount**

  **MONEY**

  The amount the customer tries to pay, in your store's currency.

* **payment\_​attempt\_​amount\_​customer\_​currency**

  **MONEY**

  The amount the customer tried to pay, in the customer’s currency. Use [`payment_attempt_amount_customer_currency`](#paymentattemptsdimension-propertydetail-paymentattemptamountcustomercurrency) with [`payment_attempt_currency`](#paymentattemptsdimension-propertydetail-paymentattemptcurrency) to review attempted amounts as the customer saw them.

* **payment\_​attempt\_​currency**

  **STRING**

  Values are currency codes such as USD, CAD, EUR, and GBP.

* **payment\_​attempt\_​group**

  **STRING**

  Shopify identifier for the payment attempt group

* **payment\_​card\_​bin**

  **STRING**

  Bank Identification Number (BIN) of the payment card

* **payment\_​card\_​bin\_​country**

  **STRING**

  The country tied to the card's Bank Identification Number, or BIN.

* **payment\_​card\_​brand**

  **STRING**

  Values are card brand names such as Visa, Mastercard, American Express, and Discover.

* **payment\_​card\_​wallet**

  **STRING**

  The digital wallet used for the payment, when a wallet was used. Values are wallet names such as Apple Pay, Google Pay, and Shop Pay.

* **payment\_​first\_​attempted\_​at**

  **SECOND\_TIMESTAMP**

  The exact time the first payment attempt happened, reported in your store's time zone.

* **payment\_​last\_​attempted\_​at**

  **SECOND\_TIMESTAMP**

  Timestamp of the last payment attempt

* **payment\_​method**

  **STRING**

  Values are payment method names such as Card, PayPal, Gift Card, and Klarna.

* **payment\_​source**

  **STRING**

  Source of funds used for the payment

* **quarter**

  **QUARTER\_TIMESTAMP**

  The quarter a payment was first attempted.

* **second**

  **SECOND\_TIMESTAMP**

  The second a payment was first attempted.

* **shop\_​id**

  **IDENTITY**

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

* **week**

  **WEEK\_TIMESTAMP**

  The week a payment was first attempted.

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

  **WEEK\_OF\_YEAR**

  The week of the year the first payment attempt happened, with values 1 through 53.

* **year**

  **YEAR\_TIMESTAMP**

  The year a payment was first attempted.

* **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`](#paymentattemptsdimension-propertydetail-ordersaleschannelid) with [`order_sales_channel`](#paymentattemptsdimension-propertydetail-ordersaleschannel) to show readable channel labels.

* **shop\_​name**

  **STRING**

  Name of your store

* **is\_​shop\_​referral\_​order**

  **BOOLEAN**

  Whether the order was referred from the Shop app or shop.app, with values `true` and `false`.

* **order\_​landing\_​page\_​path**

  **STRING**

  Path of the first page of the user session that resulted in the order

* **order\_​landing\_​page\_​url**

  **STRING**

  First page of the user session that resulted in the order

* **order\_​marketing\_​event\_​id**

  **IDENTITY**

  Shopify identifier for the marketing event associated with the order

* **order\_​referrer\_​domain**

  **STRING**

  Domain of the site that led to the order

* **order\_​referrer\_​name**

  **STRING**

  The readable name of the site that led to the order.

* **order\_​referrer\_​path**

  **STRING**

  Path of the site that led to the order

* **order\_​referrer\_​site**

  **STRING**

  Site that led to the order

* **order\_​referrer\_​source**

  **STRING**

  The referrer type that led to the order, such as organic or email.

* **order\_​referrer\_​url**

  **STRING**

  External page that referred a customer and led to the order

* **order\_​utm\_​campaign**

  **STRING**

  UTM name of the campaign associated with the order

* **order\_​utm\_​content**

  **STRING**

  The UTM content value associated with the order, often used to distinguish ads, links, or content variations.

* **order\_​utm\_​medium**

  **STRING**

  The UTM medium associated with the order, such as email, social, or paid search.

* **order\_​utm\_​source**

  **STRING**

  The UTM source associated with the order, such as Google, Facebook, or a newsletter.

* **order\_​utm\_​term**

  **STRING**

  The UTM term associated with the order, often used for paid search keywords or other tracked terms.

* **number\_​of\_​products\_​bought\_​together**

  **INTEGER**

  Total unique products in the same order

* **number\_​of\_​variants\_​bought\_​together**

  **INTEGER**

  The number of unique product variants in the same order, with each SKU counted a single time.

* **products\_​bought\_​together**

  **ARRAY\<STRING>**

  The product names that appear in the same order.

* **products\_​bought\_​together\_​ids**

  **ARRAY\<INTEGER>**

  The Shopify product identifiers for products in the same order.

* **variants\_​bought\_​together**

  **ARRAY\<STRING>**

  The product variant labels that appear in the same order, such as size, color, or style combinations.

* **company\_​id**

  **IDENTITY**

  The unique Shopify identifier for the company. Use [`company_id`](#paymentattemptsdimension-propertydetail-companyid) with [`company_name`](#paymentattemptsdimension-propertydetail-companyname) to show readable company labels.

* **company\_​name**

  **STRING**

  Name of the company that placed the order

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

  **IDENTITY**

  The unique Shopify identifier for the company location. Use [`company_location_id`](#paymentattemptsdimension-propertydetail-companylocationid) with [`company_location_name`](#paymentattemptsdimension-propertydetail-companylocationname) to show readable company location labels.

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

  **STRING**

  The company location or branch that placed the order

* **referring\_​channel**

  **STRING**

  Marketing channel that referred the customer to place the order

* **referring\_​medium**

  **STRING**

  The marketing medium that referred the customer to place the order, such as email, social, or search.

* **referring\_​platform**

  **STRING**

  The marketing platform that referred the customer to place the order, such as Google, Facebook, or Instagram.

* **traffic\_​type**

  **STRING**

  The type of traffic that led to the order, such as organic, paid, or direct.

* **order\_​marketing\_​event\_​target**

  **STRING**

  The platform or channel where the marketing activity was deployed, such as Email, Facebook, Google, or Instagram.

* **order\_​marketing\_​event\_​type**

  **STRING**

  The type of marketing activity that led to the order, such as Ad, Affiliate, Newsletter, or Retargeting. PLA means Product Listing Ads, and SEO means Search Engine Optimization.

* **market**

  **STRING**

  Market you've defined in Shopify, like a geographical market or customer group

* **markets**

  **ARRAY\<STRING>**

  Markets or customer segments associated with the order

* **order\_​cancellation\_​reason**

  **STRING**

  The reason specified for the order cancellation, such as Customer, Other, Fraud, or Inventory.

* **order\_​risk\_​level**

  **STRING**

  The fraud risk level Shopify assigned to the order, with values Low, Medium, High, None, and Pending.

* **order\_​is\_​shopify\_​protect\_​covered**

  **BOOLEAN**

  Whether the order has met Shopify Protect fulfillment requirements, including proper shipping and tracking, with values `true` and `false`.

* **order\_​is\_​shopify\_​protect\_​eligible**

  **BOOLEAN**

  Whether the order qualifies for Shopify Protect, with values `true` and `false`.

* **order\_​is\_​shopify\_​protect\_​protected**

  **BOOLEAN**

  Whether the order has full Shopify Protect coverage against fraud, with values `true` and `false`.

* **order\_​tag**

  **STRING**

  Tag associated with the order

* **order\_​tags**

  **ARRAY\<STRING>**

  Set of tags associated with the order

* **agentic\_​referring\_​channel**

  **STRING**

  The AI agent or assistant that referred the session to your online store, with values ChatGPT, Google AI Mode and Gemini, Microsoft Copilot, and Shop.

* **channel\_​handle**

  **STRING**

  Name of the marketing channel or platform that drove the marketing engagement

* **marketing\_​activity\_​id**

  **IDENTITY**

  The unique Shopify identifier for the marketing activity. Use [`marketing_activity_id`](#paymentattemptsdimension-propertydetail-marketingactivityid) with [`marketing_activity_title`](#paymentattemptsdimension-propertydetail-marketingactivitytitle) to show readable activity labels.

* **marketing\_​activity\_​status**

  **STRING**

  Current status of the marketing activity (such as Active or Paused)

* **marketing\_​activity\_​title**

  **STRING**

  Name of the marketing activity

* **marketing\_​activity\_​url\_​parameter\_​key**

  **STRING**

  URL parameter key for the marketing activity

* **marketing\_​activity\_​url\_​parameter\_​value**

  **STRING**

  URL parameter value for the marketing activity

* **marketing\_​automation\_​id**

  **IDENTITY**

  Unique ID that Shopify uses to identify the marketing automation

* **marketing\_​delivery\_​channel**

  **STRING**

  Channel through which the marketing activity is delivered

* **marketing\_​event\_​id**

  **IDENTITY**

  Unique identifier for the associated marketing event

* **marketing\_​platform**

  **STRING**

  The marketing platform that created the marketing activity, shown as a platform name.

* **page\_​host**

  **STRING**

  The host name of the session landing page.

* **page\_​path**

  **STRING**

  The path of the session landing page.

* **page\_​url**

  **STRING**

  The URL of the first page viewed in the session.

* **referrer\_​url**

  **STRING**

  External page that led to an online store session

* **utm\_​campaign**

  **STRING**

  UTM name of the campaign associated with the session

* **utm\_​content**

  **STRING**

  The UTM content value associated with the session, often used to distinguish ads, links, or content variations.

* **utm\_​medium**

  **STRING**

  The UTM medium associated with the session, such as email, social, or paid search.

* **utm\_​source**

  **STRING**

  The UTM source associated with the session, such as Google, Facebook, or a newsletter.

* **utm\_​term**

  **STRING**

  The UTM term associated with the session, often used for paid search keywords or other tracked terms.

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

### BOOLEAN

A true or false value representing binary states.

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

### IDENTITY

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

```ts
```

### MONEY

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

```ts
```

### STRING

A sequence of characters representing text data.

```ts
```

### SECOND\_TIMESTAMP

A timestamp truncated to second precision.

```ts
```

### QUARTER\_TIMESTAMP

A date value representing the start of a fiscal quarter.

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

### ARRAY

A list of values. The element type appears inside angle brackets, such as ARRAY\<STRING>.

```ts
```

***

## Related schemas

* [`payments`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/payments): Successful transaction data downstream of these attempts.
* [`chargebacks`](https://shopify.dev/docs/api/shopifyql/latest/schemas/finance_and_payments/chargebacks): Disputed transactions that started as successful attempts.

***
