---
title: "Update document"
method: PATCH
path: "/accounting/v2beta/documents/{id}"
tags: ["Documents"]
---

# Update document

`PATCH /accounting/v2beta/documents/{id}`

Update an accounting document.

## Path parameters

- `id` string, required

## Headers

- `If-Match` string

## Response `200`

The updated document.

- Document — Documents represent accounting transactions from your ERP system. Such as invoices, payments, credit memos, and journal entries.
  - `id` string, required — Unique resource identifier.
  - `organizationId` string, required — Unique resource identifier for an Organization.
  - `glEntityId` string, required — The Atlar general ledger entity id that this document is associated with.
  - `type` 'JOURNAL_ENTRY' | 'PAYMENT' | 'CREDIT_MEMO' | 'INVOICE' | 'PURCHASE_ORDER' | 'TRANSFER', required — The type of accounting document from the ERP system.
  - `classification` 'SOURCE' | 'INSTRUCTION', required — Classification of a document based on whether it affects a bank GL account: - SOURCE: A document with no child ledger entries affecting a GL account of type BANK (e.g. an invoice). - INSTRUCTION: A document with child ledger entries affecting a GL account of type BANK (e.g. a payment).
  - `amount` MultiCurrencyAmount, required
    - `baseAmount` Amount, required
      - `currency` string, required — Three-letter ISO 4217 currency code.
      - `stringValue` string, required — A string representation of the amount value. This will be a decimal number if the currency has decimals. The number is not formatted for display purposes (e.g. with locale specific thousand separator) and always contains the dot `.` character as decimal separator.
      - `value` integer, required — The amount value as an integer (int64) represented in currency minor units (e.g. 15.02 EUR is represented as the value 1502).
    - `instructedAmount` Amount, required
      - `currency` string, required — Three-letter ISO 4217 currency code.
      - `stringValue` string, required — A string representation of the amount value. This will be a decimal number if the currency has decimals. The number is not formatted for display purposes (e.g. with locale specific thousand separator) and always contains the dot `.` character as decimal separator.
      - `value` integer, required — The amount value as an integer (int64) represented in currency minor units (e.g. 15.02 EUR is represented as the value 1502).
  - `remainingAmount` MultiCurrencyAmount
    - `baseAmount` Amount, required
      - `currency` string, required — Three-letter ISO 4217 currency code.
      - `stringValue` string, required — A string representation of the amount value. This will be a decimal number if the currency has decimals. The number is not formatted for display purposes (e.g. with locale specific thousand separator) and always contains the dot `.` character as decimal separator.
      - `value` integer, required — The amount value as an integer (int64) represented in currency minor units (e.g. 15.02 EUR is represented as the value 1502).
    - `instructedAmount` Amount, required
      - `currency` string, required — Three-letter ISO 4217 currency code.
      - `stringValue` string, required — A string representation of the amount value. This will be a decimal number if the currency has decimals. The number is not formatted for display purposes (e.g. with locale specific thousand separator) and always contains the dot `.` character as decimal separator.
      - `value` integer, required — The amount value as an integer (int64) represented in currency minor units (e.g. 15.02 EUR is represented as the value 1502).
  - `date` string, date, required — `full-date` notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2017-07-21`.
  - `issueDate` string, date, required — `full-date` notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2017-07-21`.
  - `invoiceDetails` DocumentInvoiceDetails
    - `settledDate` string, date — `full-date` notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2017-07-21`.
    - `daysToDue` integer — Days from issue date to due date.
    - `daysToSettled` integer — Days from issue date to settled date. Empty while the invoice is open.
    - `settlementDaysPastDue` integer — Days from due date to settled date. Empty while the invoice is open. May be negative if paid early.
  - `description` string, required — The description of the document.
  - `reference` string — The reference of the document.
  - `references` object, required
  - `counterparty` AccountingCounterparty
    - `name` string, required
    - `type` 'VENDOR' | 'CUSTOMER' | 'EMPLOYEE', required
    - `erpId` string, required — The ID of the counterparty in the ERP system.
  - `voided` boolean, required — Whether the document is voided in the accounting system.
  - `reconciliationStatus` 'OPEN' | 'MATCHED' | 'RECONCILED' | 'IGNORED', required — The reconciliation status of a document: - OPEN: Not yet matched to any counterpart. - MATCHED: Matched but the reconciliation match is not yet approved. - RECONCILED: Part of an approved reconciliation match. - IGNORED: Ignored from reconciliation.
  - `reconciliationMatchId` string — Unique resource identifier.
  - `glEntries` GLEntry[], required
    - `id` string, required — Unique resource identifier.
    - `vendorId` string, required
    - `glAccountId` string, required — Unique resource identifier.
    - `amount` MultiCurrencyAmount, required
      - `baseAmount` Amount, required
        - `currency` string, required — Three-letter ISO 4217 currency code.
        - `stringValue` string, required — A string representation of the amount value. This will be a decimal number if the currency has decimals. The number is not formatted for display purposes (e.g. with locale specific thousand separator) and always contains the dot `.` character as decimal separator.
        - `value` integer, required — The amount value as an integer (int64) represented in currency minor units (e.g. 15.02 EUR is represented as the value 1502).
      - `instructedAmount` Amount, required
        - `currency` string, required — Three-letter ISO 4217 currency code.
        - `stringValue` string, required — A string representation of the amount value. This will be a decimal number if the currency has decimals. The number is not formatted for display purposes (e.g. with locale specific thousand separator) and always contains the dot `.` character as decimal separator.
        - `value` integer, required — The amount value as an integer (int64) represented in currency minor units (e.g. 15.02 EUR is represented as the value 1502).
    - `type` 'DEBIT' | 'CREDIT', required
  - `appliedDocuments` AppliedDocument[] — The sibling relationship between documents, the documents that are applied to this document (e.g. payments applied to an invoice and vice versa).
    - `amount` Amount, required
      - `currency` string, required — Three-letter ISO 4217 currency code.
      - `stringValue` string, required — A string representation of the amount value. This will be a decimal number if the currency has decimals. The number is not formatted for display purposes (e.g. with locale specific thousand separator) and always contains the dot `.` character as decimal separator.
      - `value` integer, required — The amount value as an integer (int64) represented in currency minor units (e.g. 15.02 EUR is represented as the value 1502).
    - `targetDocumentId` string — Unique resource identifier.
    - `targetDocumentType` 'JOURNAL_ENTRY' | 'PAYMENT' | 'CREDIT_MEMO' | 'INVOICE' | 'PURCHASE_ORDER' | 'TRANSFER', required — The type of accounting document from the ERP system.
    - `targetDocumentExternalId` string, required — The ID of the target document in the external ERP system.
    - `date` string, date — `full-date` notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), for example, `2017-07-21`.
  - `provenance` DocumentProvenance, required
    - `vendorId` string, required
    - `vendorTimestamp` string, date-time, required
    - `resource` union, required
      - object
        - `type` 'FILE' | 'API', required
        - `name` string, required — The name of the file.
        - `contentType` 'application/vnd.iso20022.pain.001.001.03+xml' | 'application/vnd.iso20022.pain.001.001.03.ch.02+xml' | 'application/vnd.iso20022.pain.001.001.09+xml' | 'application/vnd.iso20022.pain.001.001.09.ch.03+xml' | 'application/vnd.iso20022.pain.002.001.03+xml' | 'application/vnd.iso20022.pain.002.001.10+xml' | 'application/vnd.iso20022.pain.008.001.02+xml' | 'application/vnd.iso20022.pain.008.001.02.ch.03+xml' | 'application/vnd.iso20022.pain.008.001.03+xml' | 'application/vnd.iso20022.camt.052.001.02+xml' | 'application/vnd.iso20022.camt.052.001.03+xml' | 'application/vnd.iso20022.camt.052.001.04+xml' | 'application/vnd.iso20022.camt.052.001.08+xml' | 'application/vnd.iso20022.camt.053.001.02+xml' | 'application/vnd.iso20022.camt.053.001.03+xml' | 'application/vnd.iso20022.camt.053.001.04+xml' | 'application/vnd.iso20022.camt.053.001.08+xml' | 'application/vnd.iso20022.camt.053.001.10+xml' | 'application/vnd.iso20022.camt.053.001.11+xml' | 'application/vnd.iso20022.camt.054.001.02+xml' | 'application/vnd.iso20022.pacs.008.001.02+xml' | 'application/vnd.iso20022.pacs.008.001.08+xml' | 'application/vnd.swift.mt.101' | 'application/vnd.swift.mt.103' | 'application/vnd.swift.mt.900' | 'application/vnd.swift.mt.940' | 'application/vnd.swift.mt.942' | 'application/vnd.bai.bai2' | 'application/vnd.bgc.autogiro.payee' | 'application/vnd.bgc.autogiro.payments.rejected' | 'application/vnd.bgc.autogiro.payments.spec' | 'application/vnd.bgc.autogiro.mandate' | 'application/vnd.bgc.payins.bgmax' | 'application/vnd.nacha.ach' | 'application/vnd.atlar.testbank.mandate+json' | 'application/vnd.atlar.testbank.transaction+json' | 'application/vnd.atlar.connectivity.proprietary' | 'application/vnd.atlar.connectivity.proprietary+json' | 'application/vnd.atlar.connectivity.proprietary+xml' | 'application/vnd.atlar.connectivity.proprietary+csv' | 'application/vnd.atlar.connectivity.v2.investment-statement+json' | 'application/vnd.atlar.connectivity.v2.accounting-statement+json' | 'application/vnd.atlar.connectivity.v2.fx-rate-statement+json' | 'application/vnd.atlar.connectivity.v2.benchmark-rate-statement+json' | 'application/vnd.atlar.connectivity.v2.statement+json' | 'application/vnd.atlar.connectivity.v2.statement+csv' | 'application/vnd.ms-excel' | 'application/x-ofx' | 'application/json' | 'text/plain' | 'application/vnd.edi.820' | 'application/vnd.edi.824', required — The content type of the data.
        - `timestamp` string, date-time, required
      - object
        - `type` 'FILE' | 'API', required
        - `url` string, required — The URL of the API resource.
        - `contentType` 'application/vnd.iso20022.pain.001.001.03+xml' | 'application/vnd.iso20022.pain.001.001.03.ch.02+xml' | 'application/vnd.iso20022.pain.001.001.09+xml' | 'application/vnd.iso20022.pain.001.001.09.ch.03+xml' | 'application/vnd.iso20022.pain.002.001.03+xml' | 'application/vnd.iso20022.pain.002.001.10+xml' | 'application/vnd.iso20022.pain.008.001.02+xml' | 'application/vnd.iso20022.pain.008.001.02.ch.03+xml' | 'application/vnd.iso20022.pain.008.001.03+xml' | 'application/vnd.iso20022.camt.052.001.02+xml' | 'application/vnd.iso20022.camt.052.001.03+xml' | 'application/vnd.iso20022.camt.052.001.04+xml' | 'application/vnd.iso20022.camt.052.001.08+xml' | 'application/vnd.iso20022.camt.053.001.02+xml' | 'application/vnd.iso20022.camt.053.001.03+xml' | 'application/vnd.iso20022.camt.053.001.04+xml' | 'application/vnd.iso20022.camt.053.001.08+xml' | 'application/vnd.iso20022.camt.053.001.10+xml' | 'application/vnd.iso20022.camt.053.001.11+xml' | 'application/vnd.iso20022.camt.054.001.02+xml' | 'application/vnd.iso20022.pacs.008.001.02+xml' | 'application/vnd.iso20022.pacs.008.001.08+xml' | 'application/vnd.swift.mt.101' | 'application/vnd.swift.mt.103' | 'application/vnd.swift.mt.900' | 'application/vnd.swift.mt.940' | 'application/vnd.swift.mt.942' | 'application/vnd.bai.bai2' | 'application/vnd.bgc.autogiro.payee' | 'application/vnd.bgc.autogiro.payments.rejected' | 'application/vnd.bgc.autogiro.payments.spec' | 'application/vnd.bgc.autogiro.mandate' | 'application/vnd.bgc.payins.bgmax' | 'application/vnd.nacha.ach' | 'application/vnd.atlar.testbank.mandate+json' | 'application/vnd.atlar.testbank.transaction+json' | 'application/vnd.atlar.connectivity.proprietary' | 'application/vnd.atlar.connectivity.proprietary+json' | 'application/vnd.atlar.connectivity.proprietary+xml' | 'application/vnd.atlar.connectivity.proprietary+csv' | 'application/vnd.atlar.connectivity.v2.investment-statement+json' | 'application/vnd.atlar.connectivity.v2.accounting-statement+json' | 'application/vnd.atlar.connectivity.v2.fx-rate-statement+json' | 'application/vnd.atlar.connectivity.v2.benchmark-rate-statement+json' | 'application/vnd.atlar.connectivity.v2.statement+json' | 'application/vnd.atlar.connectivity.v2.statement+csv' | 'application/vnd.ms-excel' | 'application/x-ofx' | 'application/json' | 'text/plain' | 'application/vnd.edi.820' | 'application/vnd.edi.824', required — The content type of the data.
        - `timestamp` string, date-time, required
  - `vendorCreated` string, date-time, required — When the document was created in the originating external system.
  - `vendorResourceUrl` string — The URL to the document in the originating external system, to help navigate to the document in the originating external system. This differs from the provenance URL, which is the endpoint URL from where it was fetched from.
  - `currencyExchange` CurrencyExchange
    - `exchangeRate` string, required — The exchange rate that was reported by the bank. Atlar will not try to calculate this in cases where the information isn't present.
    - `sourceCurrency` string, required — Three-letter ISO 4217 currency code.
    - `targetCurrency` string — Three-letter ISO 4217 currency code.
    - `unitCurrency` string — Three-letter ISO 4217 currency code.
  - `version` integer, required — Resource version. Starts at value `1` when the resource is created and increases by one for each successive update.
  - `etag` string, required — [ETag](https://en.wikipedia.org/wiki/HTTP_ETag) based on the resource version. This can be passed along in `If-Match` HTTP header when updating a resource to perform a conditional update.
  - `created` string, date-time, required — Time at which the resource was created.
  - `updated` string, date-time, required — Time at which the resource was last updated.

## Other responses

- `400` — Bad request.
- `404` — Resource not found.

---

[API](https://skmtc.net/atlar/apis/atlar-api-v2.md) · [All operations](https://skmtc.net/atlar/apis/atlar-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlar/atlar-api-v2/revisions/9c5e194ccf5d/schema)
