{"openapi":"3.1.0","info":{"title":"ConnectMeGuru B2B Wholesale eSIM Gateway API","version":"1.0.0","description":"Enterprise wholesale API for global eSIM provisioning, live data top-ups, carrier usage telemetry, and automated USD crypto balance funding.","contact":{"name":"ConnectMeGuru Partner Engineering","email":"partners@connectmeguru.com","url":"https://partner.connectmeguru.com"}},"servers":[{"url":"https://connectmeguru.com","description":"Production API Gateway"},{"url":"https://partner.connectmeguru.com","description":"Partner Subdomain Gateway"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-B2B-Key","description":"Your Corporate Public Key (e.g. cmg_live_...)"},"ApiSecretAuth":{"type":"apiKey","in":"header","name":"X-B2B-Secret","description":"Your Corporate Secret Key (e.g. cmg_sec_...)"}}},"security":[{"ApiKeyAuth":[],"ApiSecretAuth":[]}],"paths":{"/api/b2b/v1/balance":{"get":{"summary":"Get Prepaid USD Wallet Balance","description":"Retrieve real-time USD balance and account status.","responses":{"200":{"description":"Account balance retrieved successfully","content":{"application/json":{"example":{"success":true,"companyName":"Acme Corp","currency":"USD","balanceUsd":250,"lowBalanceThreshold":50,"isLowBalance":false,"status":"ACTIVE"}}}}}}},"/api/b2b/v1/balance/deposit":{"post":{"summary":"Generate Crypto Deposit Address","description":"Generate a multi-chain deposit address (USDT or USDC on Base, Polygon, Arbitrum, or Tron) to fund your corporate USD wallet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amountUsd","currency"],"properties":{"amountUsd":{"type":"number","minimum":10,"example":100},"currency":{"type":"string","enum":["USDT","USDC"],"example":"USDT"},"network":{"type":"string","enum":["POLYGON","BASE","ARBITRUM","TRON"],"example":"BASE"}}}}}},"responses":{"200":{"description":"Deposit invoice generated successfully","content":{"application/json":{"example":{"success":true,"invoiceId":"inv_demo_849201","amountUsd":100,"currency":"USDT","network":"BASE","depositAddress":"0x71C...aB49","checkoutUrl":"https://crypto.connectmeguru.com/checkout/inv_demo_849201"}}}}}}},"/api/b2b/v1/balance/verify-deposit":{"post":{"summary":"Confirm & Verify Crypto Deposit","description":"Submit your on-chain transaction hash or trigger server-side blockchain verification to credit your USD wallet instantly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["invoiceId"],"properties":{"invoiceId":{"type":"string","example":"inv_demo_849201"},"txHash":{"type":"string","example":"0x7a8b...12c3"}}}}}},"responses":{"200":{"description":"Deposit verified and credited","content":{"application/json":{"example":{"success":true,"status":"CONFIRMED","message":"Deposit verified and credited successfully.","invoiceId":"inv_demo_849201","creditedUsd":100,"newBalanceUsd":350,"currency":"USDT","network":"BASE"}}}}}}},"/api/b2b/v1/balance/deposit/{invoiceId}":{"get":{"summary":"Query Deposit Invoice Status","description":"Fetch the real-time settlement and blockchain confirmation status of a deposit invoice.","parameters":[{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","example":"inv_demo_849201"}}],"responses":{"200":{"description":"Invoice status retrieved"}}}},"/api/b2b/v1/plans":{"get":{"summary":"Browse Wholesale eSIM Plans","description":"Query global data packages with direct wholesale purchase prices in USD. Filter by 2-letter country code or keyword.","parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string","example":"US"},"description":"2-letter ISO country code (e.g. US, JP, GB)"},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["BASE","TOPUP"],"default":"BASE"}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of matching wholesale plans"}}}},"/api/b2b/v1/orders":{"post":{"summary":"Order & Provision Instant eSIM Profile","description":"Purchases a new eSIM profile using your prepaid USD wallet. Deducts the wholesale price and returns instant activation credentials (ICCID, QR code image URL, LPA string).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["packageCode"],"properties":{"packageCode":{"type":"string","example":"US_1GB_7D"},"partnerRefId":{"type":"string","description":"Your internal transaction ID (idempotency key)","example":"order_ref_12345"}}}}}},"responses":{"200":{"description":"Order fulfilled successfully"},"402":{"description":"Insufficient USD wallet balance"}}},"get":{"summary":"List Wholesale Orders","description":"Search and paginate previously fulfilled orders.","parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":20}},{"name":"iccid","in":"query","schema":{"type":"string"}},{"name":"partnerRefId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated list of orders"}}}},"/api/b2b/v1/orders/{iccid}/topup-plans":{"get":{"summary":"Discover Compatible Top-Up Bundles","description":"Pass an active ICCID to check which carrier bundles are eligible for data top-up.","parameters":[{"name":"iccid","in":"path","required":true,"schema":{"type":"string","example":"89852000000000000000"}}],"responses":{"200":{"description":"List of compatible top-up plans"}}}},"/api/b2b/v1/orders/{iccid}/topup":{"post":{"summary":"Execute Instant Data Top-Up","description":"Applies an additional data bundle to an active eSIM profile without modifying the existing QR code or SIM profile.","parameters":[{"name":"iccid","in":"path","required":true,"schema":{"type":"string","example":"89852000000000000000"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["packageCode"],"properties":{"packageCode":{"type":"string","example":"US_TOPUP_1GB_7D"},"partnerRefId":{"type":"string","example":"topup_ref_67890"}}}}}},"responses":{"200":{"description":"Top-up applied successfully"}}}},"/api/b2b/v1/orders/{iccid}/usage":{"get":{"summary":"Check Real-Time Carrier Data Usage","description":"Fetches live carrier network telemetry for an active eSIM: consumed bytes, remaining data allowance, and profile status.","parameters":[{"name":"iccid","in":"path","required":true,"schema":{"type":"string","example":"89852000000000000000"}}],"responses":{"200":{"description":"Live usage report"}}}}}}