Create a customer and invoice via Dynamics 365 Business Central API

domain: Dynamics 365 Business Central API · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register an Azure AD app, grant it the Dynamics 365 Business Central API application permission 'API.ReadWrite.All', and obtain a client credentials or delegated access token via the standard Azure AD OAuth 2.0 flow.
  2. Create the customer by POST-ing to https://api.businesscentral.dynamics.com/v2.0/YOUR_TENANT/YOUR_ENVIRONMENT/api/v2.0/companies(COMPANY_ID)/customers with a JSON body containing at minimum: displayName, email, and address information.
  3. Capture the 'id' (GUID) of the created customer from the 201 response body.
  4. Create the sales invoice by POST-ing to .../companies(COMPANY_ID)/salesInvoices with a JSON body referencing customerId from the previous step plus invoiceDate and paymentTermsId.
  5. Add invoice lines by POST-ing to .../salesInvoices(INVOICE_ID)/salesInvoiceLines with lineType, quantity, unitPrice, and accountId or itemId; then POST to the invoice's 'Microsoft.NAV.post' action to post it to the ledger.

Known gotchas

Related routes

Create an invoice in QuickBooks Online via API
quickbooks.com · 4 steps · unrated
Build a custom AL API page in Dynamics 365 Business Central to expose production order header and line data over OData v4 for an external MES integration
learn.microsoft.com · 6 steps · unrated
Map an inbound EDI X12 810 Invoice to a Dynamics 365 Finance and Operations vendor invoice using the DMF VendorInvoiceHeaderEntity and VendorInvoiceLineEntity
learn.microsoft.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans