# contractorOps.payouts.prepare

Prepare a payout from approved hours for a pay period (periodId), or a milestone payout for a contractor (contractorId with hoursIds or amountMinor). Amounts use exact minor units: approved minutes × hourly rate, days × day rate, or fixed and monthly rules, plus GST/HST only at a rate finance confirmed (salesTaxStatus shows when the contractor's declared tax isn't confirmed yet). Hours can never be included in two active payouts.

`POST /api/v1/accounting/contractorOps.payouts.prepare`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required

MCP tool: `accounting_contractor_ops_payouts_prepare`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |
| `periodId` | string (ID) |  | The ID of a contractor pay period. |
| `contractorId` | string (ID) |  | The ID of a contractor, from contractors.list. |
| `hoursIds` | array of strings (ID) |  | A list of record IDs. at most 500 items. |
| `amountMinor` | string |  | An amount in cents (the currency's smallest unit), written as a whole-number string such as "1250" for $12.50. Matches ^\d{1,15}$. |
| `currency` | string |  | Three-letter currency code, such as CAD or USD. |
| `description` | string |  | A short description. at most 500 characters. |
| `includeEarlierUnpaid` | boolean |  | Also include earlier unpaid. Default `true`. |
| `applyTax` | boolean |  | Default `true`. |
| `submitForApproval` | boolean |  | Default `true`. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/contractorOps.payouts.prepare \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "periodId": "4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a"
}'
```

Reference page: https://app.getoatmilk.com/docs/api/contractorOps.payouts.prepare
