NuminaDevelopers
Dashboard
Update draft journal entry

Update draft journal entry

PUT
/v1/journal-entries/{id}

Changes a draft; only the fields you send change. lines replaces all lines, and lines that do not sum to exactly zero return 400 validation_error. A draft reconciled with a bank line must keep its line on that bank account. Booked and canceled entries cannot be changed here.

Returns 409 when the entry is not a draft, when Numina's bookkeeping agent is working on it, when you send lines for a foreign-currency draft, or when you send an attachment_id and the entry is linked to an invoice, already has a different document, or the document is already on another entry.

Requires one ofjournal:writewrite:draftwrite:ledger

Path parameters

  • idstring (uuid)Required
    Journal entry ID, as returned when it was created

Body

application/json

  • datestring· YYYY-MM-DD
    Transaction date in YYYY-MM-DD format
  • textstring· max 500 chars
    Transaction description
  • contact_idstring (uuid)· nullable
    Set the contact; null clears it
  • linesarray of objects
    Replaces all lines. Send the full set, in DKK; it must sum to exactly zero.
    +Show 3 child attributes
    • account_numberintegerRequired
      Account number in chart of accounts
    • amountnumberRequired
      Signed amount in DKK: debit is positive, credit is negative. The lines must sum to exactly zero. With a vat_code, the amount includes VAT and the VAT is split out when the entry is booked.
    • vat_codestring
      VAT code (e.g., 'U25' for 25% sales VAT). Stored for later calculation during booking.
  • attachment_idstring (uuid)· nullable
    Put a document from POST /v1/attachments on this draft. To replace a document, take the current one off first. Null takes the current one off; the document itself stays.

Errors

  • 400Invalid input or validation failed
  • 401Invalid or missing authentication
  • 403Missing scope, or the company is archived
  • 404The resource does not exist in this company
  • 409The entry cannot take this change. Retry in a few minutes if the agent is the cause.
  • 429Rate limit exceeded
  • 500Internal Server Error

Every error has the same shape. See Errors.

cURL
curl -X PUT https://api.numina.app/v1/journal-entries/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer numi_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2024-01-15",
    "text": "Cash sale",
    "contact_id": "550e8400-e29b-41d4-a716-446655440000",
    "lines": [
      {
        "account_number": 3000,
        "amount": -1000,
        "vat_code": "U25"
      }
    ],
    "attachment_id": "550e8400-e29b-41d4-a716-446655440000"
  }'
JavaScript
const response = await fetch("https://api.numina.app/v1/journal-entries/550e8400-e29b-41d4-a716-446655440000", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.NUMINA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "date": "2024-01-15",
    "text": "Cash sale",
    "contact_id": "550e8400-e29b-41d4-a716-446655440000",
    "lines": [
      {
        "account_number": 3000,
        "amount": -1000,
        "vat_code": "U25"
      }
    ],
    "attachment_id": "550e8400-e29b-41d4-a716-446655440000"
  }),
});

const data = await response.json();
Python
import os

import requests

response = requests.put(
    "https://api.numina.app/v1/journal-entries/550e8400-e29b-41d4-a716-446655440000",
    headers={
        "Authorization": f"Bearer {os.environ['NUMINA_API_KEY']}",
    },
    json={
        "date": "2024-01-15",
        "text": "Cash sale",
        "contact_id": "550e8400-e29b-41d4-a716-446655440000",
        "lines": [
            {
                "account_number": 3000,
                "amount": -1000,
                "vat_code": "U25"
            }
        ],
        "attachment_id": "550e8400-e29b-41d4-a716-446655440000"
    },
)
data = response.json()
Response
200
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "date": "2026-01-15",
  "text": "Invoice payment from customer",
  "status": "open",
  "contact_id": "550e8400-e29b-41d4-a716-446655440000",
  "created_at": "2026-01-15T10:30:00Z",
  "external_reference": "payroll-run-2026-01",
  "lines": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "account_number": 3000,
      "account_id": "550e8400-e29b-41d4-a716-446655440001",
      "account_name": "Revenue",
      "amount": -1000,
      "text": "Invoice payment",
      "vat_code": "U25",
      "currency_code": "DKK",
      "currency_rate": 1
    }
  ],
  "state": "draft",
  "attachment": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "file_name": "string",
    "status": "string",
    "attachment_number": 42
  }
}