Skip to navigation

Create from orders

Creates one draft from matching order charges and reports skipped items. Billing period dates do not filter charges. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceCreateFromOrdersReq) -> (InvoiceCreateFromOrdersRes)

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
currency_codeenumRequired
invoice_typeenumRequired
Allowed values:
order_idslist of stringsRequired
schema_versionintegerRequired
counterparty_driver_idstringOptional
counterparty_off_chrt_org_data_idstringOptional
counterparty_org_idstringOptional

Must be a string starting with org_

descriptionstringOptional<=32768 characters
export_ref__sage__customer_idstringOptional<=255 characters
export_ref__sage__department_idstringOptional<=255 characters
namestringOptional<=255 characters
period_end_at_timestampdatetimeOptional
When derived, the exclusive UTC midnight after the last delivery day. Explicit bounds are preserved.
period_start_at_timestampdatetimeOptional
Supply both bounds or omit both to derive the period from delivery completion days in UTC.

Response

Successful Response
added_invoice_line_item_idslist of stringsOptional
already_invoiced_line_item_idslist of stringsOptional
finalized_line_item_idslist of stringsOptional
invoiceobjectOptional
Created draft, or null when no charges qualify.
orders_without_added_chargeslist of stringsOptional
unmatched_line_item_idslist of stringsOptional
Charges for another counterparty, invoice type, or currency, regardless of status.

Errors

422
Invoices Create from Orders V1request Unprocessable Entity Error