# Lightning Enable Store — Full API Reference > Part of [Lightning Enable](https://lightningenable.com) — infrastructure for agent commerce over Lightning. > Complete API documentation for AI agents purchasing from the Lightning Enable Store. > Base URL: https://store.lightningenable.com > Document version: 2026-10-15. MCP tool names verified against the released Lightning Enable MCP server v2.1.0. Claim contract: `Authorization: L402 :` header. ## Table of Contents - Catalog Endpoints (3) - Cart Endpoints (6) - Checkout and Fulfillment Endpoints (5) - Complete Purchase Flow Example - MCP Server Setup - Community Collection (designs by community members; same purchase flow) - Custom Products (beta): upload your artwork, two L402 payments, human approval - Designed by our customers (beta): published design listings, the listing checkout and publishing --- ## Product ID Conventions - **Ids 1–4** — Official Lightning Enable merchandise (t-shirts, snapback, dad hat). Always present. - **Ids ≥ 1000** — Community Collection. Designer-submitted, admin-approved designs. The list grows as designers publish. Discover them in `GET /api/store/catalog`. Both ranges purchase through the **same** `/api/store/catalog`, `/api/store/products/{id}`, `/api/store/cart`, `/api/store/checkout`, and `/api/store/claim` endpoints with identical request/response shapes. Treat them the same way; no special handling required for community ids. --- ## Catalog Endpoints ### GET /api/store/catalog List all products with real-time prices in satoshis and USD. Returns both official merchandise (ids 1–4) and any published Community Collection products (ids ≥ 1000) in a single `products` array. **Request:** ``` GET /api/store/catalog ``` **Response (200):** ```json { "products": [ { "id": 1, "name": "Lightning Enable T-Shirt", "description": "Premium cotton t-shirt with Lightning Enable logo", "priceUsd": 30.00, "priceSats": 37311, "category": "Apparel", "sizes": ["S", "M", "L", "XL", "2XL", "3XL"], "colors": ["Black"], "inStock": true, "imageUrl": "https://files.cdn.printful.com/files/.../preview.png" }, { "id": 1000, "name": "#FREESAMOURAI", "description": "Protest design supporting Samourai Wallet and developer freedom. Code is not a crime. ALL proceeds from this shirt go directly to imprisoned Samourai developers.", "priceUsd": 30.00, "priceSats": 37311, "category": "Community T-Shirt", "sizes": ["S", "M", "L", "XL", "2XL", "3XL"], "colors": ["Black"], "inStock": true, "imageUrl": "https://files.cdn.printful.com/files/.../preview.png" } ], "btcUsdRate": 80303, "currency": "sats", "storeName": "Lightning Enable Store", "storeUrl": "https://store.lightningenable.com", "paymentMethod": "Lightning Network (L402)", "shippingRegions": ["US"], "supportEmail": "support@lightningenable.com", "purchaseFlow": { "...": "step-by-step instructions; applies to all product ids" } } ``` Notes for agents: - The `description` field for community products is the designer's own text. Surface it to your user before checkout. - `category` distinguishes official products (`"Apparel"`) from community ones (`"Community T-Shirt"`, `"Community Snapback"`, `"Community Dad Hat"`). - Community products are cached server-side for 5 minutes — newly published designs may take that long to appear. ### GET /api/store/products/{id} Get a single product by ID with full details. Works for both official ids (1–4) and community ids (≥ 1000). **Request:** ``` GET /api/store/products/1000 ``` **Response (200):** ```json { "id": 1000, "name": "#FREESAMOURAI", "description": "Protest design supporting Samourai Wallet and developer freedom. Code is not a crime. ALL proceeds from this shirt go directly to imprisoned Samourai developers.", "priceUsd": 30.00, "priceSats": 37311, "category": "Community T-Shirt", "sizes": ["S", "M", "L", "XL", "2XL", "3XL"], "colors": ["Black"], "inStock": true, "imageUrl": "https://files.cdn.printful.com/files/.../preview.png" } ``` **Response (404):** ```json { "error": "Product not found", "productId": 999 } ``` ### GET /api/store/health Health check for the store API. **Request:** ``` GET /api/store/health ``` **Response (200):** ```json { "status": "healthy", "timestamp": "2026-02-08T12:00:00Z" } ``` --- ## Cart Endpoints The cart is session-based. Cart state persists via cookies or session headers. ### GET /api/store/cart Get current shopping cart contents with totals. **Request:** ``` GET /api/store/cart ``` **Response (200):** ```json { "items": [ { "productId": 1, "name": "Lightning Enable T-Shirt", "size": "L", "color": "Black", "quantity": 1, "priceUsd": 25.00, "priceSats": 25000 } ], "totalUsd": 25.00, "totalSats": 25000, "itemCount": 1, "btcUsdRate": 100000 } ``` ### POST /api/store/cart/items Add an item to the cart. **Request:** ``` POST /api/store/cart/items Content-Type: application/json { "productId": 1, "quantity": 1, "size": "L", "color": "Black" } ``` **Response (200):** ```json { "success": true, "cart": { "items": [...], "totalUsd": 25.00, "totalSats": 25000, "itemCount": 1 } } ``` **Response (400):** ```json { "error": "Invalid size. Available sizes: S, M, L, XL, 2XL" } ``` ### PUT /api/store/cart/items/{productId} Update the quantity of an item already in the cart. **Request:** ``` PUT /api/store/cart/items/1 Content-Type: application/json { "quantity": 2 } ``` **Response (200):** ```json { "success": true, "cart": { "items": [...], "totalUsd": 50.00, "totalSats": 50000, "itemCount": 2 } } ``` ### DELETE /api/store/cart/items/{productId} Remove an item from the cart. Use query parameters to target a specific size/color variant. **Request:** ``` DELETE /api/store/cart/items/1?size=L&color=Black ``` **Response (200):** ```json { "success": true, "cart": { "items": [], "totalUsd": 0, "totalSats": 0, "itemCount": 0 } } ``` ### DELETE /api/store/cart Clear all items from the cart. **Request:** ``` DELETE /api/store/cart ``` **Response (200):** ```json { "success": true, "cart": { "items": [], "totalUsd": 0, "totalSats": 0, "itemCount": 0 } } ``` ### GET /api/store/cart/count Get the current cart item count. Lightweight endpoint for UI badges. **Request:** ``` GET /api/store/cart/count ``` **Response (200):** ```json { "count": 1 } ``` --- ## Checkout and Fulfillment Endpoints ### POST /api/store/checkout Create a checkout session. Returns HTTP 402 (Payment Required) with a Lightning invoice and L402 macaroon. You can either checkout from the cart or provide items directly in the request body. **Request (direct items):** ``` POST /api/store/checkout Content-Type: application/json { "items": [ { "productId": 1, "quantity": 1, "size": "L", "color": "Black" } ] } ``` **Request (from cart — empty body or omit items):** ``` POST /api/store/checkout Content-Type: application/json {} ``` **Response (402 Payment Required):** The same challenge is also sent in the `WWW-Authenticate: L402 macaroon="...", invoice="..."` header. ```json { "error": "Payment Required", "message": "Pay the Lightning invoice to complete your purchase", "checkoutSecret": "...", "l402": { "macaroon": "MACAROON", "invoice": "lnbc250000n1pj...", "amountSats": 25000, "paymentHash": "a1b2c3d4e5f6...", "expiresAt": "2026-02-08T12:15:00Z" }, "order": { "orderId": "ord_...", "items": [ { "productId": 1, "productName": "Lightning Enable T-Shirt", "quantity": 1, "priceSats": 25000, "size": "L", "color": "Black" } ], "totalSats": 25000, "totalUsd": 25.00 }, "instructions": { "step1": "Pay the Lightning invoice above using pay_invoice or any Lightning wallet", "step2": "Copy the preimage (proof of payment) returned by your wallet", "step3": "POST https://store.lightningenable.com/api/store/claim with header 'Authorization: L402 {macaroon}:{preimage}' and no request body", "step4": "Share the returned claimUrl with the human to enter shipping details" } } ``` **Response (400):** ```json { "error": "Cart is empty" } ``` ### POST /api/store/claim Claim a paid order using your L402 credential (macaroon + preimage). Returns a claim token and URL for the human to enter shipping details. The order is identified by the macaroon; no order id is needed. **Canonical request:** the credential goes in the `Authorization` header, with no request body. ``` POST /api/store/claim Authorization: L402 {macaroon}:{preimage} ``` **Response (200):** ```json { "success": true, "claimToken": "CLAIM_TOKEN", "claimUrl": "https://store.lightningenable.com/store/claim?token=CLAIM_TOKEN", "expiresAt": "2026-03-10T12:00:00Z", "order": { "orderId": "ord_...", "items": [ ... ], "totalSats": 25000, "totalUsd": 25.00 }, "humanInstructions": "..." } ``` Claiming an order that is already paid and awaiting shipping details returns the same claim token again, so a retry is safe. **Response (400):** the credential doesn't verify. ```json { "error": "Invalid preimage", "message": "Preimage does not match payment hash" } ``` **Response (401):** no credential, or conflicting credentials (see below). ```json { "error": "Missing L402 credential", "message": "Include 'Authorization: L402 :' header" } ``` #### Deprecated: the l402Credential body field Older clients sent the credential in a JSON body field, `{"l402Credential": "{macaroon}:{preimage}"}`. That field is deprecated (since 2026-10-15) and will be removed on or after **2027-01-15**. Until then: - A request that uses only the deprecated l402Credential body field still works, but the response adds a `deprecation` object and `Deprecation`, `Sunset`, and `Link: <...>; rel="deprecation"` headers. - A request whose `Authorization` header and deprecated l402Credential body field carry **different** credentials is rejected with **HTTP 401** (`"error": "Conflicting L402 credentials"`) before any order is looked up. If both carry the same credential, the claim proceeds. Treat the macaroon, the preimage, the claim token, and the claim URL as secrets. Don't keep them in logs, HAR files, or receipts that other people can read. ### GET /api/store/payment-status/{paymentHash} Poll payment status by payment hash. Use this for frontends or agents that need to wait for payment confirmation. This endpoint does **not** return a claim token. A payment hash is public (it is inside the BOLT11 invoice), so knowing it proves nothing. Agents: after paying, call `POST /api/store/claim` with your macaroon and preimage to get the `claimToken` and `claimUrl`. **Request:** ``` GET /api/store/payment-status/a1b2c3d4e5f6... ``` **Response (200 — pending):** ```json { "paid": false, "status": "PendingPayment" } ``` **Response (200 — paid):** ```json { "paid": true, "status": "PaidAwaitingDetails" } ``` **Response (404):** ```json { "error": "Order not found", "paid": false } ``` The store's own web checkout page also sends the one-time `checkoutSecret` from its checkout response in an `X-Checkout-Secret` header. With that secret, and only then, the paid response adds `claimToken` and `claimUrl` so the browser can move the buyer to the claim page. It is meant for the browser flow, where the wallet never gives the page a preimage. Agents holding a preimage should use `POST /api/store/claim`. The 402 checkout body also contains this `checkoutSecret`, so treat that body as sensitive: don't keep it in logs, HAR files, or receipts, because anyone who holds it can get the order's claim token until the claim window closes. ### GET /api/store/order/{claimToken} Get order status by claim token. Use after claiming to check fulfillment progress. **Request:** ``` GET /api/store/order/ct_abc123def456 ``` **Response (200):** ```json { "claimToken": "ct_abc123def456", "status": "awaiting_shipping", "items": [ { "productId": 1, "name": "Lightning Enable T-Shirt", "size": "L", "color": "Black", "quantity": 1 } ], "amountSats": 25000, "paidAt": "2026-02-08T12:01:30Z", "shippingSubmitted": false } ``` ### POST /api/store/order/{claimToken}/fulfill Submit shipping details to fulfill the order. This triggers Printful to begin production and shipping. **Request:** ``` POST /api/store/order/ct_abc123def456/fulfill Content-Type: application/json { "name": "John Doe", "address1": "123 Main St", "address2": "Apt 4B", "city": "Austin", "stateCode": "TX", "zip": "78701", "countryCode": "US", "email": "john@example.com" } ``` **Response (200):** ```json { "success": true, "message": "Order submitted to Printful for fulfillment", "estimatedDelivery": "5-10 business days" } ``` **Response (400):** ```json { "error": "Shipping address is required" } ``` --- ## Complete Purchase Flow Example Here is the full end-to-end flow an AI agent follows to purchase from the store: ### Step 1: Browse the catalog ``` GET /api/store/catalog ``` Response includes all products with IDs, prices in sats, available sizes and colors. ### Step 2: Add item to cart (optional — can also checkout directly) ``` POST /api/store/cart/items Content-Type: application/json {"productId": 1, "quantity": 1, "size": "L", "color": "Black"} ``` ### Step 3: Checkout ``` POST /api/store/checkout Content-Type: application/json {"items": [{"productId": 1, "quantity": 1, "size": "L", "color": "Black"}]} ``` Response: HTTP 402 with `invoice` (BOLT11), `macaroon`, `paymentHash`, `amountSats`. ### Step 4: Pay the Lightning invoice Pay the BOLT11 invoice string from the checkout response using any Lightning wallet. You will receive a `preimage` (64-character hex string) as proof of payment. If you're using the Lightning Enable MCP server, call `pay_invoice` with the invoice. At merchandise scale the server usually asks for human confirmation first: it sends a code to the human outside the chat, and you call `pay_invoice` again with that code. See [Budget and confirmation](#budget-and-confirmation). ### Step 5: Claim the order ``` POST /api/store/claim Authorization: L402 {macaroon}:{preimage} ``` No request body is needed. Response: `claimToken` and `claimUrl`. ### Step 6: Human enters shipping Share the `claimUrl` with the human buyer. They visit the URL, enter their shipping address, and the order is sent to Printful for fulfillment. ### Step 7: Check order status (optional) ``` GET /api/store/order/{claimToken} ``` --- ## MCP Server Setup The Lightning Enable MCP server gives your agent Lightning payment and API discovery tools. Installation and wallet configuration are documented in one place, so they aren't restated here: - [agent-wallet-setup skill](https://github.com/refined-element/lightning-enable-skills/tree/main/skills/agent-wallet-setup): installs the MCP on your host, connects a wallet, sets a spend ceiling, and proves the loop with a 1-sat L402 payment. - [MCP quick start](https://docs.lightningenable.com/products/agentic-commerce/mcp-quickstart) and [MCP complete guide](https://docs.lightningenable.com/products/agentic-commerce/mcp-complete-guide). - [Wallet configuration](https://docs.lightningenable.com/products/agentic-commerce/mcp-wallet-setup): your wallet must return a preimage. OpenNode doesn't, so it can't complete a store purchase. Lightning Enable does not hold funds. Your wallet or payment provider holds your balance and settles the payment. ### MCP tools used in a store purchase | Tool | Used for | |------|----------| | `setup_wallet` | Report the configured wallet, or connect one | | `get_balance` | Check your balance before checkout | | `budget(action="status")` | Check your spending limits and this session's spend | | `pay_invoice` | Pay the checkout invoice and get the preimage | | `receipts(source="durable")` | Look up the payment afterwards (never includes the preimage) | | `verify_confirmation_code` | Verify a confirmation code (verification only; it never pays) | | `discover_api` | Search the L402 API registry or fetch a specific API's manifest | The full tool list is in the [MCP complete guide](https://docs.lightningenable.com/products/agentic-commerce/mcp-complete-guide). ### Budget and confirmation A store item is merchandise-scale: tens of thousands of sats. The authoritative reference for limits and their defaults is [AI spending security](https://docs.lightningenable.com/products/agentic-commerce/ai-spending-security#sats-native-budgets). The short version: - The operator sets limits in `~/.lightning-enable/config.json`. An agent can lower them at runtime, never raise them. - A payment this size is above the default auto-approve tiers, so `pay_invoice` asks for human confirmation. That's intended: physical goods should keep a human in the loop. - If one item doesn't fit, raise the per-payment ceiling to just above the item price rather than removing limits. For example, sats-denominated limits for one or two items: ```json { "limits": { "maxPerPaymentSats": 60000, "maxPerSessionSats": 120000 } } ``` When USD and sats limits are both set, the stricter one wins. Keep `autoApproveSats` small or unset; it decides what may be paid with no human in the loop. --- ## Error Handling All errors return JSON with an `error` field: | HTTP Status | Meaning | Action | |-------------|---------|--------| | 400 | Bad request (invalid input, missing fields, or a credential that doesn't verify) | Check request body format; verify SHA256(preimage) == paymentHash | | 401 | Missing or conflicting L402 credential | Send `Authorization: L402 {macaroon}:{preimage}`, and only there | | 402 | Payment required (this is expected!) | Pay the Lightning invoice | | 404 | Product or order not found | Check product ID or claim token exists | | 429 | Rate limited | Wait 60 seconds before retrying | | 500 | Server error | Retry after a few seconds | ### Common Error Responses ```json {"error": "Cart is empty"} {"error": "Invalid size. Available sizes: S, M, L, XL, 2XL"} {"error": "Invalid preimage", "message": "Preimage does not match payment hash"} {"error": "Conflicting L402 credentials", "message": "..."} {"error": "Product not found"} ``` ## Rate Limits | Endpoint | Limit | |----------|-------| | POST /api/store/checkout | 10 requests per minute | | Cart operations (/api/store/cart/*) | 30 requests per minute | | Catalog endpoints | 30 requests per minute per IP | | Community submission | 5 requests per minute | When rate limited, wait 60 seconds before retrying. ## Important Notes - All prices are dynamic and fetched from Printful in real-time - Prices are displayed in satoshis at checkout; USD shown for reference - Lightning invoices expire in 10 minutes — complete the flow promptly - Shipping is US only - Shipping outside the continental US? Contact us at support@lightningenable.com and we may be able to accommodate your order. - The preimage MUST match the invoice: `SHA256(preimage) == paymentHash` --- ## Community Collection Two distinct flows live under "Community Collection": 1. **Buying a community design** — Use the regular store endpoints. Community products appear in `GET /api/store/catalog` with ids ≥ 1000 and purchase identically to official merchandise via `POST /api/store/checkout`. **No special endpoints to learn.** Skip ahead to the Design Submission API below only if you're an agent that wants to submit a new design rather than buy an existing one. 2. **Submitting a new design** — L402-style flow described below: pay a 2,000 sat fee via Lightning, upload a PNG, await admin review and publication. ### Buying a community design (id ≥ 1000) ``` # 1. Discover GET /api/store/catalog # look for products where id >= 1000 # 2. Inspect (optional) GET /api/store/products/1000 # 3. Checkout — same shape as official merchandise POST /api/store/checkout Content-Type: application/json { "items": [{ "productId": 1000, "quantity": 1, "size": "M", "color": "Black" }] } # Returns HTTP 402; the l402 object holds { macaroon, invoice, amountSats, paymentHash, ... } # 4. Pay BOLT11 invoice via Lightning wallet → receive preimage # 5. Claim (credential in the header, no body) POST /api/store/claim Authorization: L402 {macaroon}:{preimage} # Returns claimUrl for human to enter shipping ``` ### Design Submission API (separate flow — only for designers submitting new work) This is an L402-style flow: pay a 2,000 sat fee via Lightning to submit your design for admin review. ### GET /api/community/submit/info Get submission requirements and current pricing. **Request:** ``` GET /api/community/submit/info ``` **Response (200):** ```json { "submissionFeeSats": 2000, "submissionFeeUsd": 3.54, "acceptedFileTypes": [".png"], "maxFileSizeMb": 50, "minDimensions": { "width": 2400, "height": 2400 }, "productTypes": [ { "type": "TShirt", "name": "T-Shirt", "price": 25.00 }, { "type": "Snapback", "name": "Snapback", "price": 28.00 }, { "type": "DadHat", "name": "Dad Hat", "price": 24.00 } ] } ``` ### POST /api/community/submit/initiate Initiate a submission and receive a Lightning invoice for the submission fee. **Request:** ``` POST /api/community/submit/initiate Content-Type: application/x-www-form-urlencoded DesignerName=John+Doe&DesignerEmail=john@example.com&DesignName=My+Bitcoin+Art&ProductType=TShirt&DesignDescription=A+cool+design ``` **Required Fields:** - `DesignerName`: Your name (displayed with the design) - `DesignerEmail`: Email for notifications - `DesignName`: Name of your design - `ProductType`: One of `TShirt`, `Snapback`, `DadHat` **Optional Fields:** - `DesignerHandle`: Social handle (e.g., your Twitter/X username) - `TwitterUrl`: Link to your Twitter/X profile - `NostrPubkey`: Your Nostr public key - `DesignDescription`: Description of the design **Response (200):** ```json { "paymentHash": "ae50f115f58ffc9286cbf6ecb4ad697c", "invoice": "lnbc50010n1p5cjyqr...", "checkoutUrl": "https://store.lightningenable.com/checkout/lightning/0f1e2d3c4b5a69788796a5b4c3d2e1f0", "amountSats": 2000, "expiresIn": 600 } ``` **Payment Options:** - **Agents:** Pay the BOLT11 `invoice` directly using the `pay_invoice` MCP tool or any Lightning wallet. No human required. - **Human-assisted:** Share the `checkoutUrl` with a human if the agent lacks a Lightning wallet — opens the hosted checkout page, which shows the invoice as a QR code and confirms when it is paid. The agent still finishes the submission with `POST /api/community/submit/complete`. The `checkoutUrl` is safe to share: it is addressed by its own id, not the `paymentHash`. Keep the `paymentHash` to yourself — it is what completes the submission. ### GET /api/community/submit/checkout/{checkoutId} Read the invoice behind a pending submission — what the hosted checkout page renders and polls. `checkoutId` is the last path segment of `checkoutUrl`. Returns payment data only. **Response (200):** ```json { "invoice": "lnbc50010n1p5cjyqr...", "amountSats": 2000, "expiresAt": "2026-10-15T18:40:00Z", "expiresInSeconds": 540, "status": "pending" } ``` `status` is `pending` or `paid`. **404** (`"error": "checkout_not_found"`): unknown id, or the submission was already completed. **410** (`"error": "invoice_expired"`): the invoice was not paid in time; start a new submission. ### GET /api/community/submit/status/{paymentHash} Check if the Lightning payment has been confirmed. **Request:** ``` GET /api/community/submit/status/ae50f115f58ffc9286cbf6ecb4ad697c ``` **Response (200 — pending):** ```json { "paid": false, "paymentHash": "ae50f115f58ffc9286cbf6ecb4ad697c" } ``` **Response (200 — paid):** ```json { "paid": true, "paymentHash": "ae50f115f58ffc9286cbf6ecb4ad697c" } ``` ### POST /api/community/submit/complete Complete the submission after payment is confirmed. Upload your design file. **Request:** ``` POST /api/community/submit/complete Content-Type: multipart/form-data PaymentHash=ae50f115f58ffc9286cbf6ecb4ad697c DesignFile=[your-design.png] ``` **Response (200):** ```json { "success": true, "submissionId": "sub_abc123", "message": "Design submitted successfully! We'll review it and get back to you." } ``` **Response (400 — payment not confirmed):** ```json { "error": "Payment not confirmed" } ``` ### GET /api/community/submissions/{submissionId} Check the review status of your submission. **Request:** ``` GET /api/community/submissions/sub_abc123 ``` **Response (200):** ```json { "submissionId": "sub_abc123", "designName": "My Bitcoin Art", "status": "Pending", "submittedAt": "2026-02-08T12:00:00Z", "reviewedAt": null, "rejectionReason": null } ``` **Status Values:** - `Pending`: Awaiting review - `Approved`: Approved, awaiting publication - `Published`: Live in the store - `Rejected`: Not accepted (see `rejectionReason`) --- ## Complete Submission Flow Example Here is the full end-to-end flow for an AI agent to submit a design: ### Step 1: Get requirements ``` GET /api/community/submit/info ``` Response shows 2,000 sats fee, accepted file types (PNG only), and product types. ### Step 2: Initiate submission ``` POST /api/community/submit/initiate Content-Type: application/x-www-form-urlencoded DesignerName=AI+Artist&DesignerEmail=ai@example.com&DesignName=Lightning+Bolt+Design&ProductType=TShirt ``` Response: `invoice` (BOLT11), `checkoutUrl` (hosted payment page), and `paymentHash`. ### Step 3: Pay the submission fee (2,000 sats) **For Agents:** Pay the BOLT11 `invoice` directly using the `pay_invoice` MCP tool. No human required. **Human-assisted:** If the agent lacks a Lightning wallet, share the `checkoutUrl` with a human to pay via the hosted checkout page. ### Step 4: Poll for payment confirmation ``` GET /api/community/submit/status/{paymentHash} ``` Repeat until `paid: true`. ### Step 5: Upload design file ``` POST /api/community/submit/complete Content-Type: multipart/form-data PaymentHash={paymentHash} DesignFile=[design.png] ``` Response: `submissionId` for tracking. ### Step 6: Check submission status ``` GET /api/community/submissions/{submissionId} ``` Monitor status: Pending → Approved → Published. --- ## Admin Endpoints (require X-Store-Admin-Key header) These endpoints are for store administrators to manage community submissions. ### GET /api/community/admin/submissions List submissions filtered by status. **Request:** ``` GET /api/community/admin/submissions?status=Pending X-Store-Admin-Key: your-admin-key ``` **Status Values:** `Pending`, `Approved`, `Published`, `Rejected` ### POST /api/community/admin/submissions/{submissionId}/approve Approve a pending submission. **Request:** ``` POST /api/community/admin/submissions/sub_abc123/approve X-Store-Admin-Key: your-admin-key ``` ### POST /api/community/admin/submissions/{submissionId}/publish Publish an approved submission to the store. Automatically creates the Printful sync product. **Request:** ``` POST /api/community/admin/submissions/sub_abc123/publish X-Store-Admin-Key: your-admin-key ``` ### POST /api/community/admin/submissions/{submissionId}/unpublish Remove a published submission from the store. Deletes the Printful sync product and moves the submission back to Approved status. **Request:** ``` POST /api/community/admin/submissions/sub_abc123/unpublish X-Store-Admin-Key: your-admin-key ``` ### POST /api/community/admin/submissions/{submissionId}/reject Reject a pending submission with a reason. **Request:** ``` POST /api/community/admin/submissions/sub_abc123/reject X-Store-Admin-Key: your-admin-key Content-Type: application/json { "reason": "Design does not meet quality standards" } ``` --- ## Custom Products (beta) Upload your own PNG and have it printed on a Classic T-Shirt (Printful catalog product 71, front print, direct-to-garment). This is agent-created and agent-paid commerce with a private, human fulfillment handoff: an agent can do the upload, the payments and the quote, and a person approves the design and enters the shipping address. **Status: beta.** Until custom products are switched on, every `/api/store/custom/*` route answers HTTP 404 with `{"error": "custom_products_disabled"}`. Responses say where previews and prices come from. A mockup with `"placeholder": false` is a Printful render of your exact artwork, color and placement; `"placeholder": true` means the store shows the prepared print file instead. A quote with `"pricingSource": "printful"` and `"pricingIsEstimate": false` was priced by Printful for that variant and destination; `"pricingIsEstimate": true` means a static cost estimate was used (Printful could not be asked, or the store uses static estimates). Either way the store checks Printful's real price before it submits the order (see "After the claim"). Lightning Enable does not hold funds. Invoices are issued through the Lightning Enable API; the payment provider facilitates custody and settlement, and Printful manufactures and ships. ### Two payments | | Payment A: design preparation | Payment B: the shirt | |---|---|---| | When | After the upload passes validation | After a person approves the design and a quote exists | | Price | Fixed, from configuration: 1,000 sats by default. Read `designPriceSats` from the custom catalog | The quote's `priceSats`: in `margin` mode Printful cost + shipping + a tax estimate + the store margin; in `fixed` mode the store's fixed price (plus shipping when it excludes it). Converted at the live BTC/USD rate and rounded up | | Covers | Upload validation, print-file preparation, the preview, private storage. Status polling is included | Product, printing, standard shipping and a tax estimate | | Bound to | Product, color, placement, the upload's SHA-256, your `Idempotency-Key` and the price | Quote id and digest, design id and approved artwork SHA-256, Printful variant, quantity, destination scope, shipping method, price, quote expiry, method, path and your `Idempotency-Key` | | Refunds | Consumed when preparation starts. A technical failure is retried free of charge, never charged twice | No automatic Lightning refunds (see the policy below) | Each payment is an L402 exchange: the unpaid request answers HTTP 402 with a BOLT11 invoice for exactly the bound sats and a macaroon; you pay, then repeat the **exact** request (same body, same `Idempotency-Key`) with `Authorization: L402 :`. The store checks the macaroon's signature, that SHA-256 of the preimage equals the payment hash, and every binding caveat; a credential minted for one request cannot redeem another. ### Lost 402s and expired invoices (unpaid retries) Both payments can be retried safely without paying twice. If you lose the 402 (a timeout, a crash, a restart on either side), repeat the **exact** unpaid request with the same `Idempotency-Key`: - **The invoice is still payable:** you get the same 402 again: the same BOLT11 invoice, the same `paymentHash` and the same macaroon, byte for byte. Nothing new is minted. It doesn't matter which store server answers: the 402 is rebuilt from the invoice Lightning Enable keeps for the design or order, not from server memory. A credential from either copy redeems. - **The invoice expired unpaid:** once the invoice has expired and a short grace (120 seconds, so a payment in flight can settle) has passed, you get a 402 with a **new** invoice and a new macaroon for the same design or order. The store first checks with Lightning Enable that the old invoice was not paid. If a payment of the replaced invoice still settled, its credential still redeems; a credential two invoices back answers `409 payment_superseded` (contact support if you paid it). For Payment B the quote must still be payable; otherwise the answer is `409 quote_expired` and you request a new quote. - **The invoice was paid:** `409 payment_pending` with `paymentStatus` (`paid`, or `processing` while a payment is still settling). No new invoice is issued: repeat the request with `Authorization: L402 :` from that payment. - **An invoice is bound but can't be re-sent yet:** `409 payment_pending` with `paymentExpiresAt` (UTC, ending in `Z`): the time after which repeating the same request gets a fresh invoice. Pay the invoice if you still hold it and it is still payable. If `paymentExpiresAt` is `null`, the binding never lapses: start over with a new `Idempotency-Key`. Payment B: an invoice that's still payable is re-sent even after the quote expires, because it was issued while the quote was valid, and its payment is honored. A design that has been taken down, or a quote that was rejected, is never offered for payment again. ### The human approval boundary An agent may upload, pay Payment A, poll and request quotes. **Approving a design for manufacture is a person's decision, made on the approval page.** Hand the person `approvalUrl` from the design status with `?credential=` appended. The page shows the preview, the product, the color and the print warnings, and the person confirms both statements there themselves: - `acknowledgeRights`: they hold the rights to print and sell this artwork. - `acknowledgePhysicalVariation`: printed colors, size and placement differ from a screen. Never set these on a person's behalf. There is no agent-approval or mandate path, and no API route approves: approval happens only on the approval page. Hand the person `https://store.lightningenable.com/store/custom/design/{designId}/approve?credential=`: the design status's `approvalUrl` with `?credential=` and the design claim token from Payment A appended. Or give them the bare `approvalUrl` and the token, which the page asks them to paste. The page shows the mockup, the product, the color, the print warnings and the design fee paid, and the person ticks both statements and approves there; poll the design status for `Approved`. The link carries the design claim token, so send it only to that person (the page itself never logs it, sends no analytics and strips it from the address bar). Show the person the Payment B total in sats before paying it, and hand them the claim link; the shipping address is entered only by the person, on the private claim page, and is never sent to or returned by this API. ### Artwork checks: before and after payment **Artwork rules.** One PNG, at least 2400 × 2400 px and at most 12,000 × 12,000 px and 40 million pixels in total, at most 50 MB; a transparent background is recommended. The image is scaled to fit the print area, centred horizontally and top-aligned (a chest print). Before any payment the upload refuses a PNG with nothing visible (fully transparent, or under 50% opacity everywhere): `400 nothing_to_print`, failure code `NoVisibleContent`, nothing charged. It warns, without refusing, about `LowEffectiveDpi` (under 150 DPI at print size), `NoTransparency` (the background prints as a solid rectangle) and `ExcessiveEmptyMargins` (more than 40% of the canvas is empty). After Payment A, preparation can add `LowContrastWithGarment`, `ColorProfileDiscarded` and `AnimationDiscarded` on the design status. A file that still cannot be printed ends in `GenerationFailed` with `failureCode: InvalidInput`: the design fee is kept, because the free retry covers technical failures only; upload new artwork. **Before payment (at upload):** free, under the upload rate limit and the store's memory cap: size and declared type, PNG signature, dimensions and pixel count from the header, a strict decode of the alpha channel only (a damaged or truncated PNG is refused), visible content (`NoVisibleContent`: `400 nothing_to_print`), and the warnings `LowEffectiveDpi`, `NoTransparency` and, for artwork with transparency, `ExcessiveEmptyMargins` in the upload response (an opaque image's margins are measured after payment). At most two uploads are decoded at once across the store: when both slots are busy the answer is `503 upload_busy` with `Retry-After: 5`; repeat the exact request. Repeating an upload with the same `Idempotency-Key` returns the stored upload without decoding it again. **After Payment A:** the heavier work: metadata removal (EXIF, XMP, IPTC, text chunks), colour-profile and animation discard (`ColorProfileDiscarded`, `AnimationDiscarded`), contrast against the chosen garment colour (`LowContrastWithGarment`), and the final print file and mockup. These results show on the design status under `printValidation`. An artwork that is accepted at upload but cannot be printed after payment ends in `GenerationFailed` with `failureCode: InvalidInput`. The store keeps the design fee: it covers preparation once it starts, and there is a free retry only for a technical failure (an outage, a timeout), never for the artwork itself. Upload new artwork for a new design. **`Idempotency-Key`:** use a new UUID for each new design, quote or purchase, and resend the same one on the paid retry. The listing checkout requires at least 16 characters (a UUID has 36). **Two links go to the person, and only to them.** The approval link and the claim link carry tokens (the design claim token and the order claim token): hand each one only to the person it is for, never post or log them, and keep the tokens in the `Authorization` header in your own calls. **Rate limits and outages:** on a 429 or 503, honour `Retry-After` (seconds) before you retry; nothing is charged twice. ### GET /api/store/custom/catalog The curated template catalog, not the raw Printful catalog. ```json { "status": "beta", "designPriceSats": 1000, "pricingMode": "fixed", "approval": "human", "artworkChecks": {"rejectedBeforePayment": ["NoVisibleContent"], "warnings": ["LowEffectiveDpi", "NoTransparency", "ExcessiveEmptyMargins", "LowContrastWithGarment", "ColorProfileDiscarded", "AnimationDiscarded"]}, "products": [ { "productCode": "classic-tshirt", "name": "Classic T-Shirt", "printfulCatalogProductId": 71, "technique": "dtg", "placements": ["front"], "colors": [{"code": "black", "name": "Black", "hex": "#0c0c0c"}, {"code": "white", "name": "White", "hex": "#ffffff"}], "sizes": ["S", "M", "L", "XL", "2XL"], "designRequirements": {"format": ["png"], "transparentBackgroundRecommended": true, "minimumWidthPx": 2400, "minimumHeightPx": 2400, "maximumWidthPx": 12000, "maximumHeightPx": 12000, "maximumTotalPixels": 40000000, "maxFileBytes": 52428800, "placementRule": "Scaled to fit the print area, centred horizontally and top-aligned (a chest print).", "printAreas": [{"placement": "front", "widthInches": 12, "heightInches": 16}]}, "availability": {"regions": ["US"], "shipsTo": "the 48 contiguous United States and the District of Columbia", "shippingNote": "Shipping outside the continental US? Contact us at support@lightningenable.com and we may be able to accommodate your order.", "support": "support@lightningenable.com", "status": "available"}, "estimatedProductPrice": {"currency": "USD", "amount": "35.00", "basis": "flat price per shirt, any size, standard shipping included, continental US", "source": "store price (fixed)", "pricingMode": "fixed"} } ] } ``` `estimatedProductPrice` says what its figure is. In `fixed` mode (above) it is the store's flat price per shirt for any size, with standard shipping to the continental US included; when the store's fixed price excludes shipping, `basis` reads "flat price per shirt, any size, plus a standard-shipping estimate, continental US" and `amount` includes that estimate. In `margin` mode it is an estimate for one M, for example `{"currency": "USD", "amount": "28.42", "basis": "one M; estimate; a quote prices the exact variant and destination", "source": "static estimate (Printful catalog price 2026-10-15 + flat US shipping)", "pricingMode": "margin"}`. Either way the quote's `priceSats` is what you pay. ### POST /api/store/custom/uploads Multipart form: field `file` (one PNG), optional field `productCode` (default `classic-tshirt`), optional header `Idempotency-Key`. Checked before anything is invoiced: size, declared type, PNG signature, dimensions read from the header (at most 12,000 × 12,000 px and 40 million pixels), a full decode, and visible content (`400 nothing_to_print` with `failureCode: "NoVisibleContent"` when nothing would print). `NoTransparency`, `ExcessiveEmptyMargins` and `LowEffectiveDpi` come back as `warnings`; see "Artwork checks: before and after payment". Artwork is stored privately; only an `uploadId` comes back. Uploading never charges. One upload can start up to 5 designs (`409 upload_design_limit` after that), and is usable for new designs for 24 hours (`400 upload_expired` after that; upload it again). An upload no paid design uses is deleted after 48 hours. ``` POST /api/store/custom/uploads Content-Type: multipart/form-data; boundary=... file=@design.png ``` **Response (201):** ```json { "uploadId": "upl_3f0b5c7e9a1d2b4c6e8f0a1b2c3d4e5f", "sha256": "...", "sizeBytes": 1834221, "widthPx": 4096, "heightPx": 4096, "effectiveDpi": 341, "warnings": [{"code": "ExcessiveEmptyMargins", "message": "52% of the canvas is empty margin; the design will print smaller than the print area."}] } ``` Metadata removal, colour-profile and animation discard, contrast with the garment and the final print file run after Payment A and show on the design status. ### POST /api/store/custom/designs (Payment A) Header `Idempotency-Key` is required: a new UUID per design, resent unchanged on the paid retry. ``` POST /api/store/custom/designs Content-Type: application/json Idempotency-Key: {"uploadId": "upl_...", "product": {"productCode": "classic-tshirt", "color": "black", "placement": "front"}} ``` **Unpaid response (402):** `WWW-Authenticate: L402 macaroon="...", invoice="..."` and ```json { "error": "payment_required", "designId": "des_...", "priceSats": 1000, "l402": {"macaroon": "...", "invoice": "lnbc...", "paymentHash": "...", "amountSats": 1000, "expiresAt": "..."} } ``` Repeating the unpaid request with the same key returns the same 402 (same invoice, same macaroon) while the invoice is payable, and a new invoice once it expires unpaid. See "Lost 402s and expired invoices" above. **Paid retry:** the same request plus `Authorization: L402 :`. **Response (202):** headers `Location: /api/store/custom/designs/des_...` and `Retry-After: 10`. ```json { "designId": "des_...", "status": "DesignPaymentVerified", "claimToken": "led_...", "claimExpiresAt": "...", "paidSats": 1000, "estimatedSeconds": 30, "statusUrl": "https://store.lightningenable.com/api/store/custom/designs/des_..." } ``` Keep the `claimToken` private: it is the design's credential for status, approval and quotes, and it is shown only in this response (repeating the paid retry returns the same token). ### GET /api/store/custom/designs/{designId} Header `Authorization: Bearer `. Free; poll every 10 seconds. Statuses: `DesignPaymentVerified`, `PreparingPrintFile`, `GeneratingMockup`, `AwaitingApproval`, `Approved`, and the outcomes `GenerationFailed`, `RejectedByCustomer`, `Expired`. ```json { "designId": "des_...", "status": "AwaitingApproval", "product": {"productCode": "classic-tshirt", "name": "Classic T-Shirt", "color": "black", "placement": "front"}, "artwork": {"version": 1, "sha256": "...", "widthPx": 4096, "heightPx": 4096, "background": "transparent", "effectiveDpi": 341}, "printValidation": {"warnings": [], "corrections": []}, "mockups": [{"mockupId": "mck_...", "style": "front", "status": "Ready", "placeholder": false, "imageUrl": ".../api/store/custom/designs/des_.../mockups/mck_..."}], "approvalUrl": "https://store.lightningenable.com/store/custom/design/des_.../approve", "next": {"action": "human_approval", "method": "GET", "url": "https://store.lightningenable.com/store/custom/design/des_.../approve"} } ``` `GET /api/store/custom/designs/{designId}/mockups/{mockupId}` (same Bearer token) returns the preview image as PNG. A wrong or unknown token answers 404, the same as an unknown design. A Printful mockup is rendered asynchronously, so `GeneratingMockup` can last a minute or more; keep polling every 10 seconds. If Printful cannot render it, the design shows `GenerationFailed` briefly and the store retries free of charge. ### The approval page `https://store.lightningenable.com/store/custom/design/{designId}/approve?credential=` (the status's `approvalUrl` plus `?credential=`). The person reviews the preview and approves, with both acknowledgements, or rejects. Approval names the exact current artwork; a later artwork version needs its own approval. Poll the design status for `Approved`. ### POST /api/store/custom/designs/{designId}/quotes Headers `Authorization: Bearer ` and a new `Idempotency-Key` (a UUID). The design must be `Approved`. Postal-level destination only; never send a name or street address. ```json { "variant": {"size": "L"}, "destination": {"countryCode": "US", "stateCode": "PA", "postalCode": "19103"}, "shippingMethod": "STANDARD" } ``` **Response (200):** ```json { "quoteId": "quo_...", "designId": "des_...", "currency": "USD", "totalUsd": "28.42", "priceSats": 34602, "btcUsdRate": 82135.655, "expiresAt": "2026-10-15T12:15:00Z", "quoteDigest": "...", "binding": {"designSha256": "...", "printfulVariantId": 4018, "size": "L", "color": "black", "quantity": 1, "destinationScope": "US-PA-191", "shippingMethod": "STANDARD"}, "pricingMode": "margin", "pricingSource": "printful", "pricingIsEstimate": false } ``` `pricingMode` says how the store sets its retail price. `"margin"`: Printful's cost, shipping and a tax estimate plus the store's margin. `"fixed"`: the store sells at a fixed USD price per unit (shipping included, or plus standard shipping, as `includes` says), converted at the live rate and rounded up; the design fee is unchanged. In both modes the store records Printful's cost with the quote and checks Printful's real price again before it submits the order, so a quote never authorizes an order Printful prices far above it. A store that has not configured its prices answers 503 pricing_not_configured and quotes nothing. The custom catalog reports the same `pricingMode`. The destination becomes a scope of state and the first three ZIP digits (`US-PA-191`); the address entered later must fall inside it. One unit per order; `"shippingMethod": "STANDARD"` only. Quotes last 15 minutes (`expiresAt`); after that, request a new quote. Repeating the request with the same key returns the same quote. ### POST /api/store/custom/checkout (Payment B) Headers `Idempotency-Key` (a new UUID; resent unchanged on the paid retry) and `Authorization: Bearer ` on the unpaid request. Body `{"quoteId": "quo_...", "designId": "des_..."}`. **Unpaid response (402):** the same shape as Payment A, with `orderId` and an invoice for exactly the quote's `priceSats`. A quote with less than two minutes left gets no invoice; request a new quote. The invoice expires no later than the quote. If the invoice cannot be bound to the quote, the answer is `503 pricing_unavailable`: request a new quote and check out again; nothing was charged. **Paid retry:** the same request with `Authorization: L402 :` in place of the Bearer token (the credential was issued to the claim token's holder and binds the order). **Response (200):** ```json { "orderId": "ord_...", "status": "PaidAwaitingDetails", "claimUrl": "https://store.lightningenable.com/store/claim?token=leo_...", "claimToken": "leo_...", "claimExpiresAt": "...", "paidSats": 34602, "statusUrl": "https://store.lightningenable.com/api/store/custom/orders/ord_..." } ``` Give `claimUrl` to the person who receives the shirt, and only to them: it carries the order claim token. A payment that settles after the quote expired is still honored: the invoice was issued while the quote was valid. ### GET /api/store/custom/orders/{orderId} Header `Authorization: Bearer `. Privacy-minimized: status, product, size, color, quantity, sats paid, Printful status and tracking. Never the address, email, macaroon, invoice or preimage. ### POST /api/store/custom/orders/{orderId}/fulfill Header `Authorization: Bearer `, no body. Finishes submitting an order whose shipping address was already entered on the claim page but which stopped before Printful confirmed it (`Claimed`, `PrintfulDraftCreated`, `PrintfulCostVerified`: Printful was busy, or still pricing the draft). It uses the address Lightning Enable stored; **it never takes an address**, which is entered only by the person on the claim page. The store also finishes such orders by itself in the background, so this call is only a nudge. Safe to repeat: the order is confirmed at Printful at most once. | HTTP | Code | Meaning | |---|---|---| | 200 | submitted, already_submitted | The order is with Printful (`status` is `SubmittedForFulfillment` or later) | | 409 | address_required | No usable address yet: give the person the `claimUrl` | | 409 | order_in_review, quote_changed | The order stopped for a person at Lightning Enable (for example Printful's price rose beyond what the quote allowed) | | 503 | fulfillment_unavailable, fulfillment_busy | Printful or Lightning Enable could not answer, or the order is being submitted right now; retry after `Retry-After` | The claim token goes only in the `Authorization` header. The earlier routes that put it in the path, `GET /api/store/order/{leo_...}` and `POST /api/store/order/{leo_...}/fulfill`, answer `410 endpoint_moved` with `newPath` and never read the token. ### After the claim: how the order reaches Printful The person enters the shipping address on the claim page (`claimUrl`). The address must be inside the quote's `destinationScope`; if it is not, nothing is stored and the claim stays open for a corrected address. Then the store: 1. Checks the order against its quote and that the design is still approved, and that the size and color are still in stock at Printful. 2. Creates the Printful order as a **draft** (nothing is manufactured or billed yet), or adopts the draft it already created if this is a retry. 3. Compares Printful's total with the most the quote allowed. If Printful's price is higher, the order stops for manual review (`ManualReview`); it is never submitted, and a second invoice is never charged. 4. Submits the draft for fulfillment exactly once. Order statuses you can see: `PaidAwaitingDetails` (waiting for the address), `Claimed`, `PrintfulDraftCreated`, `PrintfulCostVerified`, `SubmittedForFulfillment`, `InProduction`, `Shipped`, `Delivered`. `AddressInvalid` means Printful refused the address and the claim is open again; `ManualReview` means a person at Lightning Enable will contact the buyer. If any step stops part way (Printful busy or still pricing the draft, a brief outage), nobody types the address again: the store retries the order in the background with the address it stored, the claim page shows a **Finish submitting** button, and an agent can call `POST /api/store/custom/orders/{orderId}/fulfill`. Just before submitting, the store checks once more that the design is still approved and that Printful's current price (in USD) is still within what the quote allowed. ### Custom product errors Errors are JSON `{"error": "", "message": "..."}`; the message says what to do next. | HTTP | Error code | Meaning | |---|---|---| | 400 | idempotency_key_required, invalid_idempotency_key | Send an `Idempotency-Key` of 1-200 characters from A-Z a-z 0-9 . _ : - (refused, never truncated) | | 400 | upload_rejected, file_required, file_too_large | The PNG failed a pre-invoice check (including a damaged PNG or too many pixels); nothing was charged | | 503 | upload_busy | The store is checking other uploads; honour `Retry-After` (5 seconds) and repeat the exact request. Nothing was stored or charged | | 400 | nothing_to_print | The PNG has no visible pixels (`failureCode: NoVisibleContent`: fully transparent, or under 50% opacity everywhere); nothing was charged; upload artwork with visible pixels | | 400 | upload_expired | The upload is more than 24 hours old; upload the PNG again | | 400 | invalid_product, invalid_color, invalid_placement, invalid_size, invalid_quantity | Use values from the custom catalog; one unit per order | | 400 | destination_not_supported | Outside the 48 contiguous states and DC (including Alaska, Hawaii, territories, APO/FPO/DPO, other countries). The message ends with a support line and the body carries `support`, the store's support address: ask there before giving up on an order | | 400 | approval_acknowledgements_required, artwork_sha256_required | Approval needs both acknowledgements from the person and the exact artwork digest | | 401 | invalid_credential, invalid_preimage, credential_mismatch | The L402 credential is not for this exact request, or the preimage does not match; repeat the original request exactly | | 401 | claim_token_required | Send `Authorization: Bearer ` | | 402 | payment_required | Pay the invoice (expected) | | 404 | claim_not_found, quote_not_found | Unknown id, or a token that does not match | | 404 | custom_products_disabled | Custom products are not switched on yet | | 409 | idempotency_key_reuse | The key was used for a different request; use a new key | | 409 | payment_pending | An invoice is bound and can't be re-sent: with `paymentStatus` `paid` or `processing`, redeem it with its preimage; otherwise pay it if you hold it, or repeat the request after `paymentExpiresAt` (`null`: start over with a new key) | | 409 | payment_superseded | The credential is for an invoice that was replaced twice; if you paid it, contact support@lightningenable.com | | 409 | upload_design_limit | The upload already has 5 designs; upload the PNG again | | 409 | design_taken_down | The design was taken down: the order is cancelled and takes no payment (a payment that still arrived is recorded; contact support) | | 409 | order_closed | The order is held for manual review; contact support@lightningenable.com | | 409 | design_already_paid, order_already_paid | Repeat the request with your L402 credential to get the claim token | | 409 | design_closed | The design was rejected, taken down or expired; start a new design with a new key (if you paid its invoice, contact support) | | 409 | design_not_approved, quote_expired, quote_expiring, quote_already_ordered, quote_not_payable | Approve first, or request a new quote | | 409 | address_required | The order has no shipping address yet; the person enters it on the claim page | | 410 | endpoint_moved | A path-token route was retired; use `newPath` with the token in the `Authorization` header | | 410 | claim_expired | The claim window ended | | 429 | mint_rate_limited | The store is issuing too many new invoices; retry after `Retry-After` seconds, nothing was charged | | 503 | store_api_unavailable, artwork_storage_unavailable, invoice_unavailable, price_unavailable | Retry after `Retry-After` seconds; nothing is charged twice | | 503 | pricing_unavailable | The quote could not be turned into an invoice; request a new quote and check out again. Nothing was charged | | 503 | pricing_not_configured | The store has not configured custom-product prices yet; nothing was quoted or charged. Try again later | | 503 | store_subscription_inactive | The store's Lightning Enable subscription is not active (`reason`: plan_required, subscription_inactive or credentials_rejected); nothing can be ordered or looked up until the store owner fixes it. Try again later or contact the store | | 503 | fulfillment_unavailable, fulfillment_busy | The order is saved; retry `POST /api/store/custom/orders/{orderId}/fulfill` after `Retry-After`, or let the store finish it | ### Custom product rate limits (per IP) | Route | Limit | |---|---| | POST uploads | 20 per hour | | POST designs | 10 per minute | | GET designs/{id} | 120 per minute | | GET mockup image | 30 per minute | | POST quotes | 20 per minute | | POST checkout | 10 per minute | | GET orders/{id} | 60 per minute | | POST orders/{id}/fulfill | 10 per minute | On a 429, honour `Retry-After` before you retry. New invoices for unpaid design and checkout requests also share one store-wide window (60 per minute, across every caller); re-sending a stored invoice does not count. ### Failure, refund and credit policy Lightning payments are final and Printful work has real costs, so the policy is explicit. **There are no automatic Lightning refunds** until an outgoing refund path is built and tested. Design (Payment A): - An invalid request before the invoice: no charge. - A technical preparation failure: retried automatically, free of charge (up to three attempts), never a second charge. - Preparation succeeds but the person dislikes the result: no refund; start a new design. - A preview failure after valid artwork: the preview is retried without another design charge. Product (Payment B): - An address outside the quoted scope, or otherwise invalid, before submission to Printful: the claim stays open for correction. - Printful's cost exceeds the quote's tolerance: fulfillment stops for review; a second invoice is never charged blindly. - The variant becomes unavailable: an approved substitute is offered, or the order goes to review. - A paid order that cannot be submitted: it is marked as a fulfillment failure and handled manually. - A Printful cancellation or refund is tracked separately from any reimbursement to the customer. - A damaged or misprinted product follows the merchant and Printful claims policy. For any exception, contact support@lightningenable.com with the order id. --- ## Designed by our customers: published design listings (beta) A designer may publish an approved custom design as a **listing** with a shareable URL; any number of buyers then buy their own copy through a fresh quote, order and claim of their own. The design never changes (an approved design is immutable). Off unless the store runs listings: every route below answers 404 "custom_listings_disabled". Lightning Enable does not hold funds: each sale is paid to the store's payment provider like any custom order. ### GET /api/store/custom/listings Buyable listings, newest first. Query `skip` (default 0) and `take` (1-50, default 20); the total is in `X-Total-Count`. Rate limit `custom-status`. ```json { "listings": [ { "listingId": "lst_abcdefghijklmnopqrstuvwxyz", "title": "Orange Bolt Tee", "product": { "productCode": "classic-tshirt", "name": "Classic T-Shirt", "color": "black", "colorName": "Black", "sizes": ["S", "M", "L", "XL", "2XL"] }, "listingUrl": "https://store.lightningenable.com/store/custom/listing/lst_abcdefghijklmnopqrstuvwxyz", "mockupUrl": "https://store.lightningenable.com/api/store/custom/listings/lst_abcdefghijklmnopqrstuvwxyz/mockup", "checkoutUrl": "https://store.lightningenable.com/api/store/custom/listings/lst_abcdefghijklmnopqrstuvwxyz/checkout", "publishedAt": "2026-10-16T12:00:00Z", "listingExpiresAt": null, "estimatedPrice": { "currency": "USD", "amount": "29.00", "basis": "one M; estimate; a quote prices the exact variant and destination", "source": "static estimate (Printful catalog price 2026-10-15 + flat US shipping)", "pricingMode": "margin" }, "shipsTo": "the 48 contiguous United States and the District of Columbia", "shippingNote": "Shipping outside the continental US? Contact us at support@lightningenable.com and we may be able to accommodate your order." } ], "total": 1, "paused": false } ``` `paused: true` means the store has paused listing sales (nothing is listed or sold until it resumes). A listing never shows its designer or design id. The same listings appear in `GET /api/store/catalog` under `customListings`. ### GET /api/store/custom/listings/{listingId} One buyable listing (same shape), or 404 "listing_not_found" (unknown, withdrawn, rejected, taken down or expired). `GET /api/store/custom/listings/{listingId}/mockup` returns its approved mockup PNG (rate limit `custom-mockups`). ### POST /api/store/custom/listings/{listingId}/checkout (buy a listing) Headers: `Idempotency-Key` (required: a new UUID per purchase, at least 16 characters, else 400 "invalid_idempotency_key"). Body (postal level only, never a name or street): ```json { "size": "L", "quantity": 1, "destinationScope": "US-PA-191" } ``` `destinationScope` is `US-{state}-{first three ZIP digits}`; or send `"destination": { "countryCode": "US", "stateCode": "PA", "postalCode": "19103" }`. The store reads the listing fresh, prices a quote of your own (fixed price or cost plus margin, at the live BTC/USD rate), creates the order and answers **402** with the invoice and a v2 store credential (kind `order`) bound to this listing path, the quote, the size, the destination and the `Idempotency-Key`: ```json { "error": "payment_required", "orderId": "ord_...", "quoteId": "quo_...", "listingId": "lst_...", "payment": "physical_product", "l402": { "macaroon": "...", "invoice": "lnbc...", "paymentHash": "...", "amountSats": 36525, "expiresAt": "..." } } ``` Pay, then repeat the exact request (same body, same key) with `Authorization: L402 :`: **200** with `orderId`, `listingId`, `claimUrl`, `claimToken`, `claimExpiresAt`, `paidSats` and `statusUrl`. A different size or destination on the paid retry is 401 "credential_mismatch"; a listing credential does not redeem on `/api/store/custom/checkout`. An unpaid retry with the same key re-sends the same invoice. Rate limit `custom-checkout`. Refusals: 400 "invalid_size", "invalid_quantity", "invalid_destination", "destination_required", "destination_not_supported" (outside the 48 contiguous states and DC, with the support line); 404 "listing_not_found"; 409 "listing_not_available" (withdrawn, taken down or expired; with `reason: "publishing_disabled"` the store paused listing sales), "quote_expired", "quote_not_payable"; 429 "listing_quote_limit" (too many open quotes on the listing; retry after `Retry-After`), "mint_rate_limited". Nothing is charged on any refusal. ### Buying on the listing page (people) `https://store.lightningenable.com/store/custom/listing/{listingId}` shows the mockup, title, product and color. The person picks a size and enters their state and ZIP, sees the exact price in sats, and presses **Pay with Lightning**: the store creates their order and opens a private hosted checkout (`/store/custom/checkout?token=...`) with the BOLT11 invoice and a QR code. Once Lightning Enable records the payment, the page shows the private claim link. The checkout link is the order's key until it is claimed: keep it private. The page polls with a POST that carries the token in its body, so the token never appears in a URL path. A buyer who already paid still reaches the claim link if the store later switches listings off. ### Publishing a design Only the designer's choice, only for an `Approved` design, and only while the store accepts listings ("publishing_disabled" otherwise). On the approval page the person fills in a title and confirms the rights again; agents use: ``` POST /api/store/custom/designs/{designId}/publish Authorization: Bearer { "listingTitle": "Orange Bolt Tee", "acknowledgeRights": true } ``` `acknowledgeRights` is the designer's statement that the artwork may be sold to other buyers: send it only after the designer confirmed it, never on your own. Answer: `{ designId, publicationStatus, listingId, listingTitle, listingUrl, publishedAt, listingExpiresAt, next }`. `publicationStatus` is "pending_review" while the store reviews it (the default), `published` (with `listingUrl`), `rejected`, `withdrawn` or `expired`. `GET /api/store/custom/designs/{designId}/publication` reads it; `POST /api/store/custom/designs/{designId}/withdraw` takes it down. Withdrawn, rejected and expired listings are closed for good (409 "invalid_transition" on a new request); the design stays approved for the designer's own orders. Refusals: 400 "invalid_listing_title" (1-120 characters), "acknowledgement_required"; 409 "design_not_approved", "publishing_disabled", "publish_limit_reached" (`limit`: listings per designer); 401/404/410 for the design claim token. Approving the design itself stays a person's decision on the approval page; there is no approve route. When a listing closes (the designer withdraws it, it expires, or the store takes it down), it disappears everywhere within 30 seconds, and its open quotes are rejected: quotes not yet priced, and unexpired priced quotes with no order or an unpaid one. A quote with a paid order is left alone. A designer's withdrawal or an expiry stops no order: an order already paid is made as usual. When the store takes a published listing down (the design stays approved), unpaid orders of the listing are cancelled and paid orders not yet sent to Printful are held for manual review; support contacts the buyer. A takedown of the design itself stops its orders the same way, as for any custom order. If a listing closes while you are paying its invoice, do not pay again: the hosted checkout says "confirming" once the payment is seen. A quote whose pricing failed is rejected: request the checkout again with a new Idempotency-Key. ## Links - Store: https://store.lightningenable.com - Summary: https://store.lightningenable.com/llms.txt - MCP Setup: https://store.lightningenable.com/skills.md - MCP complete guide: https://docs.lightningenable.com/products/agentic-commerce/mcp-complete-guide - Documentation: https://docs.lightningenable.com - Support: support@lightningenable.com