Send a product to someone else, paid over Lightning. The buyer pays; the gift
ships to the recipient. Same L402 purchase rails as restock-from-photo, with
two differences: tax + shipping use the recipient's location, and the order
is finalized through the claim API with the recipient's address.
-
Identify the product + store (references in restock-from-photo, or
le_shopify.py catalog <slug> for the exact variantId + price). A photo
works too — same identification as restock.
-
Get the recipient's location. Tax + shipping are destination-based, so
use the recipient's zip: US-<STATE>-<ZIP>. You'll need their full
address for the claim step; collect name + address now or after payment.
-
Create the checkout (L402 challenge):
python scripts/le_shopify.py checkout <slug> <variantId> <recipientLocation> [qty]
HTTP 402 is expected — note totalUsd, totalSats, invoice,
macaroonBase64.
-
Budget gate with get_budget_status / check_wallet_balance.
-
Confirm with the buyer — explicitly. Show: "Gift {product} from
{store} to {recipient} in {city, state} — ${totalUsd} (~{totalSats}
sats). Pay now? (yes/no)" Proceed only on yes.
-
Pay the invoice with the MCP wallet → capture the preimage.
-
Get the claim token (L402 retry):
python scripts/le_shopify.py complete <slug> <variantId> <recipientLocation> <macaroonBase64> <preimage> [qty]
Returns the claim token.
-
Finalize the gift with the recipient's address (this is the gift-specific
step — restock hands the human a link instead):
python scripts/le_shopify.py claim <slug> <claimToken> <email> '<shippingAddressJson>'
email — who gets the order/shipping confirmation. Ask the buyer whether to
use their own email or the recipient's.
shippingAddressJson — the recipient's address, e.g.
{"firstName":"Mom","lastName":"Smith","address1":"1 Main St","city":"Orlando","province":"FL","zip":"32801","country":"US"}
-
Confirm it's on the way. Report the order placed and, if the buyer wants,
draft a short gift note they can send the recipient.