get https://secure.fusebill.com/v1/customers//subscriptions?query=parameterName:value
This function is used to retrieve a list of subscriptions belonging to a customer. That customer is specified by the Fusebill generated ID.
Path Parameters
Property | Type | Description |
---|---|---|
customerId | Integer | This is the ID of the Customer who owns the Subscriptions. |
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 |
---|---|---|---|
Amount | Decimal Range | planName | String |
BillingPeriodDefinition.Id | Integer | planReference | String |
contractEndTimestamp | Date Range | provisionedTimestamp | Date Range |
contractStartTimestamp | Date Range | reference | String |
createdTimestamp | Date Range | remainingInterval | Integer |
CurrentMrr | Decimal Range | remainingIntervalPushOut | Integer |
CurrentNetMrr | Decimal Range | salesForceId | String |
expiredTimestamp | Date Range | scheduledActivationTimestamp | Date Range |
interval | Monthly, Yearly | ScheduledMigration.PlanFamilyId | Integer |
invoiceDay | Integer (1-31) | ScheduledMigration.PlanFamilyRelationshipId | Integer |
modifiedTimestamp | Date Range | ScheduledMigration.PlanFrequencyId | Integer |
MonthlyRecurringRevenue | Decimal Range | ScheduledMigration.SpecifiedDate | Date Range |
NetMRR | Decimal Range | status | Active, Draft, Cancelled, Provisioning, Expired, Migrated, Suspended, StandingOrder |
planCode | String | SubscriptionOverride.Description | String |
planDescription | String | SubscriptionOverride.Name | String |
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}/subscriptions" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//path parameter, FusebillId
int pathParameter = {customerId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/"+pathParameter+"/subscriptions");
//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/customers/{id}/subscriptions', headers=headers)
print(r.content)
Response
[
{
"customerId":172677,
"planFrequency":{
"planRevisionId":122453,
"numberOfIntervals":1,
"interval":"Monthly",
"numberOfSubscriptions":1,
"status":"Active",
"setupFees":[
{
"amount":10.0,
"currency":"USD",
"id":0,
"uri":null
}
],
"charges":[
{
"amount":2.0,
"currency":"USD",
"id":0,
"uri":null
}
],
"isProrated":false,
"prorationGranularity":null,
"planFrequencyUniqueId":114,
"remainingInterval":null,
"id":114,
"uri":null
},
"planCode":"BSC2",
"planName":"Basic",
"planDescription":"Basic Monthly Services for Kennedy Consulting",
"planReference":null,
"status":"Cancelled",
"reference":null,
"subscriptionOverride":null,
"hasPostedInvoice":true,
"createdTimestamp":"2017-01-11T18:35:37",
"activatedTimestamp":null,
"provisionedTimestamp":"2017-01-11T19:07:57",
"nextPeriodStartDate":null,
"scheduledActivationTimestamp":"2017-02-01T05:00:00",
"subscriptionProducts":[
],
"remainingInterval":null,
"remainingIntervalPushOut":null,
"openSubscriptionPeriodEndDate":null,
"chargeDiscount":null,
"setupFeeDiscount":null,
"chargeDiscounts":[
],
"setupFeeDiscounts":[
],
"customFields":null,
"planAutoApplyChanges":false,
"autoApplyCatalogChanges":false,
"monthlyRecurringRevenue":0.0000,
"netMonthlyRecurringRevenue":0.0000,
"amount":12.0000,
"contractStartTimestamp":null,
"contractEndTimestamp":null,
"expiredTimestamp":null,
"cancellationTimestamp": null,
"modifiedTimestamp": "2020-04-27T19:10:14.023",
"coupons":[
],
"invoiceDay": 1,
"invoiceMonth": null,
"canMigrate": false,
"migrationDate": null,
"scheduledMigrationDate": null,
"migrations": null,
"subscriptionHasRecurringEndOfPeriodCharge":false,
"id":122453,
"uri":"https://secure.fusebill.com/v1/subscriptions/122453"
}
]
{
"ErrorId": 0,
"HttpStatusCode": 400,
"Errors": [
{
"Key": "Api Error",
"Value": "Bad request, the query is not valid. Please check your request and try again."
}
]
}