Direct Integration - Create Invoice

The "Create Invoice" interface is used in two main scenarios: to inform Accounting as a Service about an invoice that has already been created by the client and sent to the end-customer, or to initiate the creation of an invoice by Accounting as a Service. Whether Accounting as a Service is responsible for generating invoices is determined during the onboarding process. If set up during onboarding, invoices will always be generated by Accounting as a Service.

Standard Invoicing

The create invoice interface supports two main scenarios:

  • Partial Shipment: only parts of the order are shipped and invoiced. This may be the case if multiple distribution centeres are used to fullfill the order or a mixed card with direct fulfillment and delivery is used. With every shipment a separate invoice can be created. It will also be used if parts of the order are not deliverable (due to missing stock).
  • Full Shipment: an order can also be fulfilled and invoiced completely. In this case only one invoice is created for the order.

Please note the following:

  • Multiple Invoices Per Order: Multiple invoices can be generated for a single order, typically when shipments are sent from different logistic centers. Each shipment usually results in a separate invoice.
  • Invoicing Process: Accounting as a Service utilizes the data from the create order request, invoicing the full line items provided in the create order request. Only full line items can be invoiced; partial - invoicing of line items is not supported.
  • Handling Cancellations: If a line item cannot be shipped, it must be canceled using the cancel order request. A canceled line item cannot be re-invoiced.
  • Digital Orders: For digital orders, where the service or product delivery happens immediately after order placement, both the create order and create invoice requests must be submitted.

General Workflow:

  1. Order Creation: Ensure the order has been created in the system and confirmed via EDI Error Sent.
  2. Invoice Submission: Submit the create invoice request to notify Accounting as a Service of the invoice or to initiate its creation.
  3. Shipment Confirmation: The create invoice request also serves to confirm the shipment, requiring details like DispatchDate, Carrier, and TrackingCode.
  4. Request Confirmation: Make sure the create invoice was successfully confirmed via EDI Error Sent.
  5. Invoicing and Booking: Accounting as a Service generates the invoice (if configured), books the invoiced amounts in the subledger accounts, and initiates payment capture at the PSP if handled by Accounting as a Service.
  6. Settlement and Payment Tracking: Payment success is reflected in a subsequent settlement file. Clients can subscribe to payment received and/or chargeback received notifications for updates on the payment status.

Request Submission

To create an invoice, make a POST request to:

POST /accounting/v1/businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/invoices
  • {businessCode}: Represents the legal entity (e.g., use "1000" in sandbox).
  • {customerNumber}: The end-customer’s unique identifier used in the create order
  • {orderReference}: The orderReference provided for the original order in the create order

Key Points: Ensure all mandatory fields are completed as per the API-Explorer.

Request Body Structure

Below is an example of a complete request body for createing an invoice for an order:

{
    "carrier": "DHL",
    "dispatchDate": "2024-09-12",
    "dueDate": "2024-09-12",
    "invoiceDate": "2024-09-12",
    "invoiceReference": "INV-NL833249069",
    "shipmentReference": "ORD-NL8333249069",
    "trackingCode": "5cbe48d9-9c3f-46f0-87ab-f1ff3e25d23",
    "items": [
        {"orderItemReference": 1},
        {"orderItemReference": 2}
    ]
}
  • DispatchDate: The date when the items were dispatched.
  • Carrier: A free-text field specifying the carrier or the provider for digital goods.
  • TrackingCode: A tracking code provided by the carrier to track the shipment.
  • DueDate: The date by which the customer must pay, crucial for the dunning process.
  • InvoiceDate: The date the invoice is issued.
  • InvoiceReference: The invoice ID that complies with local regulations.

Note: The only difference between a full deliveries and a partial deliveries is that for partial deliveries not all line items are included while for full deliveries all line items are included.

You are responsible to track that all line items have a final status. They need to either be cancelled or invoiced in the end.