LedgerBee Developer
  • Getting started
  • Conventions
  • Products
  • Advisor firms
  • Configuration
  • API Reference
Information
Accounts
    List accountsgetCreate an accountpostGet an accountgetDelete an accountdeleteUpdate an accountpatch
Advisor Authority Extracts
    Submit authority extract data for an advisor firm's clientspost
Advisor Clients
    List the advisor firm's clientsget
API Key
    Get current API keyget
Authority Extracts
    Submit authority extract datapost
Bank Reconciliations
    Reconcile bank lines against entriespostUndo a bank reconciliationpostCheck what undoing a reconciliation would dopostReconcile a batch of matchespostCheck what reconciling a batch of matches would dopostCheck what reconciling bank lines against entries would dopost
Bank Transactions
    List bank linesgetGet a bank linegetDismiss bank lines from reconciliationpostCheck which bank lines a dismiss would changepostRestore dismissed bank lines to reconciliationpostCheck which bank lines a restore would changepost
Billing Groups
    Form a billing grouppostGet a billing groupgetAdd members to a billing grouppostRemove a member from a billing groupdeleteCheck billing group eligibilitypost
Budgets
    List budgetsgetGet a budgetgetGet the budget vs actuals comparisongetExport a budget's Excel workbookgetOverwrite a budget's figures from an edited workbookpostList a budget's frozen baselinesgetGet a frozen baseline with its snapshot cellsgetList a budget's re-baseline proposalsgetList a budget's scenariosgetResolve a budget's grid under a scenariogetGet the variance report vs a frozen baselinegetGet the runway headlineget
Checkout
    Confirm the checkoutpostQuote a first periodpostIntegration readinessgetMint a checkout sessionpostRehydrate a sessiongetRelease the card hold (edit-after-card)postPoll card statusgetOpen the card windowpostOpen a card window for a live subscriptionpost
Company
    Get company detailsget
Connected app OAuth
    JSON Web Key Set used to verify OAuth access-token signaturesgetRFC 8414 authorization-server metadata for the connected-app OAuth servergetRFC 9728 protected-resource metadata for an MCP resourcegetRFC 9728 protected-resource metadata for an MCP resourcegetOpenID Connect discovery document for the connected-app OAuth serverget
Credit Note Links
    Link a credit note to the invoice it creditspostCheck a credit note’s links and the invoices it can be linked topostDetach a credit note from the invoices it is applied topost
Credit Notes
    List credit notesgetCreate a credit notepostGet a credit notegetGet the delivery status of a credit notegetDownload the credit note PDFgetSend a credit note to the customerpostCredit a whole invoicepost
Customers
    List customersgetCreate a customerpostGet a customergetDelete a customerdeleteUpdate a customerpatchList a customer's contactsgetList a customer's departmentsgetList customer groupsget
Dimensions
    List all dimensionsgetCreate a new dimension categorypostGet a dimensiongetUpdate a dimension categoryputDelete a dimension categorydeleteList distribution keys (paginated)getCreate a distribution keypostGet a distribution keygetList dimension values (paginated)getCreate a new dimension valuepostUpdate a dimension valueputDelete a dimension valuedelete
Discounts
    List discountsgetCreate a discountpostGet a discountgetDelete a discountdeleteUpdate a discountpatchSet a discount's amount in one currencyputRemove a discount's amount in one currencydeleteCheck whether a discount applies to a product for a customer on a daygetAssign a discountpostRemove an assignmentdeleteUpdate an assignmentpatchList a discount's codesgetAdd a code to a discountpostDelete a codedeleteUpdate a codepatchList the discounts that apply to a product for a customer on a daygetCheck a cartpostLook up a discount codeget
Document Templates
    List document templatesget
Document Upload Links
    Upload a file through a minted linkpost
Download Links
    Mint a download link for a document PDFgetDownload a minted linkget
Draft Journal Entries
    Create multiple draft journal entries in batchpostList draft journal entriesgetCreate a draft journal entrypostGet a draft journal entrygetDelete a draft journal entrydeleteBook a draft journal entrypost
Draft Journal Entries (v2)
    Create draft journal entries in batch (v2)postList draft journal entries (v2)getCreate a draft journal entry (v2)postGet a draft journal entry (v2)getDelete a draft journal entry (v2)deleteUpdate a draft journal entry (v2)patchGet attachments for a draft journal entry (v2)getAdd a document to a draft journal entry (v2)postRemove a document from a draft journal entry (v2)deleteBook a draft journal entry (v2)post
Entitlements
    List entitlementsgetCreate an entitlementpostGet an entitlementgetDelete an entitlementdeleteUpdate an entitlementpatch
Invoices
    List invoicesgetCreate a draft invoicepostGet an invoicegetDelete a draft invoicedeleteUpdate an unsent invoicepatchGet the delivery status of an invoicegetDownload the invoice PDFgetSend an invoice to the customerpost
Journal Categories
    List journal categoriesgetCreate a journal categorypostUpdate a journal categoryputDelete a journal categorydelete
Journal Entries
    List journal entriesgetGet a journal entrygetUpdate a journal entry — correct the reference and/or set your external system idpatchGet attachments for a journal entrygetAdd a document to a journal entrypostRemove a document from a journal entrydeletePreview a correction without posting itpostMove postings to different accounts, keeping the document intactpostRebuild the entry a reversal undid, as a draftpostPreview rebuilding the entry a reversal undidpostReverse a posted entry and open a draft to re-enter itpostReverse posted journal entries in batchpostPreview reversing posted journal entries in batchpostReverse a posted journal entrypostPreview reversing a posted journal entrypost
