10FI pilot merchant API examples pack

Copy-paste examples for 1–2 soft-launch / pilot B2B merchants.

Base URL: https://api.10fi.org

Credentials in this pack are placeholders only. Never commit real keys.

Start here (5 minutes)

FIVE-MINUTE-INTEGRATION.md

→ TypeScript: typescript/five-minute-integration.ts

→ Env template: .env.example

Environment variables (placeholders)

| Variable | Example value | Purpose |

|----------|---------------|---------|

| TENFI_BASE_URL | https://api.10fi.org | API origin |

| TENFI_CLIENT_ID | demo_client_id | X-Client-Id |

| TENFI_API_KEY | demo_api_key | X-API-Key (secret) |

| TENFI_WALLET_ADDRESS | 0x1111111111111111111111111111111111111111 | Example EVM wallet |

# Copy locally — do not commit real secrets
cp docs/examples/pilot-merchant/.env.example .env
# then edit TENFI_* values

Other placeholders used in docs:

| Field | Value |

|-------|--------|

| Tron wallet | TDemoTronAddressForExamples1111111 |

| Solana wallet | DemoSo1anaWallet1111111111111111111111111 |

Product notes (must read)

1. Swap API is not always gasless. Standard same-chain routes may require the user to pay network gas. Always set preferGasless: false / gasless=false when integrating Swap API unless you specifically want gasless. Do not market Swap API as "gasless" to your users.

2. Gasless API is a separate product and currently mock/shadow unless 10FI explicitly enables it (executable: false, no broadcast by default). Do not build your product UX assuming gasless is available — treat it as a future enhancement.

3. Cross-chain API requires cross_chain_api entitlement when toChain differs from chain, and for /v1/transfer-status. This is the same key as Swap API — not a separate credential.

4. HTTP 403 means product not enabled (or merchant not approved). Missing headers are 401, not 403. Contact 10FI to enable swap_api / gasless_api / cross_chain_api on your existing key.

5. One key, multiple products. A single X-Client-Id/X-API-Key pair can have all three products enabled. You never need a second key for a different product.

| Product | Entitlement | Coverage |

|---------|-------------|----------|

| Swap API | swap_api | Same-chain /v1/quote, /v1/swap |

| Gasless API | gasless_api | /v1/gasless/*, legacy /v1/submit + /v1/status/:orderId |

| Cross-chain API | cross_chain_api | toChain on quote/swap + /v1/transfer-status |

One merchant API key can enable one or more products. Cross-chain is not a separate key type.

Own-router

Own-router stays shadow-only for pilots. Live merchant quotes may use external routing with neutral labels only. Do not enable own-router execution as part of pilot integration.

How to use

1. Read product notes above.

2. Run the 5-minute flow (markdown + TypeScript).

3. Expand with curl-examples.md (TRON→BSC, gasless shadow, etc.).

4. Use typescript/tenfi-pilot-client.ts as a minimal client (TenFiPilotClient.fromEnv()).

5. Import 10fi.postman_collection.json; set baseUrl, clientId, apiKey, walletAddress.

6. Prefer sandbox (/v1/sandbox/*) for dry-run; never broadcast sandbox txs.

Files

| File | Contents |

|------|----------|

| FIVE-MINUTE-INTEGRATION.md | Short health → quote → swap → cross-chain → status → errors |

| typescript/five-minute-integration.ts | Runnable 5-minute script |

| .env.example | TENFI_* placeholders |

| curl-examples.md | Full cURL pack |

| typescript/tenfi-pilot-client.ts | Client + error mapping |

| typescript/examples.ts | Extra samples including gasless shadow |

| 10fi.postman_collection.json | Postman collection |

Related docs

Safety