get https://secure.fusebill.com/v1/subscriptions/getAll?query=field:queryString
This function is used to retrieve a list of subscriptions. Since this will likely return a very large list, it is strongly recommended that pagination is used.
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 | Customer.Reference | String |
BillingPeriodDefinition.Id | Integer | Customer.SalesforceId | String |
contractEndTimestamp | Date Range | Customer.Status | Draft, Active, Cancelled, Hold, Suspended |
contractStartTimestamp | Date Range | expiredTimestamp | Date Range |
createdTimestamp | Date Range | interval | Monthly, Yearly |
CurrentMrr | Decimal Range | invoiceDay | Integer (1-31) |
CurrentNetMrr | Decimal Range | modifiedTimestamp | Date Range |
Customer.AccountStatus | Good, PoorStanding, Collection | MonthlyRecurringRevenue | Decimal Range |
Customer.Arbalance | Decimal Range | NetMRR | Decimal Range |
Customer.CompanyName | String | planCode | String |
Customer.CreatedTimestamp | Date Range | planDescription | String |
Customer.CurrencyId | Integer (1-24)* | planName | String |
Customer.CurrentMrr | Decimal Range | planReference | String |
Customer.CurrentNetMrr | Decimal Range | provisionedTimestamp | Date Range |
Customer.CustomerReference.Reference1 | String | reference | String |
Customer.CustomerReference.Reference2 | String | remainingInterval | Integer |
Customer.CustomerReference.Reference3 | String | remainingIntervalPushOut | Integer |
Customer.FirstName | String | salesForceId | String |
Customer.LastName | String | scheduledActivationTimestamp | Date Range |
Customer.MiddleName | String | ScheduledMigration.PlanFamilyId | Integer |
Customer.ModifiedTimestamp | Date Range | ScheduledMigration.PlanFamilyRelationshipId | Integer |
Customer.MonthlyRecurringRevenue | Decimal Range | ScheduledMigration.PlanFrequencyId | Integer |
Customer.NetMRR | Decimal Range | ScheduledMigration.SpecifiedDate | Date Range |
Customer.NetSuiteId | String | status | Active, Draft, Cancelled, Migrated, Provisioning, Expired, Suspended, StandingOrder |
Customer.ParentId | Integer | SubscriptionOverride.Description | String |
Customer.QuickBooksId | Integer | SubscriptionOverride.Name | String |
Customer.Id | Integer |
* See here for Fusebill currency codes
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/subscriptions/getAll?pageSize=20&pageNumber=3\
-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/subscriptions/getAll?pageSize=20&pageNumber=3");
//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 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 your URI and Headers
r = requests.get('https://secure.fusebill.com/v1/subscriptions/getAll?pageSize=20&pageNumber=3, headers=headers)
print(r.content)
Response
[
{
"customerId":172677,
"planFrequency":{
"planRevisionId":122453,
"numberOfIntervals":1,
"interval":"Monthly",
"numberOfSubscriptions":1,
"status":"Migrated",
"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": "2020-04-27T19:10:13",
"scheduledMigrationDate": null,
"migrations": {
"sourceSubscriptionId": null,
"sourceRelationshipMigrationType": null,
"sourceRelationshipId": null,
"destinationSubscriptionId": 9836,
"destinationRelationshipMigrationType": "Upgrade",
"destinationRelationshipId": 3365
},
"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."
}
]
}