Create sales orders, add line items, and easily send invoices—our system will take care of the rest!
Sending invoices through the 24SevenOffice API is straightforward once you understand the process. Whether you’re a developer or just getting started, this page will guide you through everything you need to know.
Important: When referencing API endpoints in your code, be sure to use lowercase instead of camel case. While camel case is used in this article to enhance readability, it's not the format required in the actual implementation. Always refer to the API documentation to ensure correct usage before integrating it into your project.
Creating a Sales Order
To send an invoice, you first need to create a new sales order. Start by making a POST request to the /salesOrders
endpoint. When the sales order is created, it will initially have a "status"
set to "Draft"
. This status indicates that the order is still a work in progress and not yet ready to be sent.
Adding Sales Order Lines
Before your sales order can be invoiced, it needs to include at least one sales order line.
A sales order line represents an item or service being sold. To add a line, send a POST request to /salesOrders/{id}/lines
with the details of the item. Here’s an example:
{
"id": 1,
"type": "product",
"product": {
"id": 101
},
"description": "Leather handbag with adjustable strap.",
"quantity": 2,
"price": 49.99,
"discountRate": 10,
"tax": {
"id": 1,
"number": 1,
"rate": 25
},
"account": {
"id": 200001,
"number": 1500,
"name": "Accounts Receivable"
}
}
After adding all necessary lines to your sales order, it’s ready for invoicing.
Updating the Sales Order Status
Once your sales order is complete, you can update its status to indicate that it’s ready to be invoiced. To do this, send a PATCH request to the /salesOrders/{id}
endpoint, setting the "status"
property to "Invoice"
:
{
"status": "Invoice"
}
Sending the Invoice
With the status updated to "Invoice"
, your sales order is automatically added to the Invoice Queue. This queue is where all ready-to-send invoices are held before being delivered to your customers. Depending on your settings, the invoice will typically be sent out via email.
Automatic Accounting
Don’t worry about the accounting details—24SevenOffice takes care of that for you. As soon as the invoice is sent, all the necessary accounting entries are generated automatically, keeping your books up to date without any extra effort.
Wrap Up
That’s all there is to it! To send an invoice using the 24SevenOffice API, create a sales order, add the necessary line items, update the status to "Invoice"
, and let our system handle the rest.
Our API docs for the /salesOrders
endpoint are here to help, feel free to explore.