List Draft Invoices (Summary)

This function returns an array of all draft Invoices. It does not contain a breakdown of line items.

In order to manage the size of the data returned it is recommended for the number of results to be controlled by the pagesize parameter.

This call supports string filtering (Read More) and datetime/numeric range filtering (Read More)
&query=parameterName:Value

Parameter NameAcceptable ValuesParameter NameAcceptable Values
BillingPeriodEndDateDate RangeCustomer.ModifiedTimestampDate Range
BillingPeriodStartDateDate RangeCustomer.MonthlyRecurringRevenueDecimal Range
companyNameStringCustomer.NetMRRDecimal Range
createdDateDate RangeCustomer.NetSuiteIdString
currencyIdInteger (1-24)*Customer.ParentIdInteger
customerIdIntegerCustomer.StatusDraft, Active, Cancelled, Hold, Suspended
Customer.AccountStatusGood, PoorStanding, CollectioneffectiveDateDate Range
Customer.ArbalanceDecimal RangefirstNameString
Customer.CreatedTimestampDate RangelastNameString
Customer.CurrentMrrDecimal RangemiddleNameString
Customer.CurrentNetMrrDecimal RangemodifiedTimestampDate Range
Customer.CustomerReference.Reference1StringpendingChargesDecimal Range
Customer.CustomerReference.Reference2StringreferenceString
Customer.CustomerReference.Reference3StringstatusReady, Pending, Projected

*See here for Fusebill currency codes
This call supports pagination (Read More)
&pageSize=100&pageNumber=0
This call supports sorting (Read More)
&sortOrder=Ascending or &sortOrder=Descending
&sortExpression=expression

Request Examples

GET https://secure.fusebill.com/v1/DraftInvoices?pageSize=20&pageNumber=0&sortOrder=Ascending&sortExpression=createdDate 
Authorization: Basic {{apikey}} 
//this example returns at most 20 draft invoices ordered from oldest creation timestamp to newest
GET https://secure.fusebill.com/v1/DraftInvoices?pageSize=20&pageNumber=0&query=createdDate:2019-08-08|2019-08-20 
Authorization: Basic {{apikey}} 
//this example returns at most 20 draft invoices with a creation timestamp in the given range
Examples
curl –X GET https://secure.fusebill.com/v1/DraftInvoices?query={query}&pageSize=100&pageNumber=0 \ 
	-H "Content-Type: application/json" \ 
	-H "Authorization: Basic {APIKey}"
//Setup API key 
string apiKey = "{APIKey}"; 
//Configure URI 
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/DraftInvoices?query={query}&pageSize=100&pageNumber=0"); 
//Add Content type 
request.ContentType = "application/json"; 
request.ContentLength = 0; 
//Add Api key authorization 
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey); 
//Set request method 
request.Method = "GET"; 
//Perform the request 
var httpResponse = (HttpWebResponse)request.GetResponse(); 
//Record the response from our request 
var result = ""; 
using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) 
{ 
  result = streamReader.ReadToEnd(); 
}
#Import library Requests 
import requests 
#Pass in a dictionary to the Headers parameter 
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'} 
#Pass in your URI and Headers 
r = requests.get('https://secure.fusebill.com/v1/DraftInvoices?query={query}&pageSize=100&pageNumber=0', headers=headers) 
print(r.content)
Response
[ 
  { 
  "effectiveDate": "2020-02-15T05:00:00", 
  "createdDate": "2019-08-15T18:00:01", 
  "modifiedTimestamp": "2019-08-15T18:00:01.367", 
  "pendingCharges": 29.990000, 
  "customerId": 11894421, 
  "customerReference": null, 
  "currency": "USD", 
  "status": "Projected", 
  "billingPeriod": "Feb 15, 2020 to Mar 14, 2020", 
  "scheduledChargeDate": "2020-02-15T05:00:00", 
  "customerFullName": "Some Name", 
  "companyName": null, 
  "id": 14656760, 
  "uri": "https://secure.fusebill.com/v1/DraftInvoices/14656760" 
  } 
]
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Bad request, the query is not valid.  Please check your request and try again."
        }
    ]
}
Language
Authorization