Skip to content

API & agent onboarding

Use these APIs when your product or agent creates a Flint account itself, before anyone opens the Flint dashboard, or when you embed merchant onboarding in your own product. The work has two parts:

  • Signup. Three calls take an email address to a merchant, a user, and a sandbox-bound flint_test_... key.
  • Onboarding. Your backend reads the merchant's onboarding state, submits what it knows, and hands identity and business verification to the account owner in an embedded component you host. You repeat the same loop when the payment processor asks for more information later.

Identity, business verification, documents, payout details, processor authentication, and agreement acceptance always happen in the embedded component, in front of the account owner. Your backend never sends them to Flint.

A merchant you onboard pays Flint's processing fees directly. To take part of a merchant's payments, install a partner app and charge a platform fee.

If your product is a platform that creates a merchant for each of its customers, use a merchant signup instead of the three signup calls below. The owner types one emailed code into your form, Flint creates the merchant and installs your app, and your partner app token runs the onboarding loop in this guide. No sandbox key or live credential changes hands. Build payments into your platform follows the whole flow.

If you can use the dashboard, you don't need signup: create a test key on the API keys page and start with Accept your first payment. From a terminal, flint login signs in to an existing account and flint signup runs signup for you; see Sign in in the CLI guide.

Signup and onboardingResponse
Your backendFlintAccount ownerPOST /v1/onboarding/start with the owner's emailverification code by emailthe codePOST /v1/onboarding/verify-emailonboarding_session_tokenPOST /v1/api-keys with default_sandbox_idflint_test_... secret keyread state, then POST /v1/onboarding/advancePOST /v1/merchant-account-sessionsmount Account Onboardingcompletes verification in the componentread state until there's nothing left to do
  1. Your backend sends POST /v1/onboarding/start with the owner's email to Flint
  2. Flint sends verification code by email to Account owner
  3. Account owner sends the code to Your backend
  4. Your backend sends POST /v1/onboarding/verify-email to Flint
  5. Flint returns onboarding_session_token to Your backend
  6. Your backend sends POST /v1/api-keys with default_sandbox_id to Flint
  7. Flint returns flint_test_... secret key to Your backend
  8. Your backend sends read state, then POST /v1/onboarding/advance to Flint
  9. Your backend sends POST /v1/merchant-account-sessions to Flint
  10. Your backend sends mount Account Onboarding to Account owner
  11. Account owner sends completes verification in the component to Flint
  12. Your backend sends read state until there's nothing left to do to Flint
  • Emails a verification code and returns a verification token. No credential.

  • POST/v1/onboarding/verify-emailReference for POST /v1/onboarding/verify-email

    Checks the code, creates the user and merchant if needed, and returns an onboarding session token. No credential.

  • POST/v1/api-keysRequired API key scope: accounts.api_keys.writeReference for POST /v1/api-keys

    Creates an API key. With the onboarding session token and the default sandbox's sandbox_id, it issues the merchant's first sandbox key.

  • GET/v1/onboarding/stateRequired API key scopes: merchants.onboarding.read or merchants.onboarding.writeReference for GET /v1/onboarding/state

    Returns the onboarding status and the single next_step.

  • POST/v1/onboarding/advanceRequired API key scope: merchants.onboarding.writeReference for POST /v1/onboarding/advance

    Submits country, requested capabilities, and contact details, then returns the new state.

  • POST/v1/merchant-account-sessionsRequired API key scope: merchants.account_sessions.writeReference for POST /v1/merchant-account-sessions

    Creates the headless session the account owner completes.

  • POST/v1/merchant-account-session-refreshesRequired API key scope: merchants.account_sessions.writeReference for POST /v1/merchant-account-session-refreshes

    Exchanges a launch token for a new client secret while the component is open.

  • GET/v1/merchantRequired API key scopes: merchants.profile.read or merchants.profile.writeReference for GET /v1/merchant

    Returns readiness: whether the merchant can take payments and receive payouts, and what's still due.

