Tips and FAQ

Sage Intacct - How to Filter Invoices by State

In Sage Intacct, invoices can be associated with two types of states: STATE and RAWSTATE. 

If you try to filter invoices by STATE, then no results are returned from the vendor endpoint, whereas filtering by RAWSTATE returns the desired set of data.

  • Available STATEs: Draft, Paid, Posted, Partially  Paid.
  • Available RAWSTATEsD = Draft, S = Submitted, A = Approved, PA = Partially Approved, U = Unapproved, P = Delivered, VP = Print Voided, C = Confirmed , V = Voided, X = Deleted , Q = Quick Delivery.

Approved invoices can also be  PaidPosted or Partially Paid , but since Intacct does not support filtering by STATE a workaround must be pursued. In order to retrieve invoices that are Paid, Partially Paid, or Posted, the following examples can be used for reference. 

Note: RAWSTATE can be specified in the where clause both as RAWSTATE or STATE, the same set of data will be returned: 

  • To get all the /invoices-advanced in Paid state:
curl -X GET "https://{environment} = 'A' AND TOTALDUE = 0 AND TOTALENTERED !=0"
  • In case the customer wants to get all the /invoices-advanced in Partially Paid state the query will look like this: 
curl -X GET "https://{environment} = 'A' AND TOTALDUE != 0 AND TOTALPAID != 0"
  • Whether /invoices-advanced in Posted state are needed the query will look like this: 
curl -X GET "https://{environment} = 'A' AND TOTALDUE !=0 AND TOTALPAID = 0"

NotePrinted invoices can also be in Paid STATE, this is why it's very important to specify the (RAW)STATE in the where clause.

Why Does Passing A locationId Parameter In A Query Return A 400 Error?

Error: 400

Message: Request failed

Provider Message: "response - {control={status=success, senderid=XXXXXX, controlid=XXXXXX, uniqueid=false, dtdversion=2.1}, operation={authentication={status=failure, userid=XXXXXX, companyid=XXXXXX, locationid=1234}, errormessage={error={errorno=XL03000006, description=null, description2=1234 is not a valid entity. Transaction should be owned by an entity and not by a sub-location., correction=null}}}}"

If your Intacct account is not configured with multi-entity support and you make a call to GET /ledger-accounts or GET /entities with a locationId parameter value, the call will fail with an authentication error similar to the Provider Message above. You will need to either contact Intacct. to enable this functionality or omit the locationId parameter from your Intacct API endpoint queries.