post https://secure.fusebill.com/v1/Subscribers//ImportBulkPriceChange
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
Property | Type | Description |
---|---|---|
planId | Number | The Fusebill generated ID of the plan for which the subscriber price push-out is intended. |
Request Parameters
Required | |||
---|---|---|---|
planProductIds | List 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 |
selectAll | Boolean | If 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-out | Yes |
subscriptionIds | List of numbers | if 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 |
filterOptions | Object. Defined below | An 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
Property | Type | Desctiption |
---|---|---|
customerCreatedDateRangeStartDate | Datetime | Used to exclude subscriptions belonging to customers created before the datetime. |
customerCreatedDateRangeEndDate | Datetime | Used to exclude subscriptions belonging to customers created after the datetime. |
subscriptionCreatedDateRangeStartDate | Datetime | Used to exclude subscriptions created before the datetime. |
subscriptionCreatedDateRangeEndDate | Datetime | Used to exclude subscriptions created after the datetime. |
nextBillingDateRangeStartDate | Datetime | Used to exclude subscriptions whose next billing date is before the datetime. |
nextBillingDateRangeEndDate | Datetime | Used to exclude subscriptions whose next billing date is after the datetime. |
customerStatuses | String. Comma separated list of customer statuses | Used to filter down to subscriptions belonging to customers with the given statuses. |
subscriptionStatuses | String. Comma separated list of subscription statuses | Used to filter down to subscriptions with the given statuses. |
intervals | String. Comma separated list of intervals | Used to filter down to subscriptions of the given interval. |
excludedProducts | String. Comma separated | Used to filter down to subscriptions which do not have the given products |
code1 | String. Comma separated List of sales tracking code 1 IDs | Used to filter down to subscriptions belonging to customers with the given sales tracking codes. |
code2 | String. Comma separated List of sales tracking code 2 IDs | Used to filter down to subscriptions belonging to customers with the given sales tracking codes. |
code3 | String. Comma separated List of sales tracking code 3 IDs | Used to filter down to subscriptions belonging to customers with the given sales tracking codes. |
code4 | String. Comma separated List of sales tracking code 4 IDs | Used to filter down to subscriptions belonging to customers with the given sales tracking codes. |
code5 | String. Comma separated List of sales tracking code 5 IDs | Used 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 Name | Acceptable Values | Parameter Name | Acceptable Values |
---|---|---|---|
CompanyName | String | Reference3 | String |
CustomerCreatedTimestamp | Date Range | SalesTrackingCode1Code | String |
CustomerId | String | SalesTrackingCode1Name | String |
FirstName | String | SalesTrackingCode2Code | String |
FusebillId | Integer | SalesTrackingCode2Name | String |
Interval | Monthly, Yearly | SalesTrackingCode3Code | String |
LastName | String | SalesTrackingCode3Name | String |
MiddleName | String | SalesTrackingCode4Code | String |
NextBillingDate | Date Range | SalesTrackingCode4Name | String |
NextRechargeDate | Date Range | SalesTrackingCode5Code | String |
NumberOfIntervals | Integer | SalesTrackingCode5Name | String |
PrimaryEmail | String | Suffix | String |
Reference1 | String | SubscriptionStatus | Active, Draft, Cancelled, Provisioning, Expired |
Reference2 | String | SubscriptionCreatedTimestamp | Date 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."
}
]
}