Invoices
Schema​
InvoiceInfo​
This object contains header-level information about the invoice.
| Name | Type | Description | Example |
|---|---|---|---|
| buyerId | ID? | The unique Kojo identifier of the buyer associated with the invoice | "ckmnpybisiy5x08abky4g2d1f" |
| customerAccountNumber | string | The customer code associated with the invoice | "CUST123" |
| invoiceNumber | string | The invoice number | "INV001" |
| orderId | ID? | The unique identifier of the purchase order associated with the invoice | "ckmnpybisiy5x08abky4g2d1f" |
| salesPersonEmail | string? | The email address of the sales person associated with the invoice. | "salesperson@example.com" |
| salesPersonFreeform | string? | The freeform sales person information associated with the invoice | "John Doe" |
| terms | string? | The terms of the invoice | "Net 30" |
| invoiceDate | DateTime | The date of the invoice | "2022-01-01T00:00:00Z" |
| totalDue | float | The total amount due on the invoice | 100.0 |
| tax | float? | The tax amount on the invoice | 10.0 |
| dueDate | DateTime | The due date of the invoice | "2022-01-31T00:00:00Z" |
| shippingCostFloat | float? | The total shipping and handling costs on the invoice | 75.20 |
InvoiceItemInput​
This object contains information about an invoice item.
| Name | Type | Description | Example |
|---|---|---|---|
| lineNumber | int? | The line number of the invoice item | 1 |
| quantityInvoiced | float | The quantity of the item invoiced | 100 |
| unitsOfMeasure | string | The units of measure for the item | "pcs" |
| unitPriceFloat | float | The unit price of the item as a floating-point number | 9.99 |
| unitPriceECM | UnitPriceECM | The unit price basis (E, C, or M) | "C" |
| extPriceFloat | float? | The extended price of the item as a floating-point number | 9.99 |
| description | string? | The description of the item | "Product A" |
| universalProductCode | string? | 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:
| Name | Type | Description | Example |
|---|---|---|---|
| invoiceInfo | InvoiceInfo[] | An array of invoice item inputs (see InvoiceInfo) | [...]"2022-01-31T00:00:00Z"` |
| invoiceItems | InvoiceItemInput[]? | 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"
}
]
}