get
https://secure.fusebill.com/v1/Customers//DraftInvoices?query=parameterName:value&pageSize=100&pageNumber=0
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 Name | Acceptable Values | Parameter Name | Acceptable Values |
|---|---|---|---|
BillingPeriodEndDate | Date Range | firstName | String |
BillingPeriodStartDate | Date Range | lastName | String |
companyName | String | middleName | String |
createdDate | Date Range | modifiedTimestamp | Date Range |
currencyId | Integer (1-24)* | pendingCharges | Decimal Range |
customerId | Integer | reference | String |
effectiveDate | Date Range | status | Ready, 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."
}
]
} 200