Crypto Payments Shopify Integration
Shopify allows custom payment methods via two mechanisms: Shopify Payments (only for certified providers) and Offsite Payment Gateways — redirect to external payment page. For crypto payments the second path is available, or ready-made apps from Shopify App Store.
Path 1: Ready-Made App (2–4 hours)
If requirements are standard — faster to use existing solutions:
- Coinbase Commerce — official app, support for ETH, BTC, USDC, DOGE, LTC, BCH. Free, 1% fee. Well-documented integration.
- NOWPayments — 300+ coins, auto-conversion to stablecoins, own Shopify plugin.
- BitPay — enterprise-oriented, B2B scenarios, USDC settlement.
Install via Shopify App Store, add as alternative payment method in shop settings. No code.
Path 2: Custom Offsite Gateway
When you need full control over the process — build your own gateway via Shopify's Payment App API.
Payment App Registration: create Shopify Partner App with type payment_app, specify redirect URL and callback URL:
// After redirect from Shopify checkout this will receive data
// POST /shopify/payment-initiate
{
"id": "gid://shopify/PaymentSession/...",
"payment": {
"amount": "99.99",
"currency": "USD",
"proposed_at": "2024-01-15T10:30:00Z"
},
"merchant_id": "...",
"cancel_url": "https://...",
"redirect_url": "https://..."
}
Payment flow:
Shopify Checkout → Our Payment App → Crypto Selection Page
→ Deposit Address Generation → Waiting for On-Chain
→ Confirmation → Resolve/Reject Session via Shopify API
Resolve payment session after on-chain confirmation:
const RESOLVE_MUTATION = `
mutation paymentSessionResolve($id: ID!) {
paymentSessionResolve(id: $id) {
paymentSession {
id
state { ... on PaymentSessionStateResolved { code } }
}
userErrors { field message }
}
}
`;
async function resolvePaymentSession(sessionId: string, shopDomain: string) {
const response = await fetch(
`https://${shopDomain}/payments_apps/api/2024-01/graphql.json`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Shopify-Access-Token": process.env.SHOPIFY_ACCESS_TOKEN!,
},
body: JSON.stringify({
query: RESOLVE_MUTATION,
variables: { id: sessionId },
}),
}
);
return response.json();
}
On cancel or timeout — call paymentSessionReject.
Custom Checkout Page
Shopify requires that payment app returns user to redirect_url after successful payment. Our page:
- Shows QR code with deposit address and amount in crypto
- Polling or WebSocket for real-time status
- Countdown timer (standard — 15–30 minutes)
- After confirmation — resolve session + redirect
Crypto amount: calculate from current rate with 1–2% buffer for slippage and short conversion time. Fix rate for session TTL.
Testing
Shopify provides sandbox for payment apps. Test payments without real transactions — via special test sessions in Partner Dashboard.
For real on-chain tests: Sepolia (ETH testnet) with test tokens, BSC testnet (chainId 97) with testnet BNB.
Time Estimates
Connecting ready Coinbase Commerce or NOWPayments: 4–8 hours (account registration + installation + test). Custom Payment App with own UI and confirmation logic: 2–3 days development plus time for review in Shopify App Store (if publication needed).







