Invoice Create

Invoice Create

Certified

Create an invoice

Write operation: creates a new invoice in the QuickBooks company (POST /invoice). Running the task twice creates two invoices. A retry after a timeout can also create a duplicate when QuickBooks processed the first request, so set requestId to make the call idempotent. The invoice body needs at least CustomerRef and one Line.

yaml
type: io.kestra.plugin.quickbooks.invoices.Create

Create an invoice with one sales line

yaml
id: create_invoice
namespace: company.team
tasks:
  - id: create
    type: io.kestra.plugin.quickbooks.invoices.Create
    clientId: "{{ secret('QBO_CLIENT_ID') }}"
    clientSecret: "{{ secret('QBO_CLIENT_SECRET') }}"
    refreshToken: "{{ secret('QBO_REFRESH_TOKEN') }}"
    realmId: "{{ secret('QBO_REALM_ID') }}"
    requestId: "{{ execution.id }}-{{ taskrun.id }}"
    invoice:
      CustomerRef:
        value: "58"
      Line:
        - Amount: 150.0
          DetailType: SalesItemLineDetail
          SalesItemLineDetail:
            ItemRef:
              value: "1"
Properties

QuickBooks Client ID

The OAuth2 Client ID for your QuickBooks application

QuickBooks Client Secret

The OAuth2 Client Secret for your QuickBooks application

Invoice body

The QuickBooks Invoice object as a map, using QuickBooks field names (CustomerRef, Line, ...). See https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice.

QuickBooks Realm ID

The Realm ID (Company ID) for the QuickBooks account. Digits only, checked after rendering.

QuickBooks Refresh Token

A valid OAuth2 refresh token. Kestra will automatically rotate and persist it in the KV Store. Note: Token rotation is not cross-worker concurrency safe, and failed KV store writes may result in lost tokens.

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.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset 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.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Defaulthttps://oauth.platform.intuit.com/oauth2/v1/tokens/bearer

Authentication URL

The OAuth2 token endpoint. Must be an intuit.com domain.

Defaulthttps://quickbooks.api.intuit.com

Base URL

The Base URL for QuickBooks API. Must be an intuit.com domain. Defaults to production.

Default75

Minor Version

The minor version of the QuickBooks API to use. Must be 1 or more, checked after rendering.

Request ID (idempotency key)

Sent as the QuickBooks requestid query parameter, at most 50 characters. QuickBooks returns the result of the first request instead of creating a second invoice when it receives the same requestid again, which protects against duplicates when a retry follows a timeout. Use a value that is stable across the attempts of one run, for example {{ execution.id }}-{{ taskrun.id }}. Without it, a retry after a timeout can create a duplicate invoice.

Invoice ID

The Id of the invoice.

The invoice

The created or updated invoice as returned by QuickBooks.

Sync token

The new SyncToken, required for the next update of this invoice.

Total amount

The TotalAmt of the invoice.