Create Bulk Price Change Job

This endpoint allows a plan subscriber bulk price change push-out job to be created. In response you will get a service job Id. Use that ID to start the job, and to poll that job if it's long-running.

Path Parameters

PropertyTypeDescription
planIdNumberThe Fusebill generated ID of the plan for which the subscriber price push-out is intended.

Request Parameters

Required
planProductIdsList of numbers.This is the list of specific plan products to push out the pricing for. An empty list is interpreted to mean all.Yes
selectAllBooleanIf false, then only the list of subscriptions in subscriptionIds will receive the push-out. If true, then all subscriptions matching the search criteria* will receive the push-outYes
subscriptionIdsList of numbersif selectAll is false, then this is the list of specific subscriptions to push out the pricing to. if selectAll is true, then this is the list of specific subscriptions to exclude from the push out.Optional
filterOptionsObject. Defined belowAn object used to filter the subscribers to a subset for the price push out.Optional

*The search can either be done through a query or the filterOptions object, but not both.

Filter Options Object

PropertyTypeDesctiption
customerCreatedDateRangeStartDateDatetimeUsed to exclude subscriptions belonging to customers created before the datetime.
customerCreatedDateRangeEndDateDatetimeUsed to exclude subscriptions belonging to customers created after the datetime.
subscriptionCreatedDateRangeStartDateDatetimeUsed to exclude subscriptions created before the datetime.
subscriptionCreatedDateRangeEndDateDatetimeUsed to exclude subscriptions created after the datetime.
nextBillingDateRangeStartDateDatetimeUsed to exclude subscriptions whose next billing date is before the datetime.
nextBillingDateRangeEndDateDatetimeUsed to exclude subscriptions whose next billing date is after the datetime.
customerStatusesString. Comma separated list of customer statusesUsed to filter down to subscriptions belonging to customers with the given statuses.
subscriptionStatusesString. Comma separated list of subscription statusesUsed to filter down to subscriptions with the given statuses.
intervalsString. Comma separated list of intervalsUsed to filter down to subscriptions of the given interval.
excludedProductsString. Comma separatedUsed to filter down to subscriptions which do not have the given products
code1String. Comma separated List of sales tracking code 1 IDsUsed to filter down to subscriptions belonging to customers with the given sales tracking codes.
code2String. Comma separated List of sales tracking code 2 IDsUsed to filter down to subscriptions belonging to customers with the given sales tracking codes.
code3String. Comma separated List of sales tracking code 3 IDsUsed to filter down to subscriptions belonging to customers with the given sales tracking codes.
code4String. Comma separated List of sales tracking code 4 IDsUsed to filter down to subscriptions belonging to customers with the given sales tracking codes.
code5String. Comma separated List of sales tracking code 5 IDsUsed to filter down to subscriptions belonging to customers with the given sales tracking codes.

This call supports string filtering (Read More) and datetime/numeric range filtering (Read More)
&query=parameterName:Value

Parameter NameAcceptable ValuesParameter NameAcceptable Values
CompanyNameStringReference3String
CustomerCreatedTimestampDate RangeSalesTrackingCode1CodeString
CustomerIdStringSalesTrackingCode1NameString
FirstNameStringSalesTrackingCode2CodeString
FusebillIdIntegerSalesTrackingCode2NameString
IntervalMonthly, YearlySalesTrackingCode3CodeString
LastNameStringSalesTrackingCode3NameString
MiddleNameStringSalesTrackingCode4CodeString
NextBillingDateDate RangeSalesTrackingCode4NameString
NextRechargeDateDate RangeSalesTrackingCode5CodeString
NumberOfIntervalsIntegerSalesTrackingCode5NameString
PrimaryEmailStringSuffixString
Reference1StringSubscriptionStatusActive, Draft, Cancelled, Provisioning, Expired
Reference2StringSubscriptionCreatedTimestampDate Range
Examples
curl –X POST https://secure.fusebill.com/v1/Subscribers/123/ImportBulkPriceChange
-H "Content-Type: application/json" \ 
-H "Authorization: Basic {APIKey}" \ 
-d "{planProductIds:[],selectAll:true}"
//Json Payload
string jsonData =
  "{planProductIds:[],selectAll:true}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/Subscribers/123/ImportBulkPriceChange");
//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 = {'planProductIds':[],'selectAll':true}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/Subscribers/123/ImportBulkPriceChange', data=json.dumps(payload), headers=headers)
print(r.content)
{
  "planProductIds": [],
  "selectAll": true,
  "filterOptions": {
    "customerCreatedDateRangeStartDate": "2020-01-01T00:00:00",
    "customerCreatedDateRangeEndDate": "2020-04-01T00:00:00"
  }
}
{
  "planProductIds": [],
  "selectAll": true,
  "subscriptionIds": [
    123,
    456
  ],
  "filterOptions": {
    "customerCreatedDateRangeStartDate": "2020-01-11T20:00",
    "customerCreatedDateRangeEndDate": "2020-03-11T20:00",
    "subscriptionCreatedDateRangeStartDate": "2020-01-11T20:00",
    "subscriptionCreatedDateRangeEndDate": "2020-03-11T20:00",
    "nextBillingDateRangeStartDate": "2020-01-11T20:00",
    "nextBillingDateRangeEndDate": "2020-03-11T20:00",
    "customerStatuses": "Active,Draft",
    "subscriptionStatuses": "Active,Draft",
    "intervals": "Monthly",
    "excludedProducts": "5512,5568",
    "code1": "4536,453534",
    "code2": "624543",
    "code3": "1342",
    "code4": "143324,5324",
    "code5": "3458924,4382"
  }
}
?query=CustomerId:myCustomId;CustomerCreatedTimestamp:2021-02-02T00:00:00|2022-05-05T00:00:00
{
  "planProductIds": [],
  "selectAll": true,
  "subscriptionIds": [
    123,
    456
  ]
}
Response
{
    "serviceJobId": 2607649
}
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Unable to start a new job because an existing job with id 2607649 is in progress. Please try again when the existing job is completed."
        }
    ]
}
Language
Authorization