All requests go to https://api.withflintpay.com, in test and live. The credential you send selects the environment.

Sign up#

Signup verifies the owner's email, so an agent can finish it only if it can read that mailbox or a person passes it the code. From a terminal, flint signup runs the same calls; an agent runs it in two steps, flint signup --email EMAIL --first-name FIRST --last-name LAST --credential-store file --no-input, then flint signup --verification-code CODE --credential-store file --no-input. The file store works on headless machines and saves the key with owner-only permissions. Omit --credential-store file to use your OS keychain. The CLI never prints the key.

  1. Start email verification#

    Send business_name to set the name buyers see at checkout, on receipts, and in gift card emails. Send timezone with an IANA name such as America/Chicago to set the new merchant’s business time zone for reports and business dates. Omit it to leave the time zone unset; blank, invalid, and null values are rejected. You can also send website_url, support_email, support_phone, and support_url. These optional fields apply only when verification creates a merchant. Existing merchants keep their profile; check the returned merchant after verification. To change a shared profile later, use the Dashboard or a live credential. Sandbox API keys cannot change it.

    cURL
    curl -X POST https://api.withflintpay.com/v1/onboarding/start \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: onboarding-start-jane-1" \
      -d '{
        "email": "jane@your-business.example",
        "first_name": "Jane",
        "last_name": "Doe",
        "business_name": "Jane’s Workshop",
        "timezone": "America/Chicago",
        "website_url": "https://your-business.example",
        "support_email": "help@your-business.example"
      }'
    
    JSON
    {
      "data": {
        "verification_token": "verification_token_example",
        "expires_at": "2026-10-28T14:15:00Z"
      },
      "request_id": "req_01KWM6Q886R25NJBMD1NX5J919"
    }
    

    Flint emails a short code to the address. Keep verification_token on your backend until verification succeeds. It expires 15 minutes after it's issued, at expires_at.

  2. Verify the code#

    cURL
    curl -X POST https://api.withflintpay.com/v1/onboarding/verify-email \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: onboarding-verify-jane-1" \
      -d '{
        "verification_token": "verification_token_example",
        "verification_code": "482193"
      }'
    
    JSON
    {
      "data": {
        "onboarding_session_token": "onboarding_session_token_example",
        "onboarding_session_expires_at": "2026-10-29T14:03:00Z",
        "default_sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
        "fresh_verification_expires_at": "2026-10-28T14:08:00Z",
        "merchant": {
          "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
          "email": "jane@your-business.example"
        },
        "user": {
          "user_id": "usr_01KEZF7C00NQEV558W0ESKV30S",
          "email": "jane@your-business.example",
          "first_name": "Jane",
          "last_name": "Doe"
        }
      },
      "request_id": "req_01KWM6R30BH1DHR2K266XJG4V2"
    }
    

    The response is shortened: merchant and user are the full Merchant and User objects.

    Flint creates the user, the merchant, the owner's membership, and the merchant's default sandbox when they don't exist yet. If the email already belongs to a Flint user and is already verified on their sign-in, verification signs that user in instead: the session acts for their merchant, and Flint keeps the name and email the account already has. Verification returns 409 ALREADY_EXISTS with reason dashboard_sign_in_required, and no session, in three cases:

    • The account has two-step verification turned on. The emailed code alone can't sign in to it, and the verification token is used up.
    • The address is unverified on the existing sign-in.
    • The email is linked to a different Flint sign-in.

    In each case, sign in to the Flint Dashboard, or run flint login, which signs in through the Dashboard. Only the two-step refusal uses up the verification token.

    The onboarding_session_token is a setup credential, not an API key. Keep it on your backend and send it as Authorization: Bearer. It:

    • Acts only in the merchant's default sandbox, default_sandbox_id, and never reaches the live account.
    • Lasts 24 hours, until onboarding_session_expires_at, and can't be refreshed. Verify the email again for a new one.
    • Works on the onboarding routes, creating and revoking unlinked API keys in any of the merchant's active sandboxes, merchant account sessions, GET /v1/merchant, and the sandbox management routes. It doesn't authenticate other routes, such as /v1/orders; use the sandbox key for those.
    • Counts as freshly verified until fresh_verification_expires_at, 5 minutes after verification. Only then can it create keys with full or read_only access, or with accounts.api_keys.write, accounts.workload_identities.write, commerce.gift_cards.secrets.write, or commerce.license_keys.secrets.write.

    Verification doesn't return a next step; read the onboarding state for that.

  3. Issue the first sandbox key#

    Right after verifying, before fresh_verification_expires_at, create a full-access key in the default sandbox with POST /v1/api-keys. Send the session token, access: "full", and default_sandbox_id as sandbox_id:

    cURL
    curl -X POST https://api.withflintpay.com/v1/api-keys \
      -H "Authorization: Bearer $ONBOARDING_SESSION_TOKEN" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: onboarding-first-key-jane-1" \
      -d '{
        "name": "Backend integration",
        "access": "full",
        "sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5"
      }'
    
    JSON
    {
      "data": {
        "api_key_id": "key_01KEZF7C007F5ZGD2ZXDWJGD76",
        "name": "Backend integration",
        "key_prefix": "flint_test_ca7f32e8",
        "secret_key": "flint_test_ca7f32e8_example",
        "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
        "sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
        "access": "full",
        "scopes": [
          "accounts.api_keys.read",
          "accounts.api_keys.write",
          "commerce.orders.read",
          "commerce.orders.write",
          "merchants.onboarding.read",
          "merchants.onboarding.write",
          "merchants.account_sessions.write"
        ],
        "status": "active",
        "created_at": "2026-10-28T14:03:30Z"
      },
      "request_id": "req_01KWM6H6ZD1H3AT5N6QNXVGH04"
    }
    

    The scopes list is abbreviated: a full-access key holds every scope test keys allow, including scopes Flint adds later. Store secret_key right away: Flint returns it only in this response. The key is bound to the default sandbox.

    Send access explicitly. Agents should request full for this sandbox key, so it can run the onboarding loop, take test payments, and create narrower keys later. name is required, as on every POST /v1/api-keys request, and expires_at is optional. An onboarding session must send sandbox_id: default_sandbox_id for this first key. It can also name another of the merchant's active sandboxes, such as one it created with POST /v1/sandboxes.

    Granting full, read_only, or scopes outside the low-risk read allowlist requires verification within the past five minutes. After fresh_verification_expires_at, those grants return 403 IDENTITY_VERIFICATION_REQUIRED. Verify your email again and use the new session, or create a restricted key with only allowlisted scopes. The same rule applies to keys issued with POST /v1/sandboxes.

    The onboarding session lasts 24 hours. After it expires, create keys on the Dashboard's API keys page or use a full-access key. See Issue a key for an existing sandbox.

The key works for ordinary sandbox development right away. Flint verifies the test account behind each sandbox itself, with test data, so the default sandbox can take test card payments shortly after the merchant is created. While automatic preparation is queued or running, readiness reports pending with status_reason: provisioning and empty next_actions on the affected axes and capabilities. Flint owns this work; read readiness again shortly. The verify-email response describes this same default sandbox. Until preparation finishes, readiness.payments.status on GET /v1/merchant is pending; Testing shows the check. Creating the key doesn't depend on onboarding either: you can create it while the merchant still has verification to complete.

The test key can read the shared merchant profile. It cannot change any field through PATCH /v1/merchant, including email, metadata, logo, or icon: those writes require a live-mode credential or a Dashboard session. For sandbox onboarding prefill, send profile to POST /v1/onboarding/advance; those values stay in the selected sandbox.

Before sharing a checkout URL, review the merchant’s business_name and set the name buyers should see. Use PATCH /v1/merchant with a live credential, or edit the business name in the Dashboard. Signup can suggest a name from a work email domain or use the person’s name for a shared mailbox.

Take a test payment#

Once you hold the key, check it with a payment. A full-access key holds commerce.orders.read and commerce.orders.write, so it can create an order, pay it with the pm_card_visa test token, and read it back, using curl alone. Pay from your server has the three requests. They run again in the same sandbox with new idempotency keys.

