Shopify Setup Guide
This guide walks you through connecting your Shopify store to Lightning Enable for L402 agentic commerce. Setup takes about 10 minutes.
Step 1: Create a Shopify Custom App
Lightning Enable needs a Shopify Admin API token to create orders on your behalf after Lightning payment is confirmed.
- Log into your Shopify admin panel
- Navigate to Settings > Apps and sales channels > Develop apps
- Click Allow custom app development if prompted
- Click Create an app
- Name it:
Lightning Enable(or any name you prefer) - Click Configure Admin API scopes and enable:
| Scope | Purpose |
|---|---|
write_orders | Create orders after Lightning payment |
read_products | Verify product availability at claim time |
read_inventory | Check stock levels |
- Click Save then Install app
- Copy the Admin API access token (starts with
shpat_)
The Admin API access token is only shown once. Copy it immediately and store it securely. If lost, you'll need to uninstall and recreate the app.
Step 2: Verify Products Are Publicly Accessible
The catalog endpoint uses Shopify's public product API. Your products must be published to the Online Store sales channel.
- Go to Products in Shopify admin
- For each product you want available via L402:
- Status should be Active
- Under Publishing, ensure Online Store is checked
Quick test — open this URL in your browser (replace with your domain):
https://your-store.com/products.json
You should see a JSON response with your products and variants.
Step 3: Sign Up for Lightning Enable
If you don't already have a Lightning Enable account:
- Visit lightningenable.com and sign up for an Agentic Commerce plan — either Individual ($99/month) or Business ($299/month)
- Complete the Stripe checkout
- Save your API key from the confirmation page — you'll need it for the next step
If you're on a plan that doesn't include L402/Agentic Commerce, upgrade through the merchant dashboard or contact support.
Step 4: Configure Your Payment Provider
You need a payment provider to handle Lightning invoice creation and settlement.
Option A: Strike (Recommended)
- Create a Strike account
- Generate an API key in the Strike dashboard
- Configure it in Lightning Enable:
curl -X PUT https://api.lightningenable.com/api/merchant/settings \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"paymentProvider": 0,
"strikeApiKey": "YOUR_STRIKE_API_KEY"
}'
Strike supports preimage extraction, which is required for L402 payment verification.
Option B: OpenNode
See the OpenNode Setup Guide for configuration details.
OpenNode does not return preimages for incoming payments. For Shopify L402 integration, Strike is strongly recommended as it provides the preimage needed for cryptographic payment verification.
Step 5: Create the Shopify Integration
With your Lightning Enable API key, create the integration:
curl -X POST https://api.lightningenable.com/api/merchant/shopify \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"slug": "your-store-name",
"shopifyDomain": "your-store.com",
"adminApiAccessToken": "shpat_YOUR_TOKEN_HERE",
"domesticShippingUsd": 5.99,
"internationalShippingUsd": 14.99,
"freeShippingEnabled": false,
"freeShippingThresholdUsd": 50.00,
"catalogCacheTtlMinutes": 15,
"registryCategories": "[\"commerce\",\"food-and-beverage\",\"coffee\"]",
"registryDescription": "Premium coffee beans available for AI agent purchases via Lightning L402 payments."
}'
Configuration Options
| Field | Required | Description |
|---|---|---|
slug | Yes | URL-safe identifier for your store (lowercase, hyphens OK). Used in endpoint URLs: /api/shopify/{slug}/catalog |
shopifyDomain | Yes | Your Shopify store domain (e.g., your-store.com or your-store.myshopify.com) |
adminApiAccessToken | Yes | Shopify Admin API token from Step 1 |
domesticShippingUsd | No | US flat-rate shipping (default: $5.99) |
internationalShippingUsd | No | International flat-rate shipping (default: $14.99) |
freeShippingEnabled | No | Enable free shipping above threshold (default: false) |
freeShippingThresholdUsd | No | Order subtotal for free shipping (default: $50.00) |
catalogCacheTtlMinutes | No | How long to cache products (default: 15 min, range: 1-1440) |
listInRegistry | No | List in L402 API registry for agent discovery (default: true) |
registryCategories | No | JSON array of categories, e.g. ["commerce","food-and-beverage"] |
registryDescription | No | Description for registry keyword search |
Choosing a Slug
Your slug determines the public URL for your store's endpoints:
https://api.lightningenable.com/api/shopify/{slug}/catalog
https://api.lightningenable.com/api/shopify/{slug}/checkout
https://api.lightningenable.com/api/shopify/{slug}/claim
Choose something short and memorable. It must be:
- Lowercase letters, numbers, and hyphens only
- Unique across all Lightning Enable merchants
- Examples:
my-store,acme-goods,coffee-co
Step 6: Verify Your Setup
Test the Catalog
curl https://api.lightningenable.com/api/shopify/your-store-name/catalog
You should see your products with variants, prices, and shipping rules. No authentication is required for this endpoint.
Test a Checkout
# Use a real variant ID from the catalog response
curl -X POST https://api.lightningenable.com/api/shopify/your-store-name/checkout \
-H "Content-Type: application/json" \
-d '{
"items": [
{"variantId": 12345678901234, "quantity": 1}
]
}'
You should receive an HTTP 402 response with:
- A Lightning invoice (BOLT11 string)
- A macaroon (base64)
- A payment hash
- A claim token
- Order details with amounts in both USD and sats
Test a Full Purchase
To test the complete flow, use the Lightning Enable MCP server:
- Use the
pay_invoicetool to pay the invoice from the checkout response - Claim the order with the preimage:
curl -X POST https://api.lightningenable.com/api/shopify/your-store-name/claim \
-H "Content-Type: application/json" \
-H "Authorization: L402 MACAROON_BASE64:PREIMAGE_HEX" \
-d '{
"claimToken": "SC-xxxxxxxx",
"email": "customer@example.com",
"shippingAddress": {
"firstName": "Jane",
"lastName": "Doe",
"address1": "123 Main St",
"city": "Austin",
"province": "TX",
"zip": "78701",
"country": "US"
}
}'
- Check your Shopify admin — a new order should appear, marked as paid
Step 7: Go Live
Once testing is complete, your L402 store endpoints are live and ready for AI agents. Your store is automatically listed in the L402 API registry, which means AI agents can find it using the discover_api MCP tool:
Agent: discover_api(query="coffee")
→ Your store appears in results with description, categories, and manifest URL
You can also share your catalog URL directly:
https://api.lightningenable.com/api/shopify/your-store-name/catalog
To manage your registry listing (categories, description, or opt out), see the Agent Discovery & Registry guide.
Managing Your Integration
Update Settings
curl -X PUT https://api.lightningenable.com/api/merchant/shopify \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domesticShippingUsd": 6.99,
"freeShippingEnabled": true,
"freeShippingThresholdUsd": 75.00
}'
Only include fields you want to change — all others remain unchanged.
Refresh the Catalog Cache
After updating products or prices in Shopify, force a cache refresh:
curl -X POST https://api.lightningenable.com/api/merchant/shopify/invalidate-cache \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY"
Or wait for the cache TTL to expire naturally (default: 15 minutes).
View Orders
# All orders
curl "https://api.lightningenable.com/api/merchant/shopify/orders" \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY"
# Filter by status
curl "https://api.lightningenable.com/api/merchant/shopify/orders?status=PaidWithDetails" \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY"
# Paginate
curl "https://api.lightningenable.com/api/merchant/shopify/orders?page=2&pageSize=10" \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY"
Pause the Integration
To temporarily disable L402 purchases without losing your configuration:
curl -X PUT https://api.lightningenable.com/api/merchant/shopify \
-H "X-API-Key: YOUR_LIGHTNING_ENABLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"isActive": false}'
Set isActive back to true to re-enable.
Next Steps
- API Reference — Full endpoint documentation with request/response schemas
- MCP Server Guide — Help AI agents connect to your store
- Strike Setup — Configure Strike as your payment provider