
Microsoft 365 CreateInvoice
CertifiedCreate a Business Central sales invoice
Microsoft 365 CreateInvoice
Create a Business Central sales invoice
Creates a new sales invoice in Business Central under the specified company.
Requires the Financials.ReadWrite.All API permission on the service principal.
type: io.kestra.plugin.microsoft365.dynamics365.businesscentral.CreateInvoiceExamples
Create a sales invoice in Business Central
id: bc_create_invoice
namespace: company.team
tasks:
- id: create
type: io.kestra.plugin.microsoft365.dynamics365.businesscentral.CreateInvoice
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
environment: production
companyId: "00000000-0000-0000-0000-000000000001"
invoice:
customerNumber: "C00010"
invoiceDate: "2026-04-17"
dueDate: "2026-05-17"
Properties
clientId *string
Client ID
Client ID of the Azure service principal. If you don't have a service principal, refer to create a service principal with Azure CLI.
companyId *string
Company ID
GUID of the Business Central company.
environment *string
Business Central Environment Name
Name of the Business Central environment to target, e.g. production or sandbox.
This is combined with the tenant ID to form the base URL:
https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}/api/v2.0.
invoice *object
Invoice fields
Map of field names to values for the new sales invoice.
tenantId *string
Tenant ID
Azure AD (Entra ID) tenant GUID used for authentication.
apiEndpoint string
Business Central API endpoint
Override the Business Central API base URL.
Useful for sovereign clouds (e.g. GovCloud, China). Defaults to https://api.businesscentral.dynamics.com when not set.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150clientSecret string
Client Secret
Service principal client secret. Use this for Client Secret authentication. Provide clientId, tenantId, and clientSecret. Either clientSecret OR pemCertificate must be provided, not both.
pemCertificate string
PEM Certificate
Alternative authentication method using certificate-based authentication. Use this for Client Certificate authentication. Provide clientId, tenantId, and pemCertificate. Either clientSecret OR pemCertificate must be provided, not both.
Outputs
invoice object
Invoice record
Full sales invoice record as returned by Business Central after creation.
invoiceId string
Invoice ID
GUID of the newly created sales invoice.