Verification codes and limits#

  • Each verification token allows five incorrect codes. A wrong code returns 400 INVALID_REQUEST with detail code INVALID_VALUE and param: "verification_code"; send the right code with the same token.
  • After the fifth incorrect code, every attempt with that token returns 409 LIMIT_REACHED with details[0].reason: "verification_attempts", even with the right code. Flint checks the token's state and attempt limit before it compares the code.
  • Correct codes never count against the limit, including a retry with merchant_id or a retry after a server error.
  • Success from POST /v1/onboarding/start means the verification email was accepted for asynchronous delivery; it does not confirm delivery. If the email has not arrived, wait briefly and check spam. To get a new token and code, start again with a new Idempotency-Key, respecting any Retry-After delay. Use only the newest token and code. A replay with the same key returns the original response and does not resend the email.
  • After 20 incorrect codes for one email within an hour, start and verify both return 429 RATE_LIMIT_EXCEEDED for that email. Wait for the Retry-After delay.

Start, verify, and key issuance also have tight per-IP and per-email throttles; see setup and onboarding throttles. Run signup once per merchant and store the key. A pipeline that signs up on every run hits these throttles.

Signup errors#

  • HTTP 400
    With param: "verification_code", the code is wrong. With param: "verification_token", the token is unknown, expired, or already used; start verification again. With detail code REQUIRED at merchant_id, the email's user belongs to several merchants and none is their default: retry verify with the same token and code, a new Idempotency-Key, and a merchant_id from details[0].selectable_resources. With INVALID_VALUE at merchant_id, that merchant isn't available to this user; choose one from selectable_resources
  • HTTP 409
    Reason verification_attempts: the token had five incorrect codes. Call POST /v1/onboarding/start with a new Idempotency-Key for a new code
  • HTTP 409
    From verify with reason dashboard_sign_in_required: the email belongs to an account with two-step verification, the email is unverified on an existing sign-in, or the email is linked to a different Flint sign-in identity. Sign in to the Flint Dashboard, or run flint login
  • HTTP 403
    From POST /v1/api-keys: the session is past fresh_verification_expires_at and the key would have full or read_only access or a step-up scope. Verify the email again, or create a restricted key without those scopes
  • HTTP 404
    From POST /v1/api-keys: sandbox_id names no active sandbox of the merchant. Send default_sandbox_id from verify-email
  • HTTP 401
    The onboarding session token is invalid or expired. Verify the email again for a new session
  • HTTP 429
    RATE_LIMIT_EXCEEDEDRetry the same request
    A setup throttle or the hourly incorrect-code limit was reached. The response carries Retry-After and Flint-Rate-Limited-Reason: setup_flow
  • HTTP 503
    SERVICE_UNAVAILABLERetry the same request
    Retry after a short delay
  • HTTP 500
    INTERNAL_ERRORRetry the same request
    Retry with backoff. If it persists, contact Flint support with the request_id

Onboard the merchant#

Onboarding is a state machine. Your backend reads the state, does what next_step says, and reads the state again, until status is complete. The same loop runs for every environment, and the credential decides which account it reaches. No onboarding or account-session request takes a sandbox_id.

CredentialReaches
Onboarding session tokenThe merchant's default sandbox. Never the live account.
Sandbox key (flint_test_...)Its own sandbox. Never the live account.
Live key (flint_live_...)The live account.
Live CLI login (flint login --live)The live account.

API keys and CLI logins need merchants.onboarding.read or merchants.onboarding.write to read state, merchants.onboarding.write to advance, and merchants.account_sessions.write to create and refresh account sessions. To work in a sandbox other than the default, send a key for that sandbox. Which environment a credential reaches covers every credential type.