Journal Entries (v2)
    Create a journal entry (v2)postCreate journal entries in batch (v2)post
MCP
    LedgerBee Developer MCP Serverpost
Meters
    List meter subscriptions by IDgetReport usagepostList meter subscriptions by nameget
Open Entries
    List a counterparty’s open entriesget
Order Confirmations
    List order confirmationsgetCreate a draft order confirmationpostGet an order confirmationgetUpdate a draft order confirmationpatchConvert an order confirmation into an invoicepostDownload an order confirmation as PDFgetSend an order confirmationpost
Payment Methods
    List saved payment methods for a customergetCancel a saved card on the payment providerdeleteUnassign a payment method from a customerdeleteGenerate a link for the customer to save a card for future paymentspostSet a saved payment method as the customer defaultput
Portal Plans
    List the full plan cataloguegetGet a plangetResolve the gated pricing catalogue for an identified buyer (partner display)post
Portal SSO
    Get a tenant's SSO signing keys (JWKS)getMint a checkout-vouch token (partner-vouched anonymous checkout)postMint a customer-portal SSO handoff referencepostProvision a customer + grant portal access (partner JIT provisioning)postRevoke (force-refresh) a user's customer-portal sessionspost
Product Groups
    List product groupsgetCreate a product grouppostGet a product groupgetDelete a product groupdeleteUpdate a product grouppatch
Product Prices
    Create a product pricepostGet a product pricegetDelete a product pricedeleteUpdate a product pricepatchActivate a product pricepostArchive a product pricepostDisable a product pricepostSet a price as the product defaultpost
Products
    List productsgetCreate a productpostGet a productgetDelete a productdeleteUpdate a productpatchArchive a productpost
Projects
    List all projectsgetCreate or update a project by external referenceputCreate a projectpostGet a projectgetUpdate a projectputGet project profitgetAdd a subprojectpostUpdate a subprojectputDelete a subprojectdelete
Quotes
    List quotesgetCreate a draft quotepostGet a quotegetUpdate a draft quotepatchConvert a quotepostDownload a quote as PDFgetSend a quotepost
Settlements
    List a counterparty’s settlementsgetSettle open entries against each otherpostGet a settlementgetUndo a settlementpostCheck what undoing a settlement would dopostCheck what settling these entries would dopost
Shipments
    List shipmentsgetCreate a shipment from an orderpostGet a shipmentgetCancel a shipmentpostDispatch a shipmentpost
Stock
    List stock movementsgetList on-hand stockgetOn-hand for one productget
Subscriptions
    List customer subscriptionsgetAssign a subscription to a customerpostGet a customer subscription by its stable idgetUpdate a customer subscriptionpatchAdd an add-on to a customer subscriptionpostAttach existing subscriptions as add-onspostCheck whether subscriptions can become add-onspostChange the products on a customer subscriptionpostRetry a failed card paymentpostList a subscription's pending scheduled changesgetCancel a single pending scheduled changedeleteGet a subscription's unbilled usagegetCancel a customer subscriptionpostList subscription plansgetCreate a subscription planpostArchive a subscription planpost
Suppliers
    List suppliersgetCreate a supplierpostDelete a supplierdeleteList supplier contactsgetList supplier departmentsgetList supplier groupsget
VAT Codes
    List VAT codesgetCreate a VAT codepostGet a VAT codegetDelete a VAT codedeleteUpdate a VAT codepatch
VAT periods
    Record a VAT return filed outside LedgerBeepostPreview recording a VAT return filed outside LedgerBeepostSettle a filed VAT periodpostPreview a VAT period settlementpost
Vendors
    List vendorsgetCreate a vendorpostList vendor contactsgetList vendor departmentsgetList vendor groupsget
Webhook Endpoints
    List webhook endpointsgetCreate a webhook endpointpostRetrieve a webhook endpointgetUpdate a webhook endpointputDelete a webhook endpointdeleteRoll the signing secretpostSend a test eventpost
Schemas
LedgerBee Public API
LedgerBee Public API

Order Confirmations

Download schema

List order confirmations

GET
https://api.ledgerbee.com/api
/v1/order-confirmations
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Returns a paginated list of order confirmations.

Filters

ParameterDescription
statusDisplay status: draft, sent, converted. Derived statuses are resolved server-side.
customerIdFilter to one customer.
page / limitPagination (defaults: page 1, limit 25, max limit 100).
sortBy / sortOrderSort field (e.g. date, documentNumber, amount, status) and direction. Defaults to newest first.

Required Scope

  • order-confirmations-read

List order confirmations › query Parameters

cursor
​string

Opaque cursor from the previous response's nextCursor. Returns the rows after it, in the same order. Send the same filters and sort as the request that produced it, and do not send page. The preferred way to page through a list.

page
​number · min: 1 · deprecated

Deprecated: page with cursor instead. Page number (1-indexed). From 2026-12-31, a page past the first of a list with more than 10,000 matching rows is refused.

Default: 1
limit
​number · min: 1 · max: 100

Items per page

Example: 25
Default: 25
status
​string

Filter by display status (draft/sent/converted). Derived statuses are resolved server-side.

