End-to-End API Flow

This guide maps the full Connect integration path in API call order. Use it when wiring a marketplace that acts on behalf of sub-merchants via X-On-Behalf-Of.

Sandbox: Inflow provides a sandbox environment (https://sandbox.api.inflowpay.com) for integration testing. Ask your Inflow contact to enable Connect on both your sandbox and production marketplace accounts.

Flow overview

┌─────────────────────────────────────────────────────────────────────────┐
│  MARKETPLACE (your API key — no X-On-Behalf-Of)                         │
├─────────────────────────────────────────────────────────────────────────┤
│  1. GET  /api/connect/status                                            │
│  2. GET  /api/connect/settings                                          │
│  3. POST /api/connect/accounts                    → create sub-merchant   │
│  4. GET  /api/connect/accounts/:subMerchantId/kyc/status  → drive KYC    │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                     kycReady = true │  (wallet provisioned)
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│  ON BEHALF OF SUB-MERCHANT (X-On-Behalf-Of: <subMerchantId>)            │
├─────────────────────────────────────────────────────────────────────────┤
│  5. POST /api/checkout/payment                  → collect payin           │
│  6. GET  /api/balance                           → check available funds   │
│  7. GET  /api/account/countries                 → supported countries   │
│  8. GET  /api/account/bank-form                 → dynamic form schema   │
│  9. POST /api/account/bank                      → register bank dest.    │
│     — or POST /api/account/wallet               → register wallet dest. │
│ 10. GET  /api/quote/:accountId                  → preview fees          │
│ 11. POST /api/payout                            → initiate withdrawal    │
└─────────────────────────────────────────────────────────────────────────┘
StepsPhaseX-On-Behalf-OfRead next
1–2Marketplace setupNoGetting Started · Marketplace Settings
3–4Sub-merchant onboardingNoSub-merchant Onboarding · KYC Flow
kycReady = trueSub-merchant is operable
5–6PayinYesActing on Behalf Of · Fees and Payouts
7–9Register payout destinationSteps 7–8: No · Step 9: YesBank path or wallet path below
10–11PayoutYesActing on Behalf Of

Every call from step 5 onward must include:

X-Inflow-Api-Key: <marketplace_api_key>
X-On-Behalf-Of: <subMerchantId>

Connect management routes (/api/connect/*) never take X-On-Behalf-Of.


Phase 1 — Marketplace setup

Getting Started · Marketplace Settings

Step 1 — Verify Connect access

curl https://api.inflowpay.xyz/api/connect/status \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY"

Expected: { "ok": true, "marketplaceUserId": "usr_…" }

Step 2 — Read marketplace settings

curl https://api.inflowpay.xyz/api/connect/settings \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY"

Review fee rates, payout window, and enabled currencies before going live.


Phase 2 — Sub-merchant onboarding

Sub-merchant Onboarding · KYC Flow

Step 3 — Create a sub-merchant

curl -X POST https://api.inflowpay.xyz/api/connect/accounts \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "merchantName": "Acme Coffee",
    "customerType": "business",
    "redirectUrlKyc": "https://marketplace.example.com/onboarding/done"
  }'

Save the returned id as $SUB. The response includes kycStatus, nextUrl, and nextSteps for the initial bootstrap.

FieldValuesEffect
customerType"individual" | "business""individual" → KYC, "business" → KYB

Step 4 — Drive KYC to completion

If nextUrl is present, redirect the sub-merchant there. Then poll:

curl "https://api.inflowpay.xyz/api/connect/accounts/$SUB/kyc/status" \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY"

Proceed to Phase 3 when kycReady is true and walletId is set.


Phase 3 — Payin on behalf of sub-merchant

Acting on Behalf Of · Fees and Payouts

Step 5 — Create a checkout payment

curl -X POST https://api.inflowpay.xyz/api/checkout/payment \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY" \
  -H "X-On-Behalf-Of: $SUB" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "EUR",
    "successUrl": "https://shop.example.com/success",
    "cancelUrl":  "https://shop.example.com/cancel",
    "products": [
      { "name": "Order #1234", "price": 10000, "quantity": 1 }
    ]
  }'

Redirect the buyer to purchaseUrl. On success, Inflow credits the sub-merchant balance (net of fees) and routes your marketplace fee.

Step 6 — Check available balance

curl https://api.inflowpay.xyz/api/balance \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY" \
  -H "X-On-Behalf-Of: $SUB"

Withdrawable amount may be lower than the total balance while payins are still inside the payout window.


Phase 4 — Register a payout destination

Before calling POST /api/payout, the sub-merchant needs a registered destination. Choose bank payout or wallet payout — most integrations use bank payout.

Bank payout

Step 7 — List supported countries

curl https://api.inflowpay.xyz/api/account/countries \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY"

Returns which countries support INDIVIDUAL and/or BUSINESS bank payouts.

Step 8 — Fetch the dynamic form schema

Required fields vary by country. Always call this before POST /api/account/bank:

curl "https://api.inflowpay.xyz/api/account/bank-form?country=FR&type=BUSINESS" \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY"
Query paramDescription
countryISO-3166 alpha-2 code (e.g. FR, DE, GB)
typeINDIVIDUAL or BUSINESS

The response is an array of form blocks (bank, owner, address, …), each with typed fields and JSON Schema validation rules. Render these fields in your UI, then submit the collected values to step 9.

Step 9 — Register the bank account

curl -X POST https://api.inflowpay.xyz/api/account/bank \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY" \
  -H "X-On-Behalf-Of: $SUB" \
  -H "Content-Type: application/json" \
  -d '{ … fields from bank-form … }'

Save the returned account id as $ACCOUNT_ID.

Wallet payout

Skip steps 7–8 and register a crypto wallet directly:

curl -X POST https://api.inflowpay.xyz/api/account/wallet \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY" \
  -H "X-On-Behalf-Of: $SUB" \
  -H "Content-Type: application/json" \
  -d '{ "address": "0x…" }'

The network is inferred from the wallet address. Save the returned id as $ACCOUNT_ID.


Phase 5 — Payout

Acting on Behalf Of

Step 10 — Get a quote (optional but recommended)

curl "https://api.inflowpay.xyz/api/quote/$ACCOUNT_ID?amount=50000&currency=USDC" \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY" \
  -H "X-On-Behalf-Of: $SUB"

Returns the net amount after fees and a fee breakdown. amount is in cents.

Step 11 — Initiate the payout

curl -X POST https://api.inflowpay.xyz/api/payout \
  -H "X-Inflow-Api-Key: $INFLOW_API_KEY" \
  -H "X-On-Behalf-Of: $SUB" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId":     "'"$ACCOUNT_ID"'",
    "amountInCents": 50000,
    "currency":      "USDC",
    "network":       "base"
  }'
FieldNotes
accountIdBank or wallet destination registered in step 9
amountInCentsWithdrawal amount in cents
currencyUSDC or EURC
networkRequired for wallet destinations only (base, polygon, ethereum, solana, arbitrum, avalanche)

Quick reference

StepMethodRouteX-On-Behalf-Of
1GET/api/connect/statusNo
2GET/api/connect/settingsNo
3POST/api/connect/accountsNo
4GET/api/connect/accounts/:id/kyc/statusNo
5POST/api/checkout/paymentYes
6GET/api/balanceYes
7GET/api/account/countriesNo*
8GET/api/account/bank-formNo*
9POST/api/account/bank or /account/walletYes
10GET/api/quote/:accountIdYes
11POST/api/payoutYes

*Steps 7–8 are reference lookups and do not require X-On-Behalf-Of. Steps 9–11 register and pay out on behalf of the sub-merchant and do require it.