List Draft Invoices By Customer (Summary)

Query, paginate, and sort draft invoice summaries for a customer.


This call supports querying, pagination, and sorting. For syntax and examples, see Pagination, Filtering, Sorting, and Event Suppression.
&query=parameterName:Value

Parameter NameAcceptable ValuesParameter NameAcceptable Values
BillingPeriodEndDateDate RangefirstNameString
BillingPeriodStartDateDate RangelastNameString
companyNameStringmiddleNameString
createdDateDate RangemodifiedTimestampDate Range
currencyIdInteger (1-24)*pendingChargesDecimal Range
customerIdIntegerreferenceString
effectiveDateDate RangestatusReady, Pending, Projected

*See here for Fusebill currency codes
Use &pageSize=10&pageNumber=0 for pagination.
Use &sortOrder=Ascending or &sortOrder=Descending with &sortExpression=expression for sorting.

Examples
curl -X GET "https://secure.fusebill.com/v1/Customers/{customerId}/DraftInvoices?query={query}&pageSize=100&pageNumber=0" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//query parameter
int customerId = {customerId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/" + customerId + "/DraftInvoices/?query={query}&pageSize=100&pageNumber=0");
//Add Content type
request.ContentType = "application/json";
//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/customers/{id}/DraftInvoices?query={query}&pageSize=100&pageNumber=0', headers=headers)
print(r.content)
Response
[ 
   { 
      "effectiveDate":null,
      "createdDate":"2017-01-13T22:00:06",
      "pendingCharges":15.990000,
      "customerId":172677,
      "customerReference":"1337",
      "currency":"USD",
      "status":"Pending",
      "billingPeriod":"Jan 11, 2017 to Jan 31, 2017",
      "scheduledChargeDate":null,
      "customerFullName":"John Doe",
      "companyName":"Kennedy Consulting",
      "id":164264,
      "uri":"https://secure.fusebill.com/v1/DraftInvoices/164264"
   }
]
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Customer with id 1 not found."
        }
    ]
}
Path Params
integer
required

This Customer ID determines which Customer account you query for Draft Invoices.

Response
200
Language
Credentials
Header
LoadingLoading…