customerId
​string

Filter by customer id

sortBy
​string

Sort field: date, documentNumber, amount or status; anything else sorts by creation time. documentNumber cannot be combined with cursor, since documents without a number have no place in its order.

Example: date
sortOrder
​string · enum

Sort order

Enum values:
ASC
DESC

List order confirmations › Responses

Paginated list of order confirmations

PublicListOrderConfirmationsResponse
​PublicOrderConfirmationListItem[] · required

List of order confirmations (line items omitted; GET one for lines)

total
​number · required

Total number of documents matching the query

Example: 42
limit
​number · required

Maximum number of items per page

Example: 25
nextCursor
​string | null · required

Cursor for the next page; pass it as cursor. null on the last page, and on every page of a sort that cannot page by cursor — hasMore then says whether another page follows by page number.

Example: eyJ2IjoxLCJmIjoiOWMxZjQyYWIzMTA4ZDc2ZSIsImsiOlsiMjAyNi0wMS0yMCJdfQ
hasMore
​boolean · required

Whether more rows follow this page.

Example: true
page
​number · deprecated

Deprecated: page with nextCursor instead. Current page number (1-indexed).

Example: 1
totalPages
​number · deprecated

Deprecated: page with nextCursor instead. Total number of pages available.

Example: 2
GET/v1/order-confirmations
curl https://api.ledgerbee.com/api/v1/order-confirmations \ --header 'x-api-key: <api-key>'
Example Responses
{ "data": [ { "id": "id", "status": {}, "displayStatus": {}, "documentNumber": "documentNumber", "date": "2026-06-11", "amount": "amount", "subtotal": "subtotal", "vat": "vat", "currency": "DKK", "reference": "reference", "ourReference": "ourReference", "subject": "Website maintenance, March", "notes": "notes", "customerId": "customerId", "sourceDocumentId": "sourceDocumentId", "convertedToInvoiceId": "convertedToInvoiceId", "sentAt": "sentAt", "createdAt": "createdAt", "updatedAt": "updatedAt" } ], "total": 42, "page": 1, "limit": 25, "totalPages": 2, "nextCursor": "eyJ2IjoxLCJmIjoiOWMxZjQyYWIzMTA4ZDc2ZSIsImsiOlsiMjAyNi0wMS0yMCJdfQ", "hasMore": true }
json
application/json

Create a draft order confirmation

POST
https://api.ledgerbee.com/api
/v1/order-confirmations
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Creates a draft order confirmation.

  • The document number is not allocated here — it is assigned on send.
  • Totals (subtotal/vat/amount) are computed from the line items.

Required Scope

  • order-confirmations-write

Create a draft order confirmation › Headers

x-api-idempotency-key
​string · maxLength: 255

Optional idempotency key for safely retrying mutating requests.

Create a draft order confirmation › Request Body

PublicCreateOrderConfirmation
customerId
​string · required

Customer this order confirmation is for

date
​string · required

Document date (ISO, YYYY-MM-DD)

Example: 2026-06-11
​PublicCreateOrderConfirmationLine[] · required
customerDepartmentId
​string

Customer department id

customerContactId
​string

Customer contact id ("Deres ref.")

currency
​string

Currency code

Example: DKK
reference
​string

PO number ("PO-nr.")

ourReference
​string

Our reference ("Vores ref.")

subject
​string · maxLength: 255

Heading printed in bold on the PDF, directly above notes. The customer sees it on the document.

Example: Website maintenance, March
notes
​string

Message printed on the PDF under subject. The customer sees it on the document.

discountIds
​string[] · maxItems: 20

Document-scope discount records to apply once to the whole document, after every line discount, reducing the lines whose product each applies to (every line when it names no product). Each id is a discount record (see GET /discounts). The order sent is the order they apply in. Each is checked for the line's product, the document's customer and the document date; a document converted from a quote is checked at the quote's date. A fixed or per-unit discount takes its amount in the document's currency: a discount with no amount in that currency is refused, never converted at an exchange rate. One applies when it applies to the customer and to at least one line's product. Refused with: DISCOUNT_NOT_APPLICABLE (no such discount in your company, inactive, not assigned to this product and customer, or outside its dates on the document date; details.reason says which), DISCOUNT_WRONG_SCOPE, DISCOUNT_REFERENCED_TWICE, DISCOUNT_NOT_COMBINABLE, DISCOUNT_NO_AMOUNT_IN_CURRENCY, DISCOUNT_LINE_WITHOUT_PRODUCT, DISCOUNT_EXCEEDS_LINE and DISCOUNT_EXCEEDS_DOCUMENT.

Example: ["0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c"]
discountCodes
​string[] · maxItems: 20

Discount codes the customer gave, the same list sent to POST /discounts/check, matched without regard to case or surrounding spaces and applied after discountIds in the order sent. A code claims its discount, which then applies as if named by id, including one that applies only through a code: a line-scope discount lands on every line whose product it applies to, a document-scope one on the document. Saving uses none of the code's own limit: the invoice the document converts to counts it when booked, refused there with DISCOUNT_CODE_REDEMPTION_LIMIT_REACHED. A conversion carries each code with its discount, judged at the date of the document its conversion chain starts at: the quote, or an order confirmation made without one; one converted at the quoted figures keeps its codes as they were. A code naming a discount already named is applied once. Refused with: DISCOUNT_CODE_INVALID (empty, spaces or too long) and DISCOUNT_NOT_APPLICABLE with details.reason codeUnknown, codeInactive, codeExpired or codeCustomerMismatch and details.code, beside every refusal discountIds lists.

