# Create an outbound payment

Operation ID: `createOutboundPayment`

Group: Accounting › Outbound Payments

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/endpoints/createOutboundPayment)

`POST /accounting/outbound-payments`

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Creates an outbound payment. The payment pays vendor bills or expense reports. No money is sent, and the payment starts in status 'manuallyRecorded'.

Each payment item pays one document. documentType sets the kind of document, and every item in the payment pays that kind. Every document must be approved and not voided, every item on an expense report must be reimbursable, all documents must be in one currency, and no payment item can pay more than its document's open amount.

The response contains only the new payment's id. To see the payment, use GET accounting/outbound-payments/:id.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |
| `Idempotency-Key` | header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with `400 IDEMPOTENCY_NOT_SUPPORTED` rather than silently ignored. |

## Request body

Required, `application/json`: createOutboundPaymentInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | string | yes | The bank or cash account the payment is made from. See id on GET accounting/accounts/:id. Example: `"6d1e4b27-8a90-4c31-b5f2-7e8a9c0d1b23"`. |
| `entityId` | string | yes | The legal entity the payment is posted under. See id on GET base/entities. Example: `"8f2c1d40-5a6b-4c7d-9e80-1f2a3b4c5d6e"`. |
| `paymentDate` | date | yes | The date the payment is made. Use format YYYY-MM-DD. Example: `"2026-08-27"`. |
| `paymentCurrency` | string | yes | The currency of the payment. Format ISO 4217, for example 'USD'. Governs each item's amount unless the item names its own currency. Example: `"USD"`. |
| `documentType` | string | yes | The one kind of document every item pays, either 'VendorBillHeaderBase' or 'ExpenseReportBase'. A payment pays one kind, not a mixture. Example: `"VendorBillHeaderBase"`. |
| `singlePayment` | boolean | no | Whether this is a single payment rather than a batch. |
| `commonDescription` | string | no | A description applied to the payment as a whole. |
| `skipJournalEntry` | boolean | no | Whether to skip journal-entry creation for this payment. Defaults to false. |
| `externalUrl` | string | no | A link back to the payment in the upstream system. |
| `origin` | string | no | The source system this payment came from. |
| `senderAccountId` | string | no | A bank account identifier for the sender, supplied by an integration. It is free-form text, not a reference to an account record. |
| `actualExchangeRate` | decimal | no | The exchange rate the bank actually applied, as a decimal. |
| `systemExchangeRate` | decimal | no | The exchange rate the system derived, as a decimal. |
| `paymentItems` | array<object> | yes | The documents this payment settles. At least one is required. Example: `[{"documentId":"c41d0b58-2e97-4f6a-8d13-7b5e9c204af6","entityId":"8f2c1d40-5a6b-4c7d-9e80-1f2a3b4c5d6e","amount":"1200.00","description":"Invoice 5512"}]`. |
| `paymentItems[].documentId` | string | yes | The vendor bill or expense report being paid, of the kind named by documentType. See id on GET accounting/vendor-bills/:id or GET accounting/expense-reports/:id. |
| `paymentItems[].entityId` | string | yes | The legal entity the document is posted under. See id on GET base/entities. |
| `paymentItems[].amount` | decimal | yes | The amount applied to this document, as a decimal. |
| `paymentItems[].currency` | string | no | The currency for this item. Format ISO 4217, for example 'USD'. Omit to use the payment's currency. |
| `paymentItems[].description` | string | yes | What this item pays for. Required. |
| `attachments` | array<object> | no | Files to attach to the payment. Each names an already-uploaded file by its id. |
| `attachments[].fileName` | string | yes | The display name of the attached file. |
| `attachments[].fileId` | string | yes | The identifier of the already-uploaded file. There is no endpoint for it. |

```json
{
  "accountId": "6d1e4b27-8a90-4c31-b5f2-7e8a9c0d1b23",
  "entityId": "8f2c1d40-5a6b-4c7d-9e80-1f2a3b4c5d6e",
  "paymentDate": "2026-08-27",
  "paymentCurrency": "USD",
  "documentType": "VendorBillHeaderBase",
  "singlePayment": true,
  "commonDescription": "<commonDescription>",
  "skipJournalEntry": true,
  "externalUrl": "<externalUrl>",
  "origin": "<origin>",
  "senderAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "actualExchangeRate": "19.99",
  "systemExchangeRate": "19.99",
  "paymentItems": [
    {
      "documentId": "c41d0b58-2e97-4f6a-8d13-7b5e9c204af6",
      "entityId": "8f2c1d40-5a6b-4c7d-9e80-1f2a3b4c5d6e",
      "amount": "1200.00",
      "description": "Invoice 5512"
    }
  ],
  "attachments": [
    {
      "fileName": "<fileName>",
      "fileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    }
  ]
}
```

## Response

`200` Success

Under `data` (createOutboundPaymentOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the created payment. Example: `"e93b7d15-2c48-4a60-9f31-5b7c8d9e0a12"`. |

```json
{
  "data": {
    "id": "e93b7d15-2c48-4a60-9f31-5b7c8d9e0a12"
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Response headers

- `Idempotency-Replayed` — Present and `true` only when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent as `false`.

## Errors

| Code | Status |
| --- | --- |
| `REFERENCE_NOT_FOUND` | 400 |
| `DOCUMENT_NOT_PAYABLE` | 400 |
| `PAYMENT_AMOUNT_EXCEEDS_OPEN_AMOUNT` | 400 |
| `DOCUMENT_CURRENCY_MISMATCH` | 400 |
| `IDEMPOTENCY_KEY_CONFLICT` | 409 |
| `IDEMPOTENCY_PAYLOAD_MISMATCH` | 422 |

## Statuses

- `400` — Invalid request or business failure. Codes: REFERENCE_NOT_FOUND, DOCUMENT_NOT_PAYABLE, PAYMENT_AMOUNT_EXCEEDS_OPEN_AMOUNT, DOCUMENT_CURRENCY_MISMATCH
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `409` — The Idempotency-Key is still being processed by another request.
- `422` — The Idempotency-Key was already used with a different request payload.
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