The live account is where the owner completes real verification; see Onboard the live account. Flint verifies the default sandbox's test account itself, so it has little or nothing for the owner to complete. To build and test your embedded UI against requirements that are due, create a sandbox with initial_onboarding: "not_started" and run this loop with a key for it. When Account Onboarding asks for details there, enter the sandbox verification values.

Read the state#

cURL
curl https://api.withflintpay.com/v1/onboarding/state \
  -H "Authorization: Bearer $ONBOARDING_SESSION_TOKEN"
JSON
{
  "data": {
    "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
    "default_sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
    "status": "needs_input",
    "country": "US",
    "next_step": {
      "action_type": "advance_onboarding",
      "owner": "integrator"
    },
    "profile": {
      "email": "jane@your-business.example"
    }
  },
  "request_id": "req_01KWM6FP8GGHAF5CSF8XWYHEDH"
}

status summarizes the workflow. Flint checks the values in this order, so a pending review is never hidden behind another step:

status on onboarding state
  • complete
    Nothing is left to do. It doesn't depend on whether the merchant has an API key. Payment and payout readiness can still change later; see Handle later requirements.
  • waiting_for_review
    Flint or the payment processor is reviewing what the owner submitted. Read the state again later. Don't create another account session.
  • needs_external_action
    The owner must complete a step in the embedded component. next_step is create_merchant_account_session.
  • needs_input
    Your backend has a call to make, such as advancing onboarding.

next_step is the single next action, as a readiness action with action_type, owner, and, when they apply, required_fields and merchant_account_session. It's absent when there's nothing to do. Act on action_type:

action_typeWhat to do
advance_onboardingSubmit account intent to POST /v1/onboarding/advance, including any fields named in required_fields.
create_merchant_account_sessionSend merchant_account_session as the body of POST /v1/merchant-account-sessions and hand the step to the owner.
wait_for_reviewRead the state again later.
other, or a value you don't recognizeNew action types can appear. Read the state again later, and show the merchant a generic "setup in progress" message meanwhile.

owner says who acts: integrator for a call your backend makes, or flint while Flint or the payment processor reviews. A step the account holder completes in the embedded component, create_merchant_account_session, is integrator, because your backend creates the session.

Onboarding state describes setup. Whether the merchant can take payments and receive payouts right now is in readiness on GET /v1/merchant, which the onboarding session token can read too.

Submit account intent#

When next_step.action_type is advance_onboarding, send the fields listed in required_fields. You can also send the capabilities and contact details you want Flint to use.

cURL
curl -X POST https://api.withflintpay.com/v1/onboarding/advance \
  -H "Authorization: Bearer $ONBOARDING_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: onboarding-advance-jane-1" \
  -d '{
    "country": "US",
    "requested_capabilities": [
      "accept_card_payments",
      "receive_payouts"
    ],
    "profile": {
      "website_url": "https://your-business.example",
      "support_email": "help@your-business.example",
      "support_phone": "+12125550123"
    }
  }'
JSON
{
  "data": {
    "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
    "default_sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
    "status": "needs_external_action",
    "next_step": {
      "action_type": "create_merchant_account_session",
      "owner": "integrator",
      "merchant_account_session": {
        "components": ["account_onboarding"],
        "collection_strategy": "incremental",
        "future_requirements": "omit"
      }
    },
    "country": "US",
    "requested_capabilities": [
      "accept_card_payments",
      "receive_payouts"
    ],
    "profile": {
      "email": "jane@your-business.example",
      "website_url": "https://your-business.example",
      "support_email": "help@your-business.example",
      "support_phone": "+12125550123"
    }
  },
  "request_id": "req_01KWM6JDM9XGSQZEBG71A0DVYX"
}

