get https://secure.fusebill.com/v1/Plans/
This function is used to retrieve a Plan object by its unique plan ID. It can also be used to get a clean template for making multiple changes in a subscription creation post.
Path Parameters
Property | Type | Descripton |
---|---|---|
planId | Integer | This is the ID value which uniquely identifies this Plan in the Fusebill system. This value is unique to each Plan. This is the Id of the Plan you want to retrieve. |
URL Parameters
Property | Type | Description |
---|---|---|
view | Enum:{subscription} | Changes the returned payload. Setting it to "subscription" will return a subscription creation payload. |
interval | Enum:{monthly, yearly} | Select which base the subscription billing period is built out of. |
numberOfIntervals | Integer | Number of intervals in a billing period. This is combined with interval to find the correct payload to return. |
Examples
curl -X GET "https://secure.fusebill.com/v1/Plans/{planId}" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//query parameter
int planId = {planId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/Plans/" + planId);
//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/Plans/{id}', headers=headers)
print(r.content)
Response
{
"code":"BSC2",
"name":"Basic",
"reference":null,
"description":"Basic Monthly Services for Kennedy Consulting",
"longdescription":"this is the entry level subscription for Kennedy Consulting",
"status":"Active",
"modificationTimestamp":"0001-01-01T00:00:00",
"planFrequencies":[
{
"planRevisionId":247,
"numberOfIntervals":1,
"interval":"Monthly",
"numberOfSubscriptions":2,
"status":"Active",
"setupFees":[
{
"amount":10.000000,
"currency":"USD",
"id":0,
"uri":null
}
],
"charges":[
{
"amount":2.000000,
"currency":"USD",
"id":0,
"uri":null
}
],
"isProrated":false,
"prorationGranularity":null,
"planFrequencyUniqueId":114,
"remainingInterval":null,
"id":114,
"uri":null
}
],
"autoApplyChanges":false,
"id":114,
"uri":"https://secure.fusebill.com/v1/Plans/114"
}
{
"ErrorId": 0,
"HttpStatusCode": 404,
"Errors": [
{
"Key": "Api Error",
"Value": "Plan with id 5 not found."
}
]
}