Read Subscription Billing Period Definition

Pulls the Billing Period Definition for an existing subscription. This can be helpful for grouping together subscriptions onto the same invoice.

Path Parameters

PropertyTypeDescription
subscriptionIdIntegerThis is the id value which uniquely identifies which subscription to view the billing period definition for
Examples
curl -X GET "https://secure.fusebill.com/v1/BillingPeriodDefinitions/GetBySubscription/{subscriptionID}\
	-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/BillingPeriodDefinitions/GetBySubscription/{subscriptionID}");
//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/BillingPeriodDefinitions/GetBySubscription/{subscriptionID}', headers=headers)
print(r.content)
Response
{
  "currentBillingPeriodStartDate": "2020-10-29T04:00:00",
  "currentBillingPeriodEndDate": "2020-11-29T04:00:00",
  "nextRechargeDate": "2020-11-29T04:00:00",
  "invoiceDay": 4,
  "invoiceMonth": null,
  "cycle": "Monthly",
  "billingPeriodType": "SpecifiedDate",
  "createdDate": "2019-04-29T11:00:57",
  "numberOfIntervals": 3,
  "numberOfBillingPeriods": 0,
  "invoiceInAdvance": 5,
  "manuallyCreated": false,
  "paymentMethodId": null,
  "autoCollect": null,
  "autoPost": null,
  "term": "",
  "poNumber":"234-UPRC",
  "subscriptions": null,
  "id": 245166,
  "uri": "https://secure.fusebill.com/v1/BillingPeriodDefinitions/245166"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Subscription with id 82 not found."
        }
    ]
}
Language
Authorization