The response is the new onboarding state, so you can act on its next_step without another read.

  • country is the business's country as an uppercase ISO 3166-1 alpha-2 code. Onboarding supports US. Send country when required_fields lists it. If the state already includes country, Flint can use that value when you omit it.
  • requested_capabilities is the exact capability set. It must include accept_card_payments and receive_payouts, and can add accept_ach_debit_payments for ACH debit. Omit the field for cards and payouts.
  • profile takes website_url, support_email, support_phone, support_url, and email. required_fields lists paths in the action’s target request body: profile.website_url, profile.support_email, profile.support_phone, and profile.support_url. Send these fields inside profile; top-level inputs such as country, requested_capabilities, and the API key’s name stay bare. Send null to clear a field. Use the business's real, publicly reachable website: the payment processor reviews it, so reserved example domains such as your-business.example don't pass.

Country and capabilities are fixed once account setup starts. Sending the same values again is safe. Different values return 409 ACTION_NOT_ALLOWED with reason field_locked, and Flint never creates a replacement account.

If advance fails with a network error, a timeout, or a 5xx, send the same request with the same Idempotency-Key. Flint resumes the account setup that request started, so a retry finishes it or creates the account once, never twice. Keep the same merchant and onboarding session.

Don't send legal entity details, identity fields, documents, bank details, processor tokens, or agreement acceptance to advance. Those belong in the embedded component, and advance rejects unknown fields.

Hand verification to the account owner#

When next_step.action_type is create_merchant_account_session, send its merchant_account_session exactly as the request body. Create the session only from your backend, after you have authenticated the person in your product and confirmed they're allowed to manage this merchant:

cURL
curl -X POST https://api.withflintpay.com/v1/merchant-account-sessions \
  -H "Authorization: Bearer $ONBOARDING_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: account-session-jane-1" \
  -d '{
    "components": ["account_onboarding"],
    "collection_strategy": "incremental",
    "future_requirements": "omit"
  }'
JSON
{
  "data": {
    "components": ["account_onboarding"],
    "effective_policy": {
      "collection_strategy": "incremental",
      "future_requirements": "omit",
      "targeting": "all"
    },
    "launch_token": "aslaunch_v1.example",
    "launch_token_expires_at": "2026-10-28T14:35:00Z",
    "client_session": {
      "expires_at": "2026-10-28T14:05:00Z",
      "stripe": {
        "publishable_key": "pk_test_example",
        "account_session": {
          "stripe_js_call": "load_connect_and_initialize",
          "client_secret": "acct_session_secret_example"
        },
        "components": [
          {
            "component": "account_onboarding",
            "collection_options": {
              "fields": "currently_due",
              "future_requirements": "omit"
            }
          }
        ]
      }
    }
  },
  "request_id": "req_01KWM6K7MY5GPZG3NAT0FV4QZF"
}

The session opens in the environment of the credential you send. Return the client secret only to the authenticated person's browser. Never expose a Flint key, accept a merchant ID from the browser as authorization, or put the client secret or launch_token in a link.

In the browser, call Connect.js loadConnectAndInitialize with publishableKey from client_session.stripe.publishable_key and a fetchClientSecret callback that returns client_session.stripe.account_session.client_secret. Mount each entry in client_session.stripe.components, and pass its collection_options to setCollectionOptions unchanged, mapping future_requirements to futureRequirements.

When the client secret expires while the component is open, Connect.js calls fetchClientSecret again. Your browser asks your backend, and your backend sends the newest launch_token to POST /v1/merchant-account-session-refreshes with a new Idempotency-Key. Refresh with the credential that created the launch token; for an onboarding session, that's a session for the same user. After the launch token expires, authorize the person again and create a new session.

If your product doesn't embed Connect.js, send the owner to onboarding that Flint hosts. POST /v1/onboarding/access-links takes the same credentials as a session, plus a required return_url, and returns a url to redirect the owner to. The link opens once, within 5 minutes, into a browser session of up to an hour. Flint's page shows the business name, opens Account Onboarding and Notification Banner in the credential's mode, and offers one action when the owner exits or finishes: back to return_url. The url is a bearer credential, so create it only for a person you just authenticated, redirect them at once, and never email or log it. Onboarding access links has the request, the return_url rules, and the errors. After the owner returns, read the state again, as after an embedded session.

