Distru icon

Distru

Interact with the Distru Public API v1

Actions35

Invoices → Upsert

AI-generated

Overview

This node operation allows users to create or update invoices in the Distru system. It is useful for managing invoice data associated with orders, including specifying invoice details, items, and charges. For example, a user can upsert an invoice by providing an order ID, invoice date, due date, billing location, and detailed line items and charges, enabling seamless invoice management within an automated workflow.

Use Case Examples

  1. Creating a new invoice for a specific order with multiple items and charges.
  2. Updating an existing invoice by specifying its ID and modifying its details or line items.

Properties

Name Meaning
Order ID The associated order ID for the invoice, required when creating a new invoice.
Additional Fields Optional fields for the invoice such as invoice ID (for updates), invoice date, due date, and billing location ID.
Items A collection of invoice items, each with an associated order item ID and quantity.
Charges A collection of charges applied to the invoice, each with a name, type (charge, discount, or tax), price, and percentage.

Output

JSON

  • order_id - The order ID associated with the invoice.
  • id - The invoice ID (if updating an existing invoice).
  • invoice_datetime - The date of the invoice.
  • due_datetime - The due date for the invoice payment.
  • billing_location_id - The billing location ID.
  • items - Array of invoice items, each containing order item ID and quantity.
  • charges - Array of charges applied to the invoice, including name, type, price, and percentage.

Dependencies

  • Distru Public API v1
  • An API token credential for authentication

Troubleshooting

  • Missing or invalid API token will cause authentication errors; ensure the API token is set correctly in credentials.
  • If the operation is 'upsertInvoice' and required fields like 'order_id' are missing, the request will fail; ensure all required fields are provided.
  • If binary data is expected for other operations but missing, an error will be thrown; for 'upsertInvoice', binary data is not required.

Links

Discussion