Create Billing Statement Summary - PDF

This function is used to generate a billing statement Summaries as a PDF.

Please note all time fields are in UTC Time.

Request Parameters

PropertyTypeDescriptionRequired
customerIdIntegerThe Customer ID of the customer that this billing statement applies against.Yes
startDateDatetimeThis is the start date of of the date range for the billing statements.Yes
endDateDatetimeThis is the end date of of the date range for the billing statements.Yes
trackedItemDisplayObject. Defined belowThis is a collection of statement display settings related to tracked items.Optional

Tracked Item Display Fields

PropertyTypeDescriptionRequired
trackedItemDisplayFormatEnum:{SeparatePage, Inline}Controls whether tracked items are displayed on a separate page or inline on the front page.Optional
showTrackedItemNameBooleanThis controls if the tracked items names are displayed.Yes if the trackedItemDisplay object is being included in this POST request.
showTrackedItemReferenceBooleanThis controls if the tracked items refrenece are displayed.Yes if the trackedItemDisplay object is being included in this POST request.
showTrackedItemDescriptionBooleanThis controls if the tracked items description are displayed.Yes if the trackedItemDisplay object is being included in this POST request.
showTrackedItemCreatedDateBooleanThis field controls if the tracked items creation dates are displayed.Yes if the trackedItemDisplay object is being included in this POST request.
Examples
curl -X POST "https://secure.fusebill.com/v1/billingstatementSummary/pdf" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{customerId:{customerId},startDate:'2017-01-01',endDate:'2017-01-31'}"
//Json Payload
string jsonData = "{customerId:{customerId},startDate:'2017-01-01',endDate:'2017-01-31'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/billingstatementSummary/pdf");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic " + apiKey);
//Set request method
request.Method = "POST";
//Add the json data to request
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
  streamWriter.Write(jsonData);
  streamWriter.Flush();
  streamWriter.Close();
}
//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 JSON
import json
#Import library Requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in a dictionary to the Payload parameter
payload = {"customerId":{id},"startDate":'2017-01-01',"endDate":'2017-02-10'}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/billingstatementSummary/pdf', data=json.dumps(payload), headers=headers)
print(r.content)
{
  "customerId": 655080,
  "startDate": "2019-10-27T15:17:25+00:00",
  "endDate": "2019-11-26T15:17:25+00:00",
  "trackedItemDisplay": {
	"trackedItemDisplayFormat":"Inline",
    "showTrackedItemName": true,
    "showTrackedItemReference": false,
    "showTrackedItemDescription": true,
    "showTrackedItemCreatedDate": true
  }
}
Response
A PDF is returned upon success
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "entity.TrackedItemDisplay.TrackedItemDisplayFormat",
            "Value": "Allowable Tracked Item Display Format values are: Inline, SeparatePage"
        }
    ]
}
Language
Authorization