post https://secure.fusebill.com/v1/billingstatementSummary/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
Property | Type | Description | Required |
---|---|---|---|
customerId | Integer | The Customer ID of the customer that this billing statement applies against. | Yes |
startDate | Datetime | This is the start date of of the date range for the billing statements. | Yes |
endDate | Datetime | This is the end date of of the date range for the billing statements. | Yes |
trackedItemDisplay | Object. Defined below | This is a collection of statement display settings related to tracked items. | Optional |
Tracked Item Display Fields
Property | Type | Description | Required |
---|---|---|---|
trackedItemDisplayFormat | Enum:{SeparatePage, Inline} | Controls whether tracked items are displayed on a separate page or inline on the front page. | Optional |
showTrackedItemName | Boolean | This controls if the tracked items names are displayed. | Yes if the trackedItemDisplay object is being included in this POST request. |
showTrackedItemReference | Boolean | This controls if the tracked items refrenece are displayed. | Yes if the trackedItemDisplay object is being included in this POST request. |
showTrackedItemDescription | Boolean | This controls if the tracked items description are displayed. | Yes if the trackedItemDisplay object is being included in this POST request. |
showTrackedItemCreatedDate | Boolean | This 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"
}
]
}