Skip to main content

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.

  1. Log into your Shopify admin panel
  2. Navigate to Settings > Apps and sales channels > Develop apps
  3. Click Allow custom app development if prompted
  4. Click Create an app
  5. Name it: Lightning Enable (or any name you prefer)
  6. Click Configure Admin API scopes and enable:
ScopePurpose
write_ordersCreate orders after Lightning payment
read_productsVerify product availability at claim time
read_inventoryCheck stock levels
  1. Click Save then Install app
  2. Copy the Admin API access token (starts with shpat_)
Save Your Token

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.

  1. Go to Products in Shopify admin
  2. 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:

  1. Visit lightningenable.com and sign up for an Agentic Commerce plan — either Individual ($99/month) or Business ($299/month)
  2. Complete the Stripe checkout
  3. Save your API key from the confirmation page — you'll need it for the next step
Already Have a Subscription?

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.

  1. Create a Strike account
  2. Generate an API key in the Strike dashboard
  3. 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.

L402 Compatibility

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

FieldRequiredDescription
slugYesURL-safe identifier for your store (lowercase, hyphens OK). Used in endpoint URLs: /api/shopify/{slug}/catalog
shopifyDomainYesYour Shopify store domain (e.g., your-store.com or your-store.myshopify.com)
adminApiAccessTokenYesShopify Admin API token from Step 1
domesticShippingUsdNoUS flat-rate shipping (default: $5.99)
internationalShippingUsdNoInternational flat-rate shipping (default: $14.99)
freeShippingEnabledNoEnable free shipping above threshold (default: false)
freeShippingThresholdUsdNoOrder subtotal for free shipping (default: $50.00)
catalogCacheTtlMinutesNoHow long to cache products (default: 15 min, range: 1-1440)
listInRegistryNoList in L402 API registry for agent discovery (default: true)
registryCategoriesNoJSON array of categories, e.g. ["commerce","food-and-beverage"]
registryDescriptionNoDescription 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:

  1. Use the pay_invoice tool to pay the invoice from the checkout response
  2. 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"
}
}'
  1. 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