post https://secure.fusebill.com/v1/SubscriptionProductPriceOverrides
This action creates a price override on a Subscription Product. The override modifies the price which will be charge from that point forward when the product charges or quantity increases and is purchased.
Request Parameters
Property | Type | Description | Required |
---|---|---|---|
chargeAmount | Decimal | The amount of the topmost price range. | Optional |
priceRanges | List of objects. Defined below | A list of quantity ranges to determine pricing. | Optional |
pricingModelType | Enum: {Standard, Stairstep, Volume, or Tiered} | Dictates how the price is calculated using the quantity. | Optional |
id | Integer | The Fusebill generated ID that uniquely identifies the subscription product the override applies to | Yes |
Price Ranges Fields
Property | Type | Description |
---|---|---|
min | Decimal | The lower bound of the range |
max | Decimal | The upper bound of the range. Null is interpreted as infinity |
price | Decimal | The price for this range |
Examples
curl -X POST "https://secure.fusebill.com/v1/SubscriptionProductPriceOverrides" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}" \
-d "{id:{subscriptionProductId},chargeAmount:15.99,priceRanges:[{min:1.0,max:3.0,price:17.99},{min:3.0,max:null,price:15.99}],pricingModelType:'Volume'}"
//Json Payload
string jsonData = "{id:{subscriptionProductId},chargeAmount:15.99,priceRanges:[{min:1.0,max:3.0,price:17.99},{min:3.0,max:null,price:15.99}],pricingModelType:'Volume'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/SubscriptionProductPriceOverrides/");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "POST";
//Add the json data to request
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(jsonData);
streamWriter.Flush();
streamWriter.Close();
}
//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 a dictionary to the Payload parameter
payload = {'id':{subscriptionProductId},'chargeAmount':15.99,'priceRanges':[{'min':1.0,'max':3.0,'price':17.99},{'min':3.0,'max':None,'price':15.99}],'pricingModelType':'Volume'}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/subscriptionProductPriceOverrides', data=json.dumps(payload), headers=headers)
print(r.content)
{
"Id": 123456789,
"chargeAmount": 10,
"priceRanges": [
{
"min": 0,
"max": null,
"amount": 10
}
],
"pricingModelType": "Standard"
}
Response
This call returns 204 No Content upon success
{
"ErrorId": 0,
"HttpStatusCode": 400,
"Errors": [
{
"Key": "Api Error",
"Value": "Unable to determine stair step"
}
]
}