Example: ["SUMMER10"]

Create a draft order confirmation › Responses

Order confirmation created

PublicOrderConfirmation
id
​string · required

Document identifier

status
​object · required

Stored lifecycle status (draft/sent)

displayStatus
​object · required

Status to display. Equals status except the derived "converted" state.

date
​string · required

Document date (ISO, YYYY-MM-DD)

Example: 2026-06-11
amount
​string · required

Total amount including VAT

subtotal
​string · required

Subtotal excluding VAT

vat
​string · required

Total VAT

currency
​string · required

Currency code

Example: DKK
createdAt
​string · required

Created timestamp (ISO)

updatedAt
​string · required

Updated timestamp (ISO)

​PublicOrderConfirmationLine[] · required
​PublicAppliedDocumentDiscount[] · required

The document-scope discount records the document referenced, in the order they applied, each applied once after every line discount. Empty when it referenced none.

totalDiscounted
​string | null · required

What the document's discounts took off in all, in the document's currency: each line's amount before discounts less its amount after them, plus the document discounts. A line discount typed by hand in LedgerBee counts too. Null when the document references no discount record.

Example: 250.00
documentNumber
​string

Allocated document number (null until sent)

reference
​string

PO number ("PO-nr.")

ourReference
​string

Our reference ("Vores ref.")

subject
​string | null

Heading printed in bold on the PDF, directly above notes. The customer sees it on the document.

Example: Website maintenance, March
notes
​string

Message printed on the PDF under subject. The customer sees it on the document.

customerId
​string

Customer id

sourceDocumentId
​string

Source document id (the quote this order confirmation was converted from)

convertedToInvoiceId
​string

Id of the invoice this order confirmation was converted into

sentAt
​string

Timestamp the document was sent (ISO)

​PublicDocumentDiscountWarning[]

Warnings about the save. Present on the create and update responses only, empty when there is nothing to warn about. A warning never blocks the save.