Merchant Account Sessions has the full Connect.js recipes for vanilla JavaScript and React, refresh and retry rules, Content Security Policy and popup requirements, and other components. A partner app install with merchants.account_sessions.write can create and refresh sessions too: in test mode, and in live mode once Flint approves the app as a platform. See Onboard an installed merchant.

After the owner exits#

The component's onExit callback means only that the owner left Account Onboarding. It doesn't mean they submitted everything or that the merchant is ready. Read the state right away, then again after 2, 4, 8, and 15 seconds, and then every 30 seconds for up to 15 minutes.

  • While status is waiting_for_review, keep waiting. Review is asynchronous, so don't create another session.
  • When next_step asks for an action, do it: another advance_onboarding, or a new create_merchant_account_session if the owner left before finishing.
  • Stop when status is complete, or when a request returns an error that remediation.retry says not to retry.

Subscribe to merchant.readiness_updated to hear about changes after you stop polling. Deliveries can repeat, and the payload is the merchant at the time of the event, so treat the event as a prompt to read GET /v1/merchant and the onboarding state again.

Onboarding errors#

  • HTTP 400
    From advance, param names the field. country is malformed or isn't supported (INVALID_VALUE), or no country is known yet (REQUIRED). requested_capabilities is empty or has accept_card_payments without receive_payouts (REQUIRED), asks for a set Flint doesn't support, such as receive_payouts alone (NOT_ALLOWED), or includes an unknown value. An unknown field, such as a document or bank detail, returns UNKNOWN_FIELD
  • HTTP 409
    Reason field_locked: account setup already started with a different country or requested_capabilities. Send the values that state already shows. Reason platform_onboarding_required, platform_pending_review, platform_rejected, or platform_capability_inactive: a partner app token tried to advance live onboarding or open a live account session while its app's merchant_onboarding platform capability isn't active. Become an approved platform says what each reason needs. Until then, have the merchant finish live onboarding with its own live key or CLI login
  • HTTP 403
    Reason direct_owner_required: account setup must continue under the merchant's direct owner who started it. Have that owner continue with their own onboarding session or login, or, for a partner app install, have the owner authorize the install again
  • HTTP 409
    Reason account_setup_repair_required or account_setup_unavailable: account setup can't continue. Contact Flint support before retrying. Retrying advance doesn't clear it
  • HTTP 403
    The API key, CLI login, or partner app token lacks the onboarding or account-session scope the route needs
  • HTTP 502
    EXTERNAL_SERVICE_ERRORRetry the same request
    The payment processor failed. Retry the same request with the same Idempotency-Key
  • HTTP 503
    SERVICE_UNAVAILABLERetry the same request
    Reason repair_required, error_source flint, and remediation.retry none: onboarding isn't configured on this Flint environment. Contact Flint support with the request_id; retrying doesn't clear it. Without that reason, onboarding is temporarily unavailable and the same request can be sent again with the same Idempotency-Key

Onboard the live account#

Live onboarding needs a live credential approved by a person who manages the merchant's API keys or partner apps. The business doesn't need to be verified first: this loop is how the credential drives verification. Use one of:

  • A live CLI login. Run flint login --live, or flint login --live --no-wait from an agent, and have that person approve live access in the browser. Add any onboarding or account-session scope the login lacks with --scope, for example --scope merchants.onboarding.write --scope merchants.account_sessions.write. Then flint onboarding state get and flint onboarding advance --input request.json reach the live account. A login lasts at most 90 days and can be revoked, and there's no key to store. See Sign in in the CLI guide.
  • A live key for a backend, with the onboarding and account-session scopes above. Create it on the dashboard's API keys page, or with flint api-keys create from a live CLI login that holds accounts.api_keys.write.
  • A live partner app install, only while the app's merchant_onboarding platform capability is active. Until then, a partner app token runs onboarding in test mode and reads it in live mode, and a merchant that installed the app itself uses one of the credentials above. A merchant the app created with a merchant signup uses this one: the signup gives the platform no live key or login. See Onboard an installed merchant.

