{"openapi":"3.1.0","info":{"title":"beUI Pro agent purchases","version":"1.2.0","description":"Lifetime Pro licenses and standalone template ZIP purchases through native Solana MPP. Buyers pay network fees in SOL. Sign in with the wallet, POST /buy/:productId, and receive the license key or template download URL. Internal orders prevent duplicate charges. Do not repay processing or needs_review purchases."},"servers":[{"url":"https://api.beui.dev"}],"components":{"securitySchemes":{"accountSession":{"type":"http","scheme":"bearer","description":"Verified account JWT from the existing email sign-in flow. Used only to redeem a wallet-issued claim code."},"walletSession":{"type":"http","scheme":"bearer","description":"One-hour wallet session from SIWS /v1/mpp/auth/verify. Required to create orders and recover wallet purchases."}}},"paths":{"/v1/mpp/auth/challenge":{"post":{"operationId":"createWalletChallenge","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"Solana wallet public address"}}}}}},"responses":{"201":{"description":"challenge_id, SIWS input, and exact message to sign. Expires in five minutes."},"400":{"description":"Invalid wallet address."}}}},"/v1/mpp/auth/verify":{"post":{"operationId":"verifyWalletSignature","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["challenge_id","signature"],"properties":{"challenge_id":{"type":"string"},"signature":{"type":"string","description":"64-byte Ed25519 signature over the returned message, encoded as 128 hex characters."}}}}}},"responses":{"200":{"description":"One-hour bearer access_token, wallet, network, expires_at. Nonce consumed atomically."},"401":{"description":"Invalid signature, expired or consumed challenge."}}}},"/v1/mpp/wallet/orders":{"get":{"operationId":"listWalletOrders","security":[{"walletSession":[]}],"parameters":[{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Wallet-bound orders on this network, including pending and uncertain orders. Up to 50; follow next_offset until null. Paid orders include download_url or license_url. Access requires the purchasing wallet session."},"401":{"description":"Wallet sign-in required."}}}},"/v1/mpp/buy/{productId}":{"post":{"operationId":"buyOrRecoverProduct","security":[{"walletSession":[]}],"parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"string","examples":["pro-lifetime","personal-website"]}}],"responses":{"200":{"description":"Paid purchase or recovery without another charge. Payment-Receipt header plus license.license_key (Pro) or download_url (template). Use the wallet session to download."},"401":{"description":"Wallet sign-in required."},"402":{"description":"Native MPP challenge. Retry this POST with Payment-Authorization and the same wallet bearer session."},"409":{"description":"Uncertain payment; inspect status and do not repay."},"410":{"description":"Expired payment credential or previously attempted purchase; recover before retrying. Never-attempted quotes renew on requests without a payment credential."},"503":{"description":"Purchases disabled or temporarily unavailable. Paid purchase recovery remains available."}}}},"/v1/mpp/catalog":{"get":{"operationId":"getAgentCatalog","responses":{"200":{"description":"Availability, USDC mint, network, recipient and template prices in atomic units (6 decimals)."}}}},"/v1/mpp/orders":{"post":{"operationId":"createProductOrder","deprecated":true,"security":[{"walletSession":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","oneOf":[{"required":["product_id"]},{"required":["template_slug"]}],"properties":{"product_id":{"type":"string","examples":["pro-lifetime"]},"template_slug":{"type":"string"}}}}}},"responses":{"200":{"description":"Compatibility endpoint: creates or reuses a wallet-owned order. Prefer POST /buy/:productId. No order credential is issued."},"503":{"description":"Purchases disabled or download unavailable."}}}},"/v1/mpp/orders/{id}":{"get":{"security":[{"walletSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getTemplateOrder","responses":{"200":{"description":"Order state. Paid orders include download_url or license_url."},"401":{"description":"Purchasing wallet session required."}}}},"/v1/mpp/orders/{id}/pay":{"get":{"security":[{"walletSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"payTemplateOrder","x-payment-info":{"offers":[{"method":"solana","intent":"charge","amount":null,"currency":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","description":"Order-specific USDC price. Agent pays SOL fees; no sponsorship."}]},"responses":{"200":{"description":"Verified payment or recovery of a paid order; Payment-Receipt and download_url or license_url returned."},"402":{"description":"Native MPP challenge. Use the advertised Payment-Authorization credential header alongside the wallet bearer session."},"409":{"description":"Payment unavailable or uncertain. Read order status; never automatically repay."},"503":{"description":"Purchases disabled or temporarily unavailable."}}}},"/v1/mpp/orders/{id}/license":{"get":{"security":[{"walletSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"recoverProLicense","responses":{"200":{"description":"Stable Lifetime license key. test_mode keys never grant production access."},"403":{"description":"Order is not paid."}}}},"/v1/mpp/orders/{id}/claim-code":{"post":{"security":[{"walletSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"createLicenseClaimCode","responses":{"200":{"description":"A ten-minute code to enter at /app. Only the purchasing wallet can request it. New codes replace old codes."},"403":{"description":"Paid mainnet license required; devnet cannot be claimed."},"409":{"description":"License already linked or inactive."}}}},"/v1/mpp/licenses/claim":{"post":{"security":[{"accountSession":[]}],"operationId":"claimLicenseForAccount","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["claim_code"],"properties":{"claim_code":{"type":"string"}}}}}},"responses":{"200":{"description":"License linked to the verified account. Same-account retries are idempotent while the code is valid."},"409":{"description":"Code expired, already claimed by another account, or license inactive."}}}},"/v1/mpp/orders/{id}/download":{"get":{"security":[{"walletSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"downloadTemplateOrder","responses":{"200":{"description":"Purchased template ZIP.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Order is not paid."}}}}}}