POST/v1/order-confirmations
curl https://api.ledgerbee.com/api/v1/order-confirmations \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "customerId": "string", "customerDepartmentId": "string", "customerContactId": "string", "date": "2026-06-11", "currency": "DKK", "reference": "string", "ourReference": "string", "subject": "Website maintenance, March", "notes": "string", "lines": [ { "priceId": "string", "description": "string", "lineType": "subscription", "quantity": 2, "unitPrice": "1000.00", "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ] } ], "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ], "discountCodes": [ "SUMMER10" ] }'
Example Request Body
{ "customerId": "string", "customerDepartmentId": "string", "customerContactId": "string", "date": "2026-06-11", "currency": "DKK", "reference": "string", "ourReference": "string", "subject": "Website maintenance, March", "notes": "string", "lines": [ { "priceId": "string", "description": "string", "lineType": "subscription", "quantity": 2, "unitPrice": "1000.00", "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ] } ], "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ], "discountCodes": [ "SUMMER10" ] }
json
application/json
Example Responses
{ "id": "id", "status": {}, "displayStatus": {}, "documentNumber": "documentNumber", "date": "2026-06-11", "amount": "amount", "subtotal": "subtotal", "vat": "vat", "currency": "DKK", "reference": "reference", "ourReference": "ourReference", "subject": "Website maintenance, March", "notes": "notes", "customerId": "customerId", "sourceDocumentId": "sourceDocumentId", "convertedToInvoiceId": "convertedToInvoiceId", "sentAt": "sentAt", "createdAt": "createdAt", "updatedAt": "updatedAt", "lines": [ { "id": "id", "description": "description", "lineType": "lineType", "quantity": 2, "unitPrice": "1000.00", "totalPrice": "2000.00", "vatRate": "25", "vatAmount": "vatAmount", "appliedDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "10", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "200.00", "code": "SUMMER10" } ] } ], "documentDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "percentagePct", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "originalReductionAmount", "vatSplit": [ { "vatRatePct": "25.00", "taxCategory": "taxCategory", "originalReductionAmount": "originalReductionAmount", "originalVatReductionAmount": "originalVatReductionAmount" } ], "code": "SUMMER10" } ], "totalDiscounted": "250.00", "warnings": [ { "code": "DISCOUNT_ENDS_BEFORE_QUOTE_EXPIRY", "discountId": "discountId", "name": "name", "endsAt": "2026-12-31", "validUntil": "2027-01-15" } ] }
json
application/json

Get an order confirmation

GET
https://api.ledgerbee.com/api
/v1/order-confirmations/{id}
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Returns a single order confirmation, including its line items.

Required Scope

  • order-confirmations-read

Get an order confirmation › path Parameters

id
​string · required

The order confirmation id

Get an order confirmation › Responses

The order confirmation

PublicOrderConfirmation
id
​string · required

Document identifier

status
​object · required

Stored lifecycle status (draft/sent)

displayStatus
​object · required

Status to display. Equals status except the derived "converted" state.

date
​string · required

Document date (ISO, YYYY-MM-DD)

Example: 2026-06-11
amount
​string · required

Total amount including VAT

subtotal
​string · required

Subtotal excluding VAT

vat
​string · required

Total VAT

currency
​string · required

Currency code

Example: DKK
createdAt
​string · required

Created timestamp (ISO)

updatedAt
​string · required

Updated timestamp (ISO)

​PublicOrderConfirmationLine[] · required
​PublicAppliedDocumentDiscount[] · required

The document-scope discount records the document referenced, in the order they applied, each applied once after every line discount. Empty when it referenced none.

totalDiscounted
​string | null · required

What the document's discounts took off in all, in the document's currency: each line's amount before discounts less its amount after them, plus the document discounts. A line discount typed by hand in LedgerBee counts too. Null when the document references no discount record.

Example: 250.00
documentNumber
​string

Allocated document number (null until sent)

reference
​string

PO number ("PO-nr.")

ourReference
​string

Our reference ("Vores ref.")

subject
​string | null

Heading printed in bold on the PDF, directly above notes. The customer sees it on the document.

Example: Website maintenance, March
notes
​string

Message printed on the PDF under subject. The customer sees it on the document.

customerId
​string

Customer id

sourceDocumentId
​string

Source document id (the quote this order confirmation was converted from)

convertedToInvoiceId
​string

Id of the invoice this order confirmation was converted into

sentAt
​string

Timestamp the document was sent (ISO)

​PublicDocumentDiscountWarning[]

Warnings about the save. Present on the create and update responses only, empty when there is nothing to warn about. A warning never blocks the save.

GET/v1/order-confirmations/{id}
curl https://api.ledgerbee.com/api/v1/order-confirmations/:id \ --header 'x-api-key: <api-key>'
Example Responses
{ "id": "id", "status": {}, "displayStatus": {}, "documentNumber": "documentNumber", "date": "2026-06-11", "amount": "amount", "subtotal": "subtotal", "vat": "vat", "currency": "DKK", "reference": "reference", "ourReference": "ourReference", "subject": "Website maintenance, March", "notes": "notes", "customerId": "customerId", "sourceDocumentId": "sourceDocumentId", "convertedToInvoiceId": "convertedToInvoiceId", "sentAt": "sentAt", "createdAt": "createdAt", "updatedAt": "updatedAt", "lines": [ { "id": "id", "description": "description", "lineType": "lineType", "quantity": 2, "unitPrice": "1000.00", "totalPrice": "2000.00", "vatRate": "25", "vatAmount": "vatAmount", "appliedDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "10", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "200.00", "code": "SUMMER10" } ] } ], "documentDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "percentagePct", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "originalReductionAmount", "vatSplit": [ { "vatRatePct": "25.00", "taxCategory": "taxCategory", "originalReductionAmount": "originalReductionAmount", "originalVatReductionAmount": "originalVatReductionAmount" } ], "code": "SUMMER10" } ], "totalDiscounted": "250.00", "warnings": [ { "code": "DISCOUNT_ENDS_BEFORE_QUOTE_EXPIRY", "discountId": "discountId", "name": "name", "endsAt": "2026-12-31", "validUntil": "2027-01-15" } ] }
json
application/json

Update a draft order confirmation

PATCH
https://api.ledgerbee.com/api
/v1/order-confirmations/{id}
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Replaces the editable fields and line items of a draft document.

Line items are replaced wholesale — send the full intended set. A converted document is read-only (SALES_DOCUMENT_LOCKED_CONVERTED).

Required Scope

  • order-confirmations-write

Update a draft order confirmation › path Parameters

id
​string · required

The order confirmation id

Update a draft order confirmation › Headers

x-api-idempotency-key
​string · maxLength: 255

Optional idempotency key for safely retrying mutating requests.

Update a draft order confirmation › Request Body

PublicUpdateOrderConfirmation
customerId
​string · required

Customer this order confirmation is for

date
​string · required

Document date (ISO, YYYY-MM-DD)

Example: 2026-06-11
​PublicCreateOrderConfirmationLine[] · required
customerDepartmentId
​string

Customer department id

customerContactId
​string

Customer contact id ("Deres ref.")

currency
​string

Currency code

Example: DKK
reference
​string

PO number ("PO-nr.")

ourReference
​string

Our reference ("Vores ref.")

subject
​string | null · maxLength: 255

Heading printed in bold on the PDF, directly above notes. The customer sees it on the document. Leave it out to keep the stored subject; send null to clear it.

Example: Website maintenance, March
notes
​string

Message printed on the PDF under subject. The customer sees it on the document.

status
​string

New stored status (validated against the document type: draft/sent for order confirmations).

discountIds
​string[] · maxItems: 20

Document-scope discount records to apply once to the whole document, after every line discount, reducing the lines whose product each applies to (every line when it names no product). Each id is a discount record (see GET /discounts). The order sent is the order they apply in. Each is checked for the line's product, the document's customer and the document date; a document converted from a quote is checked at the quote's date. A fixed or per-unit discount takes its amount in the document's currency: a discount with no amount in that currency is refused, never converted at an exchange rate. One applies when it applies to the customer and to at least one line's product. On an update, leaving it out keeps the discounts the document has; an empty array removes them. Refused with: DISCOUNT_NOT_APPLICABLE (no such discount in your company, inactive, not assigned to this product and customer, or outside its dates on the document date; details.reason says which), DISCOUNT_WRONG_SCOPE, DISCOUNT_REFERENCED_TWICE, DISCOUNT_NOT_COMBINABLE, DISCOUNT_NO_AMOUNT_IN_CURRENCY, DISCOUNT_LINE_WITHOUT_PRODUCT, DISCOUNT_EXCEEDS_LINE and DISCOUNT_EXCEEDS_DOCUMENT.

Example: ["0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c"]
discountCodes
​string[] · maxItems: 20

Discount codes the customer gave, the same list sent to POST /discounts/check, matched without regard to case or surrounding spaces and applied after discountIds in the order sent. A code claims its discount, which then applies as if named by id, including one that applies only through a code: a line-scope discount lands on every line whose product it applies to, a document-scope one on the document. Saving uses none of the code's own limit: the invoice the document converts to counts it when booked, refused there with DISCOUNT_CODE_REDEMPTION_LIMIT_REACHED. A conversion carries each code with its discount, judged at the date of the document its conversion chain starts at: the quote, or an order confirmation made without one; one converted at the quoted figures keeps its codes as they were. A code naming a discount already named is applied once. On an update, a discount the document carries through a code keeps that code when the update names the discount again without it. Refused with: DISCOUNT_CODE_INVALID (empty, spaces or too long) and DISCOUNT_NOT_APPLICABLE with details.reason codeUnknown, codeInactive, codeExpired or codeCustomerMismatch and details.code, beside every refusal discountIds lists.

Example: ["SUMMER10"]

Update a draft order confirmation › Responses

Order confirmation updated

PublicOrderConfirmation
id
​string · required

Document identifier

status
​object · required

Stored lifecycle status (draft/sent)

displayStatus
​object · required

Status to display. Equals status except the derived "converted" state.

date
​string · required

Document date (ISO, YYYY-MM-DD)

Example: 2026-06-11
amount
​string · required

Total amount including VAT

subtotal
​string · required

Subtotal excluding VAT

vat
​string · required

Total VAT

currency
​string · required

Currency code

Example: DKK
createdAt
​string · required

Created timestamp (ISO)

updatedAt
​string · required

Updated timestamp (ISO)

​PublicOrderConfirmationLine[] · required
​PublicAppliedDocumentDiscount[] · required

The document-scope discount records the document referenced, in the order they applied, each applied once after every line discount. Empty when it referenced none.

totalDiscounted
​string | null · required

What the document's discounts took off in all, in the document's currency: each line's amount before discounts less its amount after them, plus the document discounts. A line discount typed by hand in LedgerBee counts too. Null when the document references no discount record.

Example: 250.00
documentNumber
​string

Allocated document number (null until sent)

reference
​string

PO number ("PO-nr.")

ourReference
​string

Our reference ("Vores ref.")

subject
​string | null

Heading printed in bold on the PDF, directly above notes. The customer sees it on the document.

Example: Website maintenance, March
notes
​string

Message printed on the PDF under subject. The customer sees it on the document.

customerId
​string

Customer id

sourceDocumentId
​string

Source document id (the quote this order confirmation was converted from)

convertedToInvoiceId
​string

Id of the invoice this order confirmation was converted into

sentAt
​string

Timestamp the document was sent (ISO)

​PublicDocumentDiscountWarning[]

Warnings about the save. Present on the create and update responses only, empty when there is nothing to warn about. A warning never blocks the save.

PATCH/v1/order-confirmations/{id}
curl https://api.ledgerbee.com/api/v1/order-confirmations/:id \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "customerId": "string", "customerDepartmentId": "string", "customerContactId": "string", "date": "2026-06-11", "currency": "DKK", "reference": "string", "ourReference": "string", "subject": "Website maintenance, March", "notes": "string", "status": "string", "lines": [ { "priceId": "string", "description": "string", "lineType": "subscription", "quantity": 2, "unitPrice": "1000.00", "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ] } ], "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ], "discountCodes": [ "SUMMER10" ] }'
Example Request Body
{ "customerId": "string", "customerDepartmentId": "string", "customerContactId": "string", "date": "2026-06-11", "currency": "DKK", "reference": "string", "ourReference": "string", "subject": "Website maintenance, March", "notes": "string", "status": "string", "lines": [ { "priceId": "string", "description": "string", "lineType": "subscription", "quantity": 2, "unitPrice": "1000.00", "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ] } ], "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ], "discountCodes": [ "SUMMER10" ] }
json
application/json
Example Responses
{ "id": "id", "status": {}, "displayStatus": {}, "documentNumber": "documentNumber", "date": "2026-06-11", "amount": "amount", "subtotal": "subtotal", "vat": "vat", "currency": "DKK", "reference": "reference", "ourReference": "ourReference", "subject": "Website maintenance, March", "notes": "notes", "customerId": "customerId", "sourceDocumentId": "sourceDocumentId", "convertedToInvoiceId": "convertedToInvoiceId", "sentAt": "sentAt", "createdAt": "createdAt", "updatedAt": "updatedAt", "lines": [ { "id": "id", "description": "description", "lineType": "lineType", "quantity": 2, "unitPrice": "1000.00", "totalPrice": "2000.00", "vatRate": "25", "vatAmount": "vatAmount", "appliedDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "10", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "200.00", "code": "SUMMER10" } ] } ], "documentDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "percentagePct", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "originalReductionAmount", "vatSplit": [ { "vatRatePct": "25.00", "taxCategory": "taxCategory", "originalReductionAmount": "originalReductionAmount", "originalVatReductionAmount": "originalVatReductionAmount" } ], "code": "SUMMER10" } ], "totalDiscounted": "250.00", "warnings": [ { "code": "DISCOUNT_ENDS_BEFORE_QUOTE_EXPIRY", "discountId": "discountId", "name": "name", "endsAt": "2026-12-31", "validUntil": "2027-01-15" } ] }
json
application/json

Convert an order confirmation into an invoice

POST
https://api.ledgerbee.com/api
/v1/order-confirmations/{id}/convert
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Converts the order confirmation into an invoice (target: "invoice").

By default the source document's fields and line items are copied verbatim. To review and adjust the target before finalizing, supply an optional document payload — its fields override the copied values.

A document converts only once. Re-converting fails with SALES_DOCUMENT_ALREADY_CONVERTED_TO_INVOICE.

The conversion is refused when the resulting invoice total (VAT included) is below 0: an invoice cannot have a negative total. The request fails with 400 and INVOICE_INVALID_SIGN, and no invoice is created. The document for a negative total is a credit note — create it with POST /v1/credit-notes. A total of exactly 0 converts.

A discount record the order confirmation references may have been edited, switched off or moved out of its window since it was priced. discountPricing picks how the invoice is priced: asQuoted keeps the order confirmation's figures, current uses the records as they are now (checked at the date of the quote the order confirmation was converted from, else its own date) and refuses one that no longer applies with DISCOUNT_NOT_APPLICABLE. Omitted, the conversion prices at the current records and warnings lists a DISCOUNT_CHANGED_SINCE_QUOTE entry, with both figures, for each discount that changed. The invoice keeps the choice: a later edit prices the order confirmation's discounts the same way.

The response identifies the produced invoice via targetType ("invoice") and targetId.

Required Scope

  • order-confirmations-write

Convert an order confirmation into an invoice › path Parameters

id
​string · required

The order confirmation id to convert

Convert an order confirmation into an invoice › Headers

x-api-idempotency-key
​string · maxLength: 255

Optional idempotency key for safely retrying mutating requests.

Convert an order confirmation into an invoice › Request Body

PublicConvertOrderConfirmation
target
​string · enum · required

Target to convert into. An order confirmation only ever converts into an "invoice".

Enum values:
invoice
​object

Edited target document (review-before-finalize). Omit to copy the source verbatim.

discountPricing
​string · enum

How the discount records the source references are priced when a record was edited, switched off or moved out of its window after the source was priced. asQuoted keeps the source's saved figures. current prices the records as they are now, at the source's date, and refuses a record that no longer applies (DISCOUNT_NOT_APPLICABLE). Omitted means current; the response then lists a DISCOUNT_CHANGED_SINCE_QUOTE warning for each discount whose figures differ.

Enum values:
asQuoted
current
Example: asQuoted

Convert an order confirmation into an invoice › Responses

Conversion result

PublicConvertOrderConfirmationResult
targetType
​string · required

Type of document produced by the conversion (always "invoice")

Example: invoice
targetId
​string · required

Identifier of the produced document

​PublicDiscountChangedSinceQuoteWarning[] · required

One per discount whose figures differ from the source document's, when the request named no discountPricing and the conversion priced at the current records. Empty otherwise. A warning never blocks the conversion.

POST/v1/order-confirmations/{id}/convert
curl https://api.ledgerbee.com/api/v1/order-confirmations/:id/convert \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "target": "invoice", "document": { "customerId": "string", "customerDepartmentId": "string", "customerContactId": "string", "date": "2026-06-11", "currency": "string", "reference": "string", "ourReference": "string", "subject": "Website maintenance, March", "notes": "string", "lines": [], "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ], "discountCodes": [ "SUMMER10" ] }, "discountPricing": "asQuoted" }'
Example Request Body
{ "target": "invoice", "document": { "customerId": "string", "customerDepartmentId": "string", "customerContactId": "string", "date": "2026-06-11", "currency": "string", "reference": "string", "ourReference": "string", "subject": "Website maintenance, March", "notes": "string", "lines": [], "discountIds": [ "0199b6d2-3c1a-7a40-9f00-1d2e3f4a5b6c" ], "discountCodes": [ "SUMMER10" ] }, "discountPricing": "asQuoted" }
json
application/json
Example Responses
{ "targetType": "invoice", "targetId": "targetId", "warnings": [ { "discountId": "discountId", "name": "name", "scope": "line", "quotedType": "percentage", "quotedValue": "10", "quotedAmount": "100.00", "currentType": "percentage", "currentValue": "currentValue", "currentAmount": "currentAmount", "currentApplicable": true, "codeRefusedReason": "unknown", "discountCode": "discountCode", "code": "DISCOUNT_CHANGED_SINCE_QUOTE" } ] }
json
application/json

Download an order confirmation as PDF

GET
https://api.ledgerbee.com/api
/v1/order-confirmations/{id}/pdf
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Renders and streams the document as a PDF (application/pdf).

Pass ?draft=true to render an unfinalized "draft" watermark preview before the document is sent.

Required Scope

  • order-confirmations-read

Download an order confirmation as PDF › path Parameters

id
​string · required

The order confirmation id

Download an order confirmation as PDF › query Parameters

draft
​boolean

Render a draft-watermarked preview when "true".

Download an order confirmation as PDF › Responses

PDF binary stream

No data returned
GET/v1/order-confirmations/{id}/pdf
curl https://api.ledgerbee.com/api/v1/order-confirmations/:id/pdf \ --header 'x-api-key: <api-key>'
Example Responses
No example specified for this content type

Send an order confirmation

POST
https://api.ledgerbee.com/api
/v1/order-confirmations/{id}/send
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Sends the document. This allocates the document number (if not already set), renders the PDF, optionally emails it, and marks the document sent.

Delivery

  • deliveryType: "Manual" (default) — allocates the number and marks sent without emailing. Use this when you will deliver the PDF yourself (download it via GET /:id/pdf).
  • deliveryType: "Email" — emails the rendered PDF. The recipient resolves from recipientEmail (override), else the customer contact, else the customer email. If none can be resolved the request fails with SALES_DOCUMENT_MISSING_RECIPIENT.

Sproom / e-invoice does not apply to order confirmations — there is no legal e-invoice type for an order confirmation.

A document that has already been converted is read-only and cannot be sent (SALES_DOCUMENT_LOCKED_CONVERTED).

Required Scope

  • order-confirmations-write

Send an order confirmation › path Parameters

id
​string · required

The order confirmation id

Send an order confirmation › Headers

x-api-idempotency-key
​string · maxLength: 255

Optional idempotency key for safely retrying mutating requests.

Send an order confirmation › Request Body

PublicSendOrderConfirmation
deliveryType
​string · enum

Delivery method. Defaults to Manual. Sproom/e-invoice does not apply to order confirmations.

Enum values:
Email
Manual
recipientEmail
​string

Override recipient email for Email delivery

Send an order confirmation › Responses

Order confirmation sent

PublicOrderConfirmation
id
​string · required

Document identifier

status
​object · required

Stored lifecycle status (draft/sent)

displayStatus
​object · required

Status to display. Equals status except the derived "converted" state.

date
​string · required

Document date (ISO, YYYY-MM-DD)

Example: 2026-06-11
amount
​string · required

Total amount including VAT

subtotal
​string · required

Subtotal excluding VAT

vat
​string · required

Total VAT

currency
​string · required

Currency code

Example: DKK
createdAt
​string · required

Created timestamp (ISO)

updatedAt
​string · required

Updated timestamp (ISO)

​PublicOrderConfirmationLine[] · required
​PublicAppliedDocumentDiscount[] · required

The document-scope discount records the document referenced, in the order they applied, each applied once after every line discount. Empty when it referenced none.

totalDiscounted
​string | null · required

What the document's discounts took off in all, in the document's currency: each line's amount before discounts less its amount after them, plus the document discounts. A line discount typed by hand in LedgerBee counts too. Null when the document references no discount record.

Example: 250.00
documentNumber
​string

Allocated document number (null until sent)

reference
​string

PO number ("PO-nr.")

ourReference
​string

Our reference ("Vores ref.")

subject
​string | null

Heading printed in bold on the PDF, directly above notes. The customer sees it on the document.

Example: Website maintenance, March
notes
​string

Message printed on the PDF under subject. The customer sees it on the document.

customerId
​string

Customer id

sourceDocumentId
​string

Source document id (the quote this order confirmation was converted from)

convertedToInvoiceId
​string

Id of the invoice this order confirmation was converted into

sentAt
​string

Timestamp the document was sent (ISO)

​PublicDocumentDiscountWarning[]

Warnings about the save. Present on the create and update responses only, empty when there is nothing to warn about. A warning never blocks the save.

POST/v1/order-confirmations/{id}/send
curl https://api.ledgerbee.com/api/v1/order-confirmations/:id/send \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "deliveryType": "Email", "recipientEmail": "string" }'
Example Request Body
{ "deliveryType": "Email", "recipientEmail": "string" }
json
application/json
Example Responses
{ "id": "id", "status": {}, "displayStatus": {}, "documentNumber": "documentNumber", "date": "2026-06-11", "amount": "amount", "subtotal": "subtotal", "vat": "vat", "currency": "DKK", "reference": "reference", "ourReference": "ourReference", "subject": "Website maintenance, March", "notes": "notes", "customerId": "customerId", "sourceDocumentId": "sourceDocumentId", "convertedToInvoiceId": "convertedToInvoiceId", "sentAt": "sentAt", "createdAt": "createdAt", "updatedAt": "updatedAt", "lines": [ { "id": "id", "description": "description", "lineType": "lineType", "quantity": 2, "unitPrice": "1000.00", "totalPrice": "2000.00", "vatRate": "25", "vatAmount": "vatAmount", "appliedDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "10", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "200.00", "code": "SUMMER10" } ] } ], "documentDiscounts": [ { "discountId": "discountId", "position": 0, "name": "name", "type": "percentage", "percentagePct": "percentagePct", "originalDiscountAmount": "originalDiscountAmount", "originalReductionAmount": "originalReductionAmount", "vatSplit": [ { "vatRatePct": "25.00", "taxCategory": "taxCategory", "originalReductionAmount": "originalReductionAmount", "originalVatReductionAmount": "originalVatReductionAmount" } ], "code": "SUMMER10" } ], "totalDiscounted": "250.00", "warnings": [ { "code": "DISCOUNT_ENDS_BEFORE_QUOTE_EXPIRY", "discountId": "discountId", "name": "name", "endsAt": "2026-12-31", "validUntil": "2027-01-15" } ] }
json
application/json

Open EntriesPayment Methods