Tips and FAQ

How Can /purchases-invoices Be Queried by contact_name?

In Sage Business Cloud Accounting, you cannot query by the field 'contact_name' directly; you can only query by contact (contact ID), status, search, from_date, and to_date.

For example to query for a specific contact named "ABC Distributing" you need to structure your Where clause query using the word 'search' such as where: search='ABC Distributing'.


How to Post /invoices

Sage has recently changed the required fields to make a successful post to their V3 sales_invoice endpoint. Below are all the required fields you will need, you can pass more (obviously) but these fields are absolutely required.

JSON payload

 "date": "some_date",
 "contact_id": "some_contact_id",
 "main_address": {
 "address_line_1": "some_address"
 "invoice_lines": [{
 "description": "some_description",
 "quantity": "some_quantity",
 "ledger_account_id": "some_ledger_account_id",
 "unit_price": "some_price",
 "tax_rate_id": "some_tax_rate_id"

One thing to note is the ledger_account_id needs to correspond to a Sales Ledger Account. If you don't know off hand which ledger accounts those are you can call the following endpoint.

curl -X GET "'sales'" -H "accept: application/json" -H "Authorization: User <user secret>, Organization <org secret>, Element <element secret>"

This call returns the Sales Ledger Accounts. Find the ledger account id you want to use, plug it into the POST payload, and you should be all set.