# Put a deal's merchant on the payment rail

Creates the merchant's identity at Finix, attaches the bank account the deal is serviced from, and provisions the merchant so it can be debited. Reach for it once per deal, before the first collection: a deal whose merchant is not provisioned cannot be collected from. The account number passes straight through to Finix and is never stored here, so what comes back is an opaque instrument id and the last four digits. Pressing it again after a refusal is the remedy - the ids already earned are kept and reused.

Access class: `workspace:admin`.

## Endpoint

`POST /v1/finix/onboard`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "accountName": "string",
    "accountNumber": "string",
    "accountType": "string",
    "annualRevenueMinor": 1,
    "businessName": "string",
    "dealId": 1,
    "doingBusinessAs": "string",
    "email": "string",
    "phone": "string",
    "routingNumber": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "accountLastFour": "string",
    "accountName": "string",
    "createdAt": "string",
    "dealId": 1,
    "id": 1,
    "identityId": "",
    "instrumentId": "",
    "lastError": "string",
    "merchantId": "",
    "onboardedBy": 1,
    "status": "string",
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
