List Billing Period Definitions of a Customer

Returns a list of billing period definition objects for a customer.

Path Parameters

PropertyTypeDescription
customerIdIntegerThe Fusebill generated ID that uniquely identifies the customer entity

This call supports string filtering (Read More) and date filtering (Read More)
&query=parameterName:Value

Parameter NamesAcceptable ValuesParameter NamesAcceptable Values
billingPeriodTypeSpecifiedDate, CustomerActivation, FirstSubscriptionActivationmostRecentBillingPeriodEndDateDateRange
intervalMonthly, YearlymostRecentBillingPeriodStartDateDateRange
invoiceDayIntegernextRechargeDateDateRange
invoiceInAdvanceIntegernumberOfIntervalsInteger
invoiceMonthIntegernumberOfSubscriptionsInteger

This call supports pagination (Read More)
&pageSize=100&pageNumber=0
This call supports sorting (Read More)
&sortOrder=Ascending or &sortOrder=Descending
&sortExpression=expression

Examples
curl -X GET "https://secure.fusebill.com/v1/customers/{customerId}/billingperioddefinitions?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/customers/{customerId}/billingperioddefinitions?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/{customerId}/billingperioddefinitions?query={query}&pageSize=100&pageNumber=0’, headers=headers)
print(r.content)
Response
[
  {
    "interval": "Monthly",
    "numberOfIntervals": 1,
    "invoiceDay": 1,
    "billingPeriodType": "SpecifiedDate",
    "invoiceMonth": null,
    "mostRecentBillingPeriodStartDate": null,
    "mostRecentBillingPeriodEndDate": null,
    "nextRechargeDate": null,
    "numberOfBillingPeriods": 2,
    "numberOfSubscriptions": 2,
    "subscriptions": [
      {
        "customerId": 648454,
        "planFrequency": {
          "planRevisionId": 305670,
          "numberOfIntervals": 1,
          "interval": "Monthly",
          "numberOfSubscriptions": 1,
          "status": "Active",
          "setupFees": [],
          "charges": [],
          "isProrated": false,
          "prorationGranularity": null,
          "planFrequencyUniqueId": 22063,
          "remainingInterval": null,
          "invoiceInAdvance": 0,
          "salesforceId": null,
          "id": 22048,
          "uri": null
        },
        "planCode": "gold",
        "planName": "Gold",
        "planDescription": null,
        "planReference": null,
        "status": "Draft",
        "reference": null,
        "subscriptionOverride": null,
        "hasPostedInvoice": false,
        "createdTimestamp": "2019-11-05T19:17:00",
        "activatedTimestamp": null,
        "provisionedTimestamp": null,
        "nextPeriodStartDate": null,
        "lastPeriodStartDate": null,
        "scheduledActivationTimestamp": null,
        "subscriptionProducts": [],
        "remainingInterval": null,
        "remainingIntervalPushOut": null,
        "openSubscriptionPeriodEndDate": null,
        "chargeDiscount": null,
        "setupFeeDiscount": null,
        "chargeDiscounts": null,
        "setupFeeDiscounts": null,
        "customFields": null,
        "planAutoApplyChanges": false,
        "autoApplyCatalogChanges": false,
        "monthlyRecurringRevenue": 0,
        "netMonthlyRecurringRevenue": 0,
        "amount": 400,
        "contractStartTimestamp": null,
        "contractEndTimestamp": null,
        "expiredTimestamp": null,
        "modifiedTimestamp": "2019-11-05T19:17:00.91",
        "coupons": [],
        "invoiceDay": null,
        "invoiceMonth": null,
        "canMigrate": null,
        "migrationDate": null,
        "scheduledMigrationDate": null,
        "subscriptionHasRecurringEndOfPeriodCharge": false,
        "nextRechargeDate": null,
        "invoiceInAdvance": 0,
        "billingPeriodDefinitionId": 232282,
        "salesforceId": null,
        "id": 305670,
        "uri": "https://secure.fusebill.com/v1/subscriptions/305670"
      },
      {
        "customerId": 648454,
        "planFrequency": {
          "planRevisionId": 305671,
          "numberOfIntervals": 1,
          "interval": "Monthly",
          "numberOfSubscriptions": 1,
          "status": "Active",
          "setupFees": [],
          "charges": [],
          "isProrated": false,
          "prorationGranularity": null,
          "planFrequencyUniqueId": 22063,
          "remainingInterval": null,
          "invoiceInAdvance": 0,
          "salesforceId": null,
          "id": 22048,
          "uri": null
        },
        "planCode": "gold",
        "planName": "Gold",
        "planDescription": null,
        "planReference": null,
        "status": "Draft",
        "reference": null,
        "subscriptionOverride": null,
        "hasPostedInvoice": false,
        "createdTimestamp": "2019-11-05T19:17:26",
        "activatedTimestamp": null,
        "provisionedTimestamp": null,
        "nextPeriodStartDate": null,
        "lastPeriodStartDate": null,
        "scheduledActivationTimestamp": null,
        "subscriptionProducts": [],
        "remainingInterval": null,
        "remainingIntervalPushOut": null,
        "openSubscriptionPeriodEndDate": null,
        "chargeDiscount": null,
        "setupFeeDiscount": null,
        "chargeDiscounts": null,
        "setupFeeDiscounts": null,
        "customFields": null,
        "planAutoApplyChanges": false,
        "autoApplyCatalogChanges": false,
        "monthlyRecurringRevenue": 0,
        "netMonthlyRecurringRevenue": 0,
        "amount": 400,
        "contractStartTimestamp": null,
        "contractEndTimestamp": null,
        "expiredTimestamp": null,
        "modifiedTimestamp": "2019-11-05T19:20:32.277",
        "coupons": [],
        "invoiceDay": null,
        "invoiceMonth": null,
        "canMigrate": null,
        "migrationDate": null,
        "scheduledMigrationDate": null,
        "subscriptionHasRecurringEndOfPeriodCharge": false,
        "nextRechargeDate": null,
        "invoiceInAdvance": 0,
        "billingPeriodDefinitionId": 232282,
        "salesforceId": null,
        "id": 305671,
        "uri": "https://secure.fusebill.com/v1/subscriptions/305671"
      }
    ],
    "canDelete": false,
    "invoiceInAdvance": 0,
    "id": 232282,
    "uri": "https://secure.fusebill.com/v1/billingperioddefinitions/232282"
  }
]
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Bad request, the query is not valid.  Please check your request and try again."
        }
    ]
}
Language
Authorization