Create an ad hoc document and post it.
Operation ID: createAdHocDocument
Group: Accounting › Ad Hoc Documents
Open in the interactive reference
POST /accounting/ad-hoc-documents
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 ad hoc document and posts it, in one call. The response is the new document's id and nothing else; read it back with GET accounting/ad-hoc-documents/:id for the fields the server filled in — the assigned taxDocumentNumber, the derived postingPeriodId and paymentStatus, and the computed totals.
There are no drafts over this API. A created document is posted: it draws a document number, books one journal entry per controlling book through the financial processor, stores its account mappings and recomputes its allocation balances. A document is changed afterwards only by voiding it with POST accounting/ad-hoc-documents/:id/void; there is no PATCH.
Send exactly one counterparty — customerId, vendorId, employeeId or intercompanyEntityId. Every reference is a uuid. A field that does not apply is rejected rather than ignored, so a payload that names something this resource does not own comes back as an error instead of being silently dropped.
Every request carries an Api-Version header; without it the request is rejected with 400, and a route that exists in another version answers 404.
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: createAdHocDocumentInput.
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | yes | Kind of document. Decides which tax direction the lines are validated against: the two incoming kinds consume input tax, the two outgoing ones charge output tax. One of: "outgoingInvoice" (A customer-facing invoice. Its incoming payment can be matched to a bank deposit.), "outgoingCredit" (A credit issued to a customer, reducing what they owe.), "incomingInvoice" (An invoice received from a vendor, employee or intercompany entity.), "incomingCredit" (A credit received from a vendor, employee or intercompany entity.). Example: "outgoingInvoice". |
title |
string | yes | Title of the document, as it appears on the record. Example: "Consulting services, October". |
description |
string | no | Free-text description of the document. Example: "Recharge of advisory hours". |
documentNumber |
string | yes | Document number as it appears on the source document — the counterparty's own number, or one carried over from an external system. Distinct from the taxDocumentNumber Everest assigns, which is not an input. Example: "INV-2026-0188". |
entityId |
string | yes | Id of the legal entity the document belongs to (a UUID). It must have an entity book, or the document cannot be posted. Example: "1a9c4e70-38b5-4d26-9f01-7c2e5b8a6d43". |
currency |
string | yes | Currency of this document as a 3-letter ISO 4217 code (e.g. USD, EUR, GBP). It governs every amount on the document, on the header and on every line alike. Example: "EUR". |
accountId |
string | yes | Id of the account the document posts its offsetting entry to (a UUID). It must be a posting account of the entity's chart of accounts and must not be a bank or credit-card account. Whether it is a receivable account is what decides the document's paymentStatus. Example: "a41b6c70-2d85-4f19-8c03-5e7a9b1d2f46". |
invoiceDate |
date | yes | Date the document is issued. The posting period is derived from it, shifting to the next postable period when the one it falls in is closed or locked for ad hoc documents. Format YYYY-MM-DD. Example: "2026-10-31". |
serviceDate |
date | no | Date the underlying service was provided. Drives the tax point where it differs from the invoice date. Defaults to invoiceDate. Format YYYY-MM-DD. Example: "2026-10-31". |
dueDate |
date | no | Date payment falls due. Omit when no due date applies. Format YYYY-MM-DD. Example: "2026-11-30". |
paymentTerms |
string | no | Payment terms recorded on the document, as free text (e.g. 'Net 30'). Example: "Net 30". |
customerId |
string | no | Id of the customer the document is issued to (a UUID). Send exactly one of customerId, vendorId, employeeId and intercompanyEntityId. Example: "7d1e8f20-3a4b-4c5d-9e60-1f2a3b4c5d6e". |
vendorId |
string | no | Id of the vendor the document is received from (a UUID). Send exactly one of customerId, vendorId, employeeId and intercompanyEntityId. |
employeeId |
string | no | Id of the employee the document is received from (a UUID). Send exactly one of customerId, vendorId, employeeId and intercompanyEntityId. |
intercompanyEntityId |
string | no | Id of the intercompany entity the document is exchanged with (a UUID). Send exactly one of customerId, vendorId, employeeId and intercompanyEntityId. |
lines |
array<object> | yes | Lines of the document, each carrying one taxable position. At least one is required. All line amounts are in the document currency (see currency). Example: [{"description":"Advisory hours, October","taxableBasis":"1000.00","accountId":"5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f","taxConfigurationLineId":"2e3f4a5b-6c7d-4e8f-9a0b-1c2d3e4f5a6b"}]. |
lines[].description |
string | no | Free-text description of the line item. |
lines[].taxableBasis |
decimal | yes | Basis amount the tax is calculated on, in the document currency (see currency). |
lines[].taxAmount |
decimal | no | Tax charged on the line, in the document currency (see currency). Omit to take the computed default, the taxable basis times the tax code's percentage rounded to two places; send a value to override it, as an external system's own rounding may require. Not accepted without taxConfigurationLineId, unless it is zero. |
lines[].accountId |
string | yes | Id of the account this line books its revenue or cost to (a UUID). It must be a posting account of the entity's chart of accounts whose sub-type is income, cost of goods sold or other income, plus any sub-type the tenant's AD_HOC_DOCUMENT_ADDITIONAL_LINE_ACCOUNT_SUB_TYPES configuration adds. |
lines[].taxConfigurationLineId |
string | no | Id of the tax configuration line that governs this line's tax (a UUID). Required when the document's entity has a tax configuration in this document's tax direction, and rejected when it has none. |
lines[].reportingTags |
array<object> | no | Reporting tags to attach to this line, in the same vocabulary as a journal entry line. At most one tag per dimension (per custom dimension for 'custom'). Customer, vendor and employee tags are rejected here: they are set from the document's own counterparty. The reads return the tags the line ended up with. |
lines[].reportingTags[].dimensionCode |
string | yes | The reporting dimension this tag is for. Possible values: 'department', 'businessUnit', 'team', 'location', 'region', 'psaProject', 'product', 'valueCenter', 'custom'. |
lines[].reportingTags[].modelId |
string | yes | The dimension record this tag points to (a UUID), on the model that dimensionCode names. For 'custom', the id of the custom dimension value. |
{
"type": "outgoingInvoice",
"title": "Consulting services, October",
"documentNumber": "INV-2026-0188",
"entityId": "1a9c4e70-38b5-4d26-9f01-7c2e5b8a6d43",
"currency": "EUR",
"accountId": "a41b6c70-2d85-4f19-8c03-5e7a9b1d2f46",
"invoiceDate": "2026-10-31",
"lines": [
{
"description": "Advisory hours, October",
"taxableBasis": "1000.00",
"accountId": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
"taxConfigurationLineId": "2e3f4a5b-6c7d-4e8f-9a0b-1c2d3e4f5a6b"
}
]
}
Response
200 Success
Under data (createAdHocDocumentOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | Id of the created ad hoc document (a UUID). Read it back with GET accounting/ad-hoc-documents/:id for the fields the server filled in. Example: "3f2a9c14-7b6d-4e58-9a01-2c8f5d6e7a0b". |
{
"data": {
"id": "3f2a9c14-7b6d-4e58-9a01-2c8f5d6e7a0b"
},
"diagnostics": [
{
"code": "<code>",
"message": "<message>",
"severity": "error",
"path": [
"<path>"
],
"details": "<details>"
}
]
}
Response headers
Idempotency-Replayed— Present andtrueonly 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 asfalse.
Errors
| Code | Status |
|---|---|
REFERENCE_NOT_FOUND |
400 |
FIELD_REQUIRED |
400 |
INVALID_FIELD_VALUE |
400 |
INVALID_PARTNER |
400 |
INVALID_ACCOUNT |
400 |
INVALID_LINE_TAX |
400 |
INVALID_REPORTING_TAG |
400 |
ACCOUNTING_PERIOD_CLOSED |
400 |
ENTITY_NOT_IN_BOOK |
400 |
EXCHANGE_RATE_NOT_FOUND |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: REFERENCE_NOT_FOUND, FIELD_REQUIRED, INVALID_FIELD_VALUE, INVALID_PARTNER, INVALID_ACCOUNT, INVALID_LINE_TAX, INVALID_REPORTING_TAG, ACCOUNTING_PERIOD_CLOSED, ENTITY_NOT_IN_BOOK, EXCHANGE_RATE_NOT_FOUND401— The request carries no valid access token.403— Not authorized404— Not found409— 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 noRetry-Afterheader.500— Internal server error