Shopify Integration Guide

Add crypto payments to your Shopify store in under 5 minutes.

Quick Start

1

Create a GroundedPay account at /signup.html and note your Merchant ID.

2

Add the embed script to your Shopify theme. Go to your Shopify admin → Online Store → Themes → Edit Code → theme.liquid. Paste this snippet just before the closing </body> tag:

<script src="https://groundedpay.com/embed.js"
        data-merchant-id="YOUR_MERCHANT_ID"></script>
3

That's it! A "Pay with Crypto" button will appear on your cart and checkout pages. When customers click it, a modal opens with the GroundedPay checkout for USDC, USDT, ETH, or BTC.

Configuration Options

Customize the button by adding data attributes to the script tag:

Attribute Default Description
data-merchant-id Required Your GroundedPay merchant ID
data-gateway-url https://groundedpay.com Gateway URL (only change for self-hosted)
data-button-text Pay with Crypto Button label text
data-button-color #6366f1 Button background color
data-button-text-color #ffffff Button text color
data-button-position after-checkout after-checkout, before-checkout, or custom:#selector

Full Example with All Options

<script src="https://groundedpay.com/embed.js"
        data-merchant-id="YOUR_MERCHANT_ID"
        data-button-text="Checkout with Crypto"
        data-button-color="#22c55e"
        data-button-text-color="#ffffff"
        data-button-position="after-checkout"></script>

How It Works

Non-custodial. Crypto payments go directly to the wallet address you configure in your GroundedPay dashboard. We never hold your funds.

1. The embed script adds a "Pay with Crypto" button to your Shopify cart/checkout page.

2. When a customer clicks the button, the script reads the cart total and creates a payment via the GroundedPay API.

3. A modal overlay opens showing the GroundedPay checkout with a QR code and payment address.

4. Once the blockchain confirms payment, the modal closes and the customer sees a success message.

API Integration

For custom integrations beyond Shopify, use the API directly:

Create a Payment

POST /api/checkout/create
Content-Type: application/json

{
  "amount_usd": 49.99,
  "coin": "usdc",
  "merchant_id": "YOUR_MERCHANT_ID",
  "shopify_order_id": "optional-order-id",
  "shopify_order_number": "#1001"
}

Check Payment Status

GET /api/checkout/:paymentId

PostMessage Events (for iframe embeds)

The checkout iframe sends postMessage events to the parent window:

Event TypeData
groundedpay:payment_confirmed { payment_id, redirect_url }
groundedpay:close {} — user closed the modal

Testing

Use your dashboard at /dashboard.html to monitor incoming payments in real time. Payments auto-refresh every 30 seconds.

Need help? Contact us at support@groundedpay.com