List Draft Invoices By Customer (Summary)

This action allows you to retrieve a list of Draft Invoices that belong to the Customer referenced. These draft invoices are summarized and do not include draft charges.

Path Parameters

PropertyTypeDescription
customerIdIntegerThis Customer ID determines which Customer account you query for Draft Invoices.

This call supports string filtering (Read More) and datetime/numeric range filtering (Read More)
&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
This call supports pagination (Read More)
&pageSize=10&pageNumber=0
This call supports sorting (Read More)
&sortOrder=Ascending or &sortOrder=Descending
&sortExpression=expression

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."
        }
    ]
}
Language
Authorization