Why Add Crypto to Shopify?
Crypto payments eliminate chargebacks, open your store to international customers who don't have credit cards, and typically settle faster than traditional payment processors. With USDT on BNB Smart Chain, fees are a fraction of a cent.
Approach 1: Shopify Custom App
Build a small Node.js app hosted on Railway or Heroku. When Shopify triggers the payment pending webhook, your app calls Paychainly to create a payment session and injects a redirect to a hosted payment page.
// In your custom app
app.post('/shopify/payment', async (req, res) => {
const { order_id, total_price, currency } = req.body;
const session = await paychainly.createSession({
userId: order_id,
amount: parseFloat(total_price),
});
res.redirect(session.paymentUrl);
});Approach 2: Script Injection via Theme
For simpler stores, add a "Pay with USDT" button to the cart page. On click, call your Paychainly API and redirect to the payment page. Use Shopify's theme.liquid to inject the script.
Handling Order Completion
Your webhook endpoint listens for deposit_detected from Paychainly. On receipt, call the Shopify Admin API to mark the order as paid:
await shopify.order.update(orderId, {
financial_status: 'paid',
tags: 'crypto-payment,usdt',
});Key Considerations
- Shopify's 20-minute session timeout aligns well with Paychainly's 20-minute deposit window
- Store the Paychainly session ID in Shopify order notes for reconciliation
- Handle the case where a customer pays after the session expires — email them with a new link