# Start submerchant onboarding

Returns the next onboarding step for the submerchant. For `redirect_user` a new SimPay onboarding link is generated.

Endpoint: POST /flow/{flowServiceId}/submerchants/{submerchantId}/onboardings
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer scopes: flow.submerchants.onboardings

## Path parameters:

  - `flowServiceId` (string, required)
    Flow service ID

  - `submerchantId` (string, required)
    Submerchant ID (`flsm_...`) or its `customId`

## Response 200 fields (application/json):

  - `success` (boolean, required)
    Request status

  - `data` (object, required)

  - `data.action` (string, required)
    - `redirect_user`
 - redirect the user to
`redirectUrl`
 (onboarding handled by SimPay),
- `provide_api`
 - onboarding performed by the Flow service via the API.
    Enum: "redirect_user", "provide_api"

  - `data.redirectUrl` (string)
    Onboarding URL (only for `redirect_user`)
    Example: https://panel.simpay.pl/onboarding/flow/...

## Response 400:

  - `400` (unknown)
    Submerchant is already active (`SUBMERCHANT_ALREADY_ACTIVE`)

## Response 400 fields (application/json):

  - `success` (boolean, required)
    Request status

  - `message` (string)
    Error description

  - `errorCode` (string, required)
    Error code

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `feedbackUrl` (string)
    URL for reporting API problems (`POST /feedback`). Returned for authenticated API keys.
    Example: https://api.simpay.pl/feedback

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "UNAUTHORIZED"

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `feedbackUrl` (string)
    URL for reporting API problems (`POST /feedback`). Returned for authenticated API keys.
    Example: https://api.simpay.pl/feedback

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "INVALID_ABILITY_PROVIDED", "IP_ADDRESS_NOT_WHITELISTED"

## Response 404:

  - `404` (unknown)
    Submerchant not found (`FLOW_SUBMERCHANT_NOT_FOUND`)

## Response 404 fields (application/json):

  - `success` (boolean, required)
    Request status

  - `message` (string)
    Error description

  - `errorCode` (string, required)
    Error code

