Skip to main content

Invoices

Schema​

InvoiceInfo​

This object contains header-level information about the invoice.

NameTypeDescriptionExample
buyerIdID?The unique Kojo identifier of the buyer associated with the invoice"ckmnpybisiy5x08abky4g2d1f"
customerAccountNumberstringThe customer code associated with the invoice"CUST123"
invoiceNumberstringThe invoice number"INV001"
orderIdID?The unique identifier of the purchase order associated with the invoice"ckmnpybisiy5x08abky4g2d1f"
salesPersonEmailstring?The email address of the sales person associated with the invoice."salesperson@example.com"
salesPersonFreeformstring?The freeform sales person information associated with the invoice"John Doe"
termsstring?The terms of the invoice"Net 30"
invoiceDateDateTimeThe date of the invoice"2022-01-01T00:00:00Z"
totalDuefloatThe total amount due on the invoice100.0
taxfloat?The tax amount on the invoice10.0
dueDateDateTimeThe due date of the invoice"2022-01-31T00:00:00Z"
shippingCostFloatfloat?The total shipping and handling costs on the invoice75.20

InvoiceItemInput​

This object contains information about an invoice item.

NameTypeDescriptionExample
lineNumberint?The line number of the invoice item1
quantityInvoicedfloatThe quantity of the item invoiced100
unitsOfMeasurestringThe units of measure for the item"pcs"
unitPriceFloatfloatThe unit price of the item as a floating-point number9.99
unitPriceECMUnitPriceECMThe unit price basis (E, C, or M)"C"
extPriceFloatfloat?The extended price of the item as a floating-point number9.99
descriptionstring?The description of the item"Product A"
universalProductCodestring?The universal product code of the item"00123456789012"

REST Endpoint​

POST /invoice​

Create a new invoice.

Request Body​

The request body should contain the following fields:

NameTypeDescriptionExample
invoiceInfoInvoiceInfo[]An array of invoice item inputs (see InvoiceInfo)[...]"2022-01-31T00:00:00Z"`
invoiceItemsInvoiceItemInput[]?An array of invoice item inputs (see InvoiceItemInput). An invoice with no items will be created if none are provided[...]

Response​

The response will be one of the following:

  • 201: invoice successfully created
  • 400: Bad input
  • 409: Invoice number already exists
  • 500: An error has occurred

Example Request​

POST https://api.kojo.tech/seller/invoice
{
"invoiceInfo": {
"orderId": "ckmnpybisiy5x08abky4g2d1f",
"customerAccountNumber": "CUST123",
"invoiceNumber": "INV001",
"salesPersonEmail": "john@example.com",
"salesPersonFreeform": "John Doe",
"terms": "Net 30",
"invoiceDate": "2022-01-01T00:00:00Z",
"totalDue": 100.0,
"tax": 10.0,
"dueDate": "2022-01-31T00:00:00Z"
},
"invoiceItems": [
{
"lineNumber": 1,
"quantityInvoiced": 100,
"unitsOfMeasure": "pcs",
"unitPriceFloat": 9.99,
"unitPriceECM": "C",
"extPriceFloat": 9.99,
"description": "Product A",
"universalProductCode": "00123456789012"
}
]
}