Setup steps

  1. In Shopify admin, open Settings → Apps and sales channels → Develop apps and create a custom app.
  2. Give it the read_orders and read_customers Admin API scopes, install it, and copy the access token.
  3. In ProductLense, open Settings → Billing connections → Shopify and paste the shop domain, token and client secret.
  4. In the custom app, add a webhook endpoint with the URL ProductLense shows after you save the connection (pattern https://api.productlense.app/api/webhooks/{provider}/{connection_id}).
  5. ProductLense backfills 12 months of paid orders.

Credentials and permissions

Credentials ProductLense asks for
FieldSecretWhere to find it
Shop domainNoYour myshopify.com domain, for example acme.myshopify.com.
Admin API access tokenYes, encrypted at restThe shpat_... token from a custom app with read_orders and read_customers scopes.
Webhook signing secretYes, encrypted at restThe custom app’s client secret, used to sign webhooks.

Webhook

URL pattern, shown with your connection id after you save:

text
https://api.productlense.app/api/webhooks/shopify/{connection_id}

Events: orders/paid, orders/updated, refunds/create, customers/create, customers/update

Verification: X-Shopify-Hmac-Sha256 header: base64 HMAC of the body, plus a shop domain check.

What ProductLense reads

Customers
Customers with email.
Subscriptions
None: Shopify orders are one-off purchases.
Payments
Paid orders.
Refunds
Order refunds.
Fees
Not in the orders API (fees live in the Payouts API), so recorded as 0.

What ProductLense never touches

  • Never creates, changes, refunds or cancels anything: read-only API calls and incoming webhooks only.
  • Never moves money, issues payouts, or reads bank account details.
  • Never sees full card numbers; providers do not expose them.
  • Never sends your customer data to the AI model: Ask and the daily insight see aggregates only.

Match payments to your users

Add the ProductLense script to theme.liquid and set a pl_user_id cart attribute for logged-in customers to match by id; otherwise ProductLense matches by customer email. See the Shopify install guide.

theme: set a cart attribute for logged-in customers
fetch('/cart/update.js', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ attributes: { pl_user_id: String(customerId) } }),
});

Shopify and ProductLense: questions

Does ProductLense work with Shopify?
Yes. ProductLense connects to Shopify with shop domain, admin API access token, webhook signing secret, backfills 12 months of history, and stays current through signed webhooks plus a nightly reconcile. One connection is included on Starter; Growth and Scale allow every provider at once on the same site.
What data does ProductLense read from Shopify?
Customers, subscriptions, payments, refunds and fees, read-only. Payments: paid orders. Refunds: order refunds. Fees: not in the orders API (fees live in the Payouts API), so recorded as 0.
Can ProductLense change anything in my Shopify account?
No. ProductLense only makes read calls and receives webhooks. It never creates, changes, refunds or cancels anything, never moves money, and never sees card numbers. Credentials are encrypted at rest, and the AI features only ever see aggregated numbers, never your customers’ data.
How does ProductLense match Shopify payments to visitors?
Add the ProductLense script to theme.liquid and set a pl_user_id cart attribute for logged-in customers to match by id; otherwise ProductLense matches by customer email. See the Shopify install guide. Your site calls identify with the same user id after signup, and ProductLense follows the payment to that visitor’s first touch: source, medium, campaign and landing page.
Are Shopify fees subtracted from revenue?
Not in the orders API (fees live in the Payouts API), so recorded as 0. Net revenue is the charge minus the fee; refunds subtract the refunded amount and its fee. Profit per channel then subtracts ad spend.

Connect Shopify and see revenue by channel today.

Add the script, connect Stripe or any of 14 other billing providers, and see revenue by channel the same day.