Shopify integration
Connect Shopify to WooshPayment via OAuth Public App. ScriptTag auto-installed, orders synced, minimal scopes.
The Shopify integration uses an OAuth Public App to read the catalog, create orders, and install a ScriptTag that intercepts the "Checkout" button and redirects it to your WooshPayment checkout.
Requirements
- Active Shopify store (any plan)
- Admin permissions on the store
- WooshPayment account (see Quickstart)
1. Start the integration
There are two entry points:
A) From onboarding โ at first login, "Platform" step โ choose Shopify โ domain form โ "Connect".
B) From Settings โ Dashboard โ Settings โ Shopify connection โ enter your your-store.myshopify.com โ "Start OAuth".
Backend internals (for those who want to understand):
- The form does
POST /api/auth/shopify/installwithshopDomain+ a JWT handoff token (your current session) - We receive the Shopify OAuth URL and redirect you there
- You authorize on your store admin
- Shopify sends us back to the callback, we exchange the code for
accessToken - We encrypt the accessToken (AES-256-GCM) and save it associated with your merchant
- We install the ScriptTag automatically
- We send you back to the dashboard with
shopifyConnected: true
2. Required OAuth scopes
| Scope | What it's for |
|---|---|
read_products | Read titles, prices, variants, images for the checkout |
read_orders / write_orders | Create the order on your Shopify after confirmed payment |
read_checkouts / write_checkouts | Manage the checkout session |
read_customers | Auto-fill address for already-registered customers |
read_script_tags / write_script_tags | Install/update the redirect ScriptTag |
No write_products or write_customers permission. WooshPayment reads your catalog and your customers but never modifies them.
3. The ScriptTag
Installed automatically at the OAuth callback. When a customer clicks "Checkout" from the Shopify cart:
- The script intercepts the click before the native redirect
- It captures the cart (line items + total + currency)
- It calls
POST /api/checkout/create(WooshPayment) - It redirects to
https://{your-slug}.wooshpayment.com/checkout/{token}(orcheckout.yourdomain.comif you've mapped a custom domain)
No copy/paste into the theme, no changes to theme.liquid. When you uninstall the app from Shopify, the ScriptTag is removed automatically.
4. Verify it works
- Open your store in an incognito window (to bypass cache + cookies)
- Add a product to the cart
- Click "Check out"
- You must land on
{your-slug}.wooshpayment.com/checkout/... - Complete a pilot order with the Whop test card
4242 4242 4242 4242 - Verify that the order also appears in Shopify Admin โ Orders with the
WooshPaymenttag and payment_statuspaid
5. What happens after payment
- Whop sends an
invoice_paidormembership_activatedwebhook tohttps://api.wooshpayment.com/webhooks/whop/payment-update(HMAC-SHA256 signed) - WooshPayment marks the session
COMPLETED - We call Shopify's Orders API to create the real order with
payment_status: paid - Shopify decrements inventory and the standard fulfillment flow starts
- The "order confirmed" email to the customer is sent by Shopify, not us
- WooshPayment sends the merchant a notification via Resend (
noreply@wooshpayment.com)
Common errors
Right after OAuth the dashboard says "Not connected"
Known stale localStorage bug. Solution: refresh the page with Cmd+Shift+R. The store does refreshMerchant() on mount and recovers the correct state.
ScriptTag doesn't appear installed
Go to Shopify Admin โ Apps โ WooshPayment. If the app is there but the Checkout button doesn't redirect:
- Hard refresh the store (Cmd+Shift+R) to clear the JS cache
- If it persists: uninstall the app from Shopify, return to WooshPayment and restart OAuth from Settings
- If still nothing: Script tag debug
Orders not created in Shopify
The order appears in WooshPayment but not in Shopify:
- Check in Dashboard โ Orders the status of the session. If it is
COMPLETEDbutshopifyOrderIdis empty, the issue is the Orders API call - Check that the
write_ordersscope is still active: sometimes a partial uninstall/reinstall leaves old scopes - Quick fix: disconnect and re-authorize from Settings
"Invalid cart" on the customer side
Most likely the product prices changed between add-to-cart and checkout. The customer should refresh the cart.
Uninstalling
- Shopify Admin โ Apps โ WooshPayment โ Uninstall โ revokes permissions, ScriptTag removed
- In WooshPayment the Shopify status becomes "Not connected"; the merchant remains but can no longer create orders on your store
Next steps
- Whop setup to accept cards
- Apple Pay
- Checkout branding
- Marketing pixels
- Custom domain