{"openapi":"3.1.0","info":{"title":"ConnectMeGuru Autonomous Agentic Commerce API","description":"Autonomous machine-to-machine eSIM purchasing API using spot-discounted non-custodial USDC and USDT payments on Base (Coinbase L2), Polygon PoS, Arbitrum One, and TRON. Compatible with Coinbase AgentKit, autonomous travel bots, and LLM orchestrators.","version":"1.0.0","contact":{"name":"ConnectMeGuru API Support","url":"https://www.connectmeguru.com","email":"support@connectmeguru.com"}},"servers":[{"url":"https://www.connectmeguru.com","description":"Production API Endpoint"}],"paths":{"/api/agentic/auth/request-otp":{"post":{"summary":"Request Email Verification OTP (One-Time Setup)","description":"Step 1 of Machine Onboarding: Dispatches a 6-digit OTP to the bot owner email. Rejects disposable/burner email providers and validates DNS MX records. Valid for 10 minutes.","operationId":"requestAgentOtp","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","description":"Real, non-disposable email address of the bot owner or operator."}}}}}},"responses":{"200":{"description":"OTP code successfully dispatched to the provided email."},"400":{"description":"Invalid email format, disposable email rejected, or unresolvable MX records."}}}},"/api/agentic/auth/verify-otp":{"post":{"summary":"Verify OTP & Issue Machine Personal Access Token (PAT)","description":"Step 2 of Machine Onboarding: Exchanges the 6-digit OTP for a permanent machine-to-machine Personal Access Token (PAT). Store this token securely and pass as \"Authorization: Bearer <token>\" on all subsequent checkouts for 100% autonomous operation.","operationId":"verifyAgentOtp","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","otp"],"properties":{"email":{"type":"string","format":"email"},"otp":{"type":"string","description":"6-digit verification code received by email"},"agentName":{"type":"string","description":"Optional friendly name for this autonomous bot"}}}}}},"responses":{"200":{"description":"Email verified. Permanent Personal Access Token (PAT) returned.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"string","example":"VERIFIED"},"token":{"type":"string","example":"cmg_pat_4f2a9..."},"tokenType":{"type":"string","example":"Bearer"},"message":{"type":"string"}}}}}},"400":{"description":"Invalid or expired OTP code."}}}},"/api/products/search":{"get":{"summary":"Search & Discover eSIM Data Plans","description":"Query available international travel eSIM data plans by destination country, region, or keyword.","operationId":"searchEsimPlans","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string"},"description":"Destination country name or ISO code (e.g. \"Japan\", \"JP\", \"Europe\", \"USA\")."}],"responses":{"200":{"description":"List of matching eSIM packages with packageCode, data amount, duration, and retail price.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"totalCount":{"type":"integer"},"hasMore":{"type":"boolean"},"plans":{"type":"array","items":{"type":"object","properties":{"packageCode":{"type":"string","description":"Unique code required for checkout"},"name":{"type":"string"},"dataAmount":{"type":"number","description":"Data quota in GB"},"duration":{"type":"integer","description":"Validity duration in days"},"price":{"type":"number","description":"Price in USD"}}}}}}}}}}}},"/api/agentic/checkout":{"post":{"summary":"Initiate Autonomous Crypto Checkout (HTTP 402)","description":"Initiate an autonomous purchase of an eSIM data package. Requires Bearer authentication with a machine Personal Access Token (PAT). Allocates a collision-free micro-cent spot discount and responds with HTTP 402 Payment Required containing receiving address, exact USDC or USDT amount, network, token contract address, expiration, and status polling URL.","operationId":"createAgenticCheckout","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["packageCode"],"properties":{"packageCode":{"type":"string","description":"The package code of the desired eSIM plan (e.g. \"ESIM_JP_7D_1GB\")."},"customerEmail":{"type":"string","format":"email","description":"Optional destination email to deliver the eSIM installation details. Defaults to your authenticated account email."},"preferredNetwork":{"type":"string","enum":["BASE","POLYGON","ARBITRUM","TRON"],"default":"BASE","description":"Blockchain network preferred for the crypto transfer."},"preferredCurrency":{"type":"string","enum":["USDC","USDT"],"default":"USDC","description":"Stablecoin token currency (USDC or USDT)."},"discountCode":{"type":"string","description":"Optional promotional discount coupon code."},"customerCountry":{"type":"string","description":"Optional 2-letter country code of customer residence."}}}}}},"responses":{"400":{"description":"Bad Request - input validation failed or order limit exceeded."},"401":{"description":"Unauthorized - Missing or invalid Bearer PAT token. First-time agents must call /api/agentic/auth/request-otp first."},"402":{"description":"HTTP 402 Payment Required. Contains exact cryptocurrency transfer instructions and polling URL.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"PAYMENT_REQUIRED"},"invoiceId":{"type":"string","example":"inv_123456_abcd"},"orderRef":{"type":"string"},"plan":{"type":"object","properties":{"packageCode":{"type":"string"},"name":{"type":"string"},"dataAmountGb":{"type":"number"},"durationDays":{"type":"integer"},"basePriceUsd":{"type":"number"}}},"payment":{"type":"object","properties":{"currency":{"type":"string","enum":["USDC","USDT"],"example":"USDC"},"network":{"type":"string","example":"BASE"},"networkName":{"type":"string"},"contractAddress":{"type":"string","description":"USDC or USDT smart contract address on selected network"},"receivingAddress":{"type":"string","description":"Merchant wallet address"},"expectedAmount":{"type":"number","description":"Exact crypto amount to transfer (including spot discount)"},"baseAmount":{"type":"number"},"spotDiscountOffset":{"type":"number"},"qrDataUrl":{"type":"string"},"expiresAt":{"type":"integer","description":"Unix timestamp when this payment quote expires"},"expiresAtIso":{"type":"string"},"pollingUrl":{"type":"string","description":"URL to poll for payment confirmation and eSIM credentials"}}},"customer":{"type":"object","properties":{"email":{"type":"string"}}},"instructions":{"type":"string"}}}}}},"403":{"description":"Forbidden - Agentic purchases are currently disabled by the merchant."},"503":{"description":"Service Unavailable - Crypto payment gateway is inactive."}}}},"/api/agentic/order/{invoiceId}":{"get":{"summary":"Poll Settlement & Retrieve eSIM Credentials","description":"Poll payment confirmation status. Once payment is detected and settled on chain, returns eSIM ICCID, LPA activation string, and QR code URL.","operationId":"getAgenticOrder","parameters":[{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string"},"description":"Invoice ID returned from /api/agentic/checkout."}],"responses":{"200":{"description":"Order status. Returns COMPLETED with eSIM credentials, or PENDING_PAYMENT / PROCESSING.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING_PAYMENT","CONFIRMED_AWAITING_FULFILLMENT","PROCESSING","COMPLETED","FAILED","EXPIRED"],"example":"COMPLETED"},"invoiceId":{"type":"string"},"orderId":{"type":"string"},"plan":{"type":"object","properties":{"packageCode":{"type":"string"},"name":{"type":"string"},"dataAmountGb":{"type":"number"},"durationDays":{"type":"integer"}}},"esim":{"type":"object","properties":{"iccid":{"type":"string","description":"Unique eSIM ICCID identifier"},"lpaString":{"type":"string","example":"LPA:1$smdp.example.com$MATCHING_ID"},"qrCodeUrl":{"type":"string","description":"eSIM profile download QR code URL"},"smdpAddress":{"type":"string"},"matchingId":{"type":"string"}}},"instructions":{"type":"string"}}}}}},"404":{"description":"Invoice or order not found."}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"PAT","description":"Machine-to-machine Personal Access Token (PAT) generated via /api/agentic/auth/verify-otp or ConnectMeGuru dashboard profile."}}}}