Send the same state, advance, and account-session requests with the live credential. The onboarding session token and sandbox keys can't reach the live account.

A live key can take live card payments as soon as the processor turns them on, when accept_card_payments is ready in readiness.capabilities. Payouts can turn on later, once the processor confirms the bank account. Going live covers the rest of launch.

Handle later requirements#

The payment processor can ask for more information after onboarding, for example when volume grows or a detail needs updating. The same loop handles it. After merchant.readiness_updated, read GET /v1/merchant:

  • readiness.requirements lists what's due, as Flint requirement codes such as business_website. New codes can appear; treat a code you don't recognize as additional_account_information.
  • A create_merchant_account_session action in readiness.payments.next_actions or readiness.payouts.next_actions carries the session body to send.
  • readiness.requirements.upcoming_due lists what the payment processor starts requiring on upcoming_due_at. Nothing is affected before that date, so warn the account owner and let them submit early: send the recommended session body, which sets future_requirements to include while upcoming_due isn't empty.

Use a live credential for the live account; a sandbox key rehearses the same flow in its sandbox. When the action's merchant_account_session includes targeted_requirements, copy them exactly, so the component asks only for those:

cURL
curl -X POST https://api.withflintpay.com/v1/merchant-account-sessions \
  -H "Authorization: Bearer $FLINT_LIVE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: remediation-business-website-1" \
  -d '{
    "components": ["account_onboarding"],
    "collection_strategy": "incremental",
    "future_requirements": "omit",
    "targeted_requirements": ["business_website"]
  }'

An unknown code in targeted_requirements returns 400 INVALID_REQUEST with an INVALID_VALUE detail at the array item, such as targeted_requirements[0]. A published code Flint can't map safely returns 400 INVALID_REQUEST with an INVALID_VALUE detail on targeted_requirements and one detail per unmappable item. Neither returns a client secret. Don't catch the error and retry with untargeted collection; read readiness again and present the action it returns.

Account session responses don't include a requirements snapshot. After the owner exits, read GET /v1/merchant for the current readiness.requirements and next actions.

Emails the payment processor sends about compliance, risk, payouts, payments, the account, or documents link to Flint's own sign-in, not to your product, so the account owner keeps a Flint login even when the rest of your integration is headless. Don't intercept or rewrite those links. See Headless applications and provider emails.

For a merchant your app created with a merchant signup, some of these lead to your app instead: Flint's emails about finishing verification and the processor's notification link go to your merchant_action_url. The rest still need the owner's Flint login. Emails that lead to your app lists both.

Checklist for agents#

  1. Start signup with the owner's email, and get the code from the owner or the mailbox.
  2. Verify the code and keep the onboarding session token on your backend.
  3. Before fresh_verification_expires_at, create a full-access sandbox key with POST /v1/api-keys, sending default_sandbox_id as sandbox_id, and store it. Don't wait for verification.
  4. Use the sandbox key for ordinary /v1/... work in its sandbox, starting with a test payment.
  5. Read the onboarding state. For advance_onboarding, submit the inputs in required_fields.
  6. For create_merchant_account_session, hand the embedded step to the authenticated account owner, then poll the state after they exit. Wait while review is pending.
  7. For the live account, get a live CLI login or live key and run the same loop with it.
  8. After launch, act on merchant.readiness_updated by reading GET /v1/merchant and following its next actions.

Next steps#

Merchant Account SessionsConnect.js recipes, refresh and retries, components, and sandbox verification values.Going liveReadiness, live keys, and what to check before the first live payment.Sandboxes & test modeCreate more sandboxes and issue keys for them.

Was this helpful?