get https://secure.fusebill.com/v1/DraftInvoices?query=parameterName:value&pageSize=100&pageNumber=0
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 Name | Acceptable Values | Parameter Name | Acceptable Values |
---|---|---|---|
BillingPeriodEndDate | Date Range | Customer.ModifiedTimestamp | Date Range |
BillingPeriodStartDate | Date Range | Customer.MonthlyRecurringRevenue | Decimal Range |
companyName | String | Customer.NetMRR | Decimal Range |
createdDate | Date Range | Customer.NetSuiteId | String |
currencyId | Integer (1-24)* | Customer.ParentId | Integer |
customerId | Integer | Customer.Status | Draft, Active, Cancelled, Hold, Suspended |
Customer.AccountStatus | Good, PoorStanding, Collection | effectiveDate | Date Range |
Customer.Arbalance | Decimal Range | firstName | String |
Customer.CreatedTimestamp | Date Range | lastName | String |
Customer.CurrentMrr | Decimal Range | middleName | String |
Customer.CurrentNetMrr | Decimal Range | modifiedTimestamp | Date Range |
Customer.CustomerReference.Reference1 | String | pendingCharges | Decimal Range |
Customer.CustomerReference.Reference2 | String | reference | String |
Customer.CustomerReference.Reference3 | String | status | Ready, 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."
}
]
}