Skip to Main Content
Riverty Docs
riverty logo Docs

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.

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 Qualified Response notification.
  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 Qualified Response notification.
  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. (optional) 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.

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.

Path

POST /businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/invoices

Request Parameters

businessCode
required
string
The business in the context of which this request is to be executed, e.g. 1000
customerNumber
required
string
The customer in the context of which this request is to be executed, e.g. TFI2021072801
orderReference
required
string
The order in the context of which this request is to be executed, e.g. TFI2021072801_03
X-Request-ID
string
The unique ID of this particular request/transaction. Subsequent requests with the same request ID might get ignored.

Request Body

application/json

carrier
required
string
Carrier code (will be required for efficient chargeback handling). Only required for physical goods and if order is shipped when this information is generated.
dispatchDate
required
string
yyyy-MM-dd
Format(yyyy-MM-dd)
Date of shipment
dueDate
required
string
yyyy-MM-dd
Format(yyyy-MM-dd)
Date the invoice is due
invoiceDate
required
string
yyyy-MM-dd
Format(yyyy-MM-dd)
Date the invoice number has been created
invoiceReference
required
string
Max length: 30
maxLength(30)
Invoice number of referenced invoice
array
The items that are to be invoiced
shipmentReference
required
string
Max length: 30
maxLength(30)
Specific shipment reference from merchant
trackingCode
required
string
Tracking code of parcel (will be required for efficient chargeback handling). Only required for physical goods and if order is shipped when this information is generated.

Responses

Create Invoice example

Request Example

    
        {
 "items": [
  {
   "orderItemReference": 1
  }
 ],
 "carrier": "DHL",
 "dueDate": "2018-11-05",
 "invoiceDate": "2018-11-04",
 "dispatchDate": "2018-11-06",
 "trackingCode": "123456asfd788754sdffs987",
 "invoiceReference": "IDE12345678901",
 "shipmentReference": "S01234567"
}
    

Response Example

    
        {
 "internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}