Integrate with Fusebill's API to Automate Invoices, Payments and Collections

Dive into our comprehensive Documentation, API Reference and Tutorials to start working with the Fusebill Subscription Billing platform. Connect easily with Fusebill support to help get your integrations to market as quickly and as seamlessly as possible.

Get Started
 

Overview

The Fusebill API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website's client-side code). JSON is returned by all API responses, including errors.

Fusebill Sandbox Account

Before you do anything, you should work with your implementation specialist to get a sandbox account. One will be used during the initial implementation process, so a member of your team should already have access to it.

Example Requests

Sample API calls are provided next to each method using cURL, a common command line tool for performing HTTP requests. All you need to do is drop in your specific parameters, and you can test the calls from the command line. If the command line isn’t your preference, a great alternative is POSTMAN, an easy-to-use tool for working with a REST API. Additionally, there are usage examples in C# and Python, and sample JSON payloads where relevant.

Sample workflows and tutorials walking you through common use cases and best practices are also available.

Fusebill uses the Fusebill API

In order to ensure our API serves the needs of our customers and is a pleasure for developers to use, the development team at Fusebill builds all of our account and customer-facing applications using the Fusebill API.

We want to ensure our API has a stable interface and performs well under the stresses of real-world use. To ensure we provide the best possible solutions to integrators, we first launch features against a private API resource. As we become confident in the interface and performance stability of these new resources, they may be made available through the Fusebill API.

Suggest Edits

Resources

 

API Resources URLs

The base URL for all Fusebill API calls is secure.fusebill.com. To this base you would append the URLs described in this documentation.

Example

GET secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0 will return the list of up to 100 customers from your production account.

Some users may have older Fusebill testing environments that are accessed via stg-admin.fusebill.com instead of the regular admin.fusebill.com.

In the case where you are working out of one of these accounts, the base API URL is stg-secure.fusebill.com/v1/ instead of secure.fusebill.com/v1

Resource URLs

Many of the Fusebill API resource URLs are structured in a limited hierarchy. There are a number of parent URLs followed by a number of child URLs. The child URLs return a list of child resources. Individual resources in this list are then accessed at parent URLs.

Example

GET secure.fusebill.com/v1/customers returns a list of customers
GET secure.fusebill.com/v1/customers/{id} returns a single customer
GET secure.fusebill.com/v1/customers/{id}/subscriptions returns a list of all subscriptions belonging to the customer
GET secure.fusebill.com/v1/subscriptions/{id} returns a single subscription

Each resource contains a URI that can be used to access it. We recommend following the URIs in the resources as opposed to hard coding URLs because it reduces the amount of work necessary to integrate and keep URL structure decoupled from your implementation.

Suggest Edits

Authentication and Identification

 

Authenticate your account when using the API by including your secret API key in the request. You can manage your API key in Fusebill's UI. Your API key carries many privileges, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas such GitHub or client-side code.

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value -H "Authorization: Basic YourAPIKeyHere" \. You do not need to provide a password.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Since most PUT, PATCH, and POST requests require a JSON body, API calls will often require an additional header -H Content-Type: application/json to indicate the JSON content.

Optionally, the special header -H "x-audit-source: customString" \ can be used to identify the source of the API call. When looking at the audit log report in the UI, any entry for a change via API will be marked as having the source "API" unless this header is used to override that string to something more useful. For example, if the API calls are coming from a registration page you can set x-audit-source to "API - Registration Page". This is the audit log as seen through the UI:

Error Messages

Fusebill uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.), and codes in the 5xx range indicate an error with Fusebill's servers (these are rare). Basic codes below.

Error Code
Detail

200 - OK

Everything worked as expected

400 - Bad Request

The request could not be understood by the server due to malformed syntax. The client should not repeat the request without making appropriate changes

401 - Unauthorized

Missing or invalid authorization.

Check your API Key and which environment the call is being made against.

404 - Not Found

The requested resource could not be found. Verify the endpoint in use, or the resource ID provided.

409 - Conflict

The format is valid but the request fails business rules. For example - activating a subscription that is already active

429 - Too Many Requests

API Rate limit has been exceeded.

500 - Server Error

System error with Fusebill API

Note

Not all errors map cleanly onto HTTP response codes, however, when a request is valid but does not complete successfully (e.g., a creating a customer), we return a 4xx error code.

Handling Errors

Our API libraries raise exceptions for many reasons, such as a failed charge, invalid parameters, authentication errors, and network unavailability. We recommend writing code that gracefully handles all possible API exceptions

Example Error Response
{
   "ErrorId":0,
   "HttpStatusCode":400,
   "Errors":[
      {
         "Key":"Api Error",
         "Value":"Authorization key is not in the correct format."
      }
   ]
}
Suggest Edits

Rate Limits

 

The Fusebill API is rate-limited under the following constraints:

  • Maximum of 1,000 requests per minute
  • Maximum of 180,000 requests per day

If either one of these maximums has been reached, an HTTP 429 error will be returned.
The body of the error will indicate which limit.

With each call to the API, limit and usage information will be returned in the headers of the response.

Header
Type
Description

X-Rate-Limit-Limit-Minute

Integer

The maximum number of requests you can make in a given minute

X-Rate-Limit-Remaining-Minute

Integer

The remaining number of requests you can make for the given minute

X-Rate-Limit-Reset-Minute

Timestamp

The timestamp indicating when the next minute starts. At this timestamp X-Rate-Limit-Remaining-Minute is set to equal X-Rate-Limit-Limit-Minute

X-Rate-Limit-Limit-Day

Integer

The maximum number of requests you can make in a given day

X-Rate-Limit-Remaining-Day

Integer

The remaining number of requests you can make for the given day

X-Rate-Limit-Reset-Day

Timestamp

The timestamp indicating when the next day starts. At this timestamp X-Rate-Limit-Remaining-Day is set to equal X-Rate-Limit-Limit-Day

Suggest Edits

Pagination

 

For API requests that return a list, Fusebill limits the maximum number of returned JSON entities. This is a maximum threshold that varies from entity type to entity type but is never below 1,000. For reading a large list of entities, the query string parameters pageNumber and pageSize can be used to paginate the results.

Example

Read the start of the list:

GET https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0

This request would read the first 100 customers.

Continue reading the list

GET https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=1

And that request would read the next page of 100 customers

Custom Pagination Headers

To make pagination easier, there are special custom headers Fusebill sends as part of the HTTPS response. These allow for simple programmatic reading of the list.

Header
Type
Description

X-NextPage

Integer

Number of the next available page

X-Count

Integer

The total number of results that match the search criteria. This can be used to deduce how many entities match the search criteria if filtering is being used

X-MaxCount

Integer

Total number of results

X-CurrentPage

Integer

Number of the current page

X-PreviousPage

Integer

Number for the previous page. -1 indicates there is no previous page

X-PageSize

Integer

Maximum number on the current page

X-MaxPageIndex

Integer

Number of the Last page

X-SortOrder

String

Orientation the list is sorted by (Ascending or Descending)

X-SortExpression

String

The object field being sorted on

Suggest Edits

String Filtering

 

For API requests that return a list, Fusebill can filter the results based on given criteria. This is done through a specific query string parameter called query which can be used for field value matching.

Examples

A: Simple matching on one field

GET https://secure.fusebill.com/v1/customers?pageSize=1&pageNumber=0&query=firstName:Jessica

This call returns up to 1 customer entity with the firstName “Jessica”. The colon character separates the query parameter name from the value being matched against. The available query parameter names are often the same as the field names in the response JSON. These query parameter names are provided in this API reference for the relevant calls.

B: Simple matching on two fields

GET https://secure.fusebill.com/v1/customers?pageSize=1&pageNumber=0&query=firstName:Jessica;lastName:Smithson

This call returns up to 1 customer entity with the firstName “Jessica” and the lastName “Smithson”. The semicolon separates the filter-value pairs

C: Special value matching (null)

https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&query=reference:[empty]

This call returns up to 100 customer entities with no value for reference. This is useful if there is a need to ensure no customers are without a custom value for reference. “[empty]” is a special string used to check if a field is null, since “null” would be interpreted as a string.

D: Partial matching

https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&query=primaryPhone:555*

This call returns up to 100 customer entities such that the value of their primaryPhone field starts with area code 555. The asterisk simply means to accept 0 to infinity additional characters, and more than one asterisk can be used. If the query string were query=primaryPhone:*555* then phone numbers like “5556780987”, “4555671234”, and “2504741555” would all count as matches.

E: Set matching

https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&query=status:Active,Draft

The comma allows for multiple conditions. This call will return up to 100 customers with status equal to “Active” or “Draft”.

F: special character matching

https://secure.fusebill.com/v1/customers?pageSize=1&pageNumber=0&query=reference:am%26per%26sand

This call returns up to 1 customer entities with the value of reference equal to "am&per&sand". Since the ampersand character is used to separate query strings, its inclusion in the URL would be problematic. Similar problems would occur if a comma character were used. To solve this issue, the URL encoding for these characters must be used explicitly.

Suggest Edits

Date Filtering

 

For API requests that return a list, Fusebill can filter the results based on given criteria. This is done through a specific query parameter called query which can be used for date range filtering.

Examples

A: Simple closed interval

GET https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&query=createdTimestamp:2018-01-01|2019-01-01

This call returns up to 100 customers who were created in the system during 2018. The colon character separates the query parameter name from the range being used. The available query parameter names are often the same as the field names in the JSON. These query parameter names are provided in the API reference for the relevant calls.
The pipe character is used to separate the lower time bound from the upper time bound.

B: Lower bounded interval

GET https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&query=modifiedTimestamp:2018-01-01|

This call returns up to 100 customers with a last modified timestamp of January 1st 2018 or beyond.

C: Upper bounded interval

GET https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&query=createdTimestamp:|2019-01-01

This call returns up to 100 customers created before 2019-01-01.

A note on formatting:
The format for a timestamp is YYYY-MM-DD but more granularity can be used e.g. YYYY-MM-DDTHH:mm:SS. In fact, when a range like 2018-01-01|2019-01-01 is provided Fusebill automatically translates that into 2018-01-01T00:00:00|2019-01-01T00:00:00 which is why the range would include timestamps that occurred on 2018-01-01 but not 2019-01-01.

 

For API requests that return a list, Fusebill can sort the array of JSON objects as a part of the request. The two query string parameters used for this are sortOrder and sortExpression. When using a custom sort scheme, both query string parameters must be provided in the URL.

Example: sort on time

GET https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&sortOrder=Descending&sortExpression=createdTimestamp

This call returns 100 customer entities ordered from the most recently created to the 100th most recently created customer. sortOrder is an enum that can be either “Ascending” or “Descending”. sortExpression is a query parameter name. Any query parameter name that can be used for string matching or date filtering can be used for sortExpression.

Example: sort on string

GET https://secure.fusebill.com/v1/customers?pageSize=100&pageNumber=0&sortOrder=Ascending&sortExpression=firstName

This call returns 100 customer entities sorted by the lexicographical order of the firstName field. Lexicographical order for a string field goes from null to digits to letters. This would be an ascending order of strings: null, “123”, “234”, “alpha”, “bravo”...

You can verify what's being sorted on by checking the custom response headers X-SortOrder and X-SortExpression

Suggest Edits

Customer Object

The customer object is a basic customer record in the Fusebill system. It includes the Fusebill generated ID that is used to uniquely identify the particular customer throughout the system.

A customer represents a billed entity in Fusebill. It is associated with a list of subscription objects, payment method objects, invoice objects, and many other objects in the system. Directly associated with the customer object is the customer's basic contact information. If you have your own custom IDs for your customers it may be useful to leverage the reference field (in the UI this is called "Customer ID" by default) for easy navigation through your customer base. Keep in mind that reference is a custom string that Fusebill does not enforce uniqueness for. Only the Fusebill generated id is guaranteed to be unique across your customer base as well as non-null values for portalUserName.

 

Customer Object Fields

Property
Type
Description

firstName

String

The first name of the Customer.

[Max Length: 50 characters]

middleName

String

The middle name of the Customer.

[Max Length: 50 characters]

lastName

String

The last name of the Customer.

[Max Length: 50 characters]

companyName

String

The company name associated with this Customer.

[Max Length: 50 characters]

suffix

String

The name suffix of the customer, for example Jr. or Sr.

[Max Length: 50 characters]

primaryEmail

String

The primary contact email for the Customer. Allows multiple entries in the format "emailA@email.ema; emailB@email.ema; emailC@email.ema". Invoices and other email communications will be sent to this address(s).

[Max Length: 255 characters]

primaryPhone

String

The primary contact number for the Customer.

[Max Length: 50 characters]

secondaryEmail

String

The secondary contact email for the Customer. Allows multiple entries in the format "emailA@email.ema; emailB@email.ema; emailC@email.ema". No communications are sent to this address

[Max Length: 255 characters]

secondaryPhone

String

The secondary contact number for the Customer.

[Max Length: 50 characters]

title

String

The prefix-title of the customer. Valid strings are: "Mr", "Mrs",
"Ms", "Miss" or "Dr".

reference

String

This is a free form reference field where you can store a reference string for this customer. Generally, this is used to store the reference/Id of this customer in some external system to facilitate matching up the Fusebill Customer record to that system.

[Max Length: 255 characters]

status

String

The status of the Customer. This reflects the state of the account and will indicate if the account is in "Draft", is "Active", is on "Hold", is "Suspended" or is "Cancelled".

customerAccountStatus

String

The accounting status of the Customer. This reflects the financial status of the Customer and relates to if the Customer has past-due invoices. This field will show if the customer is in "Good" standing, is in "PoorStanding" or is in "Collection" status. Customer's enter Poor Standing if they have at least one (1) unpaid, overdue Invoice. This field is not used to change status, only to show it.

[Read Only]

currency

String

The Currency configured for this Customer. The currency is represented using a 3 character ISO currency code.

[Read Only]

customerReference

Object (defined below)

This is a collection of key value pairs. Each can be used to store additional data related to this Customer including stalesTrackingCodes.

customerAcquisition

Object (defined below)

This is a collection of Strings. Each can be used to store different details about how this Customer was acquired. Generally, this is used to store marketing channel information.

monthlyRecurringRevenue

Decimal

The calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.

[Read Only]

netMonthlyRecurringRevenue

Decimal

The net MRR of the customer. Calculated by considering any discounts on the customers active subscription products. Number generated by Fusebill automatically.

[Read Only]

salesforceId

String

The Salesforce Account Id associated with this Customer. This field is only populated if you are using the Fusebill Salesforce plugin.

salesforceAccountType

String

This will dictate how the Salesforce account name will be created. Your options are:
1)"Company" where the company name and Fusebill Id will be combined and used as the account name
2)"Person" where the first and last names will be combined to populate the account name field.
3) NULL, the account level default will be used

salesforceSynchStatus

String

This setting controls if the account will synchronize the Fusebill account with Salesforce. The string options are "Enabled" or "Disabled"

[Read Only]

netsuiteId

String

If you are using a Netsuite integration this is the number which uniquely identifies the customer in Netsuite.

[Read Only]

netsuiteSynchStatus

String

This setting controls if the account will synchronize the Fusebill account with NetSuite. The string options are "Enabled" or "Disabled"

[Read Only]

netsuiteCustomerType

String

Identifies the customer type of the customer latched in NetSuite.
This field is only populated if you are using the Fusebill NetSuite plugin.
String, "Company" or "Individual", generated automatically by Fusebill, cannot be changed.

[Read Only]

portalUserName

String

If the customer has login credentials this field contains the username.

[Read Only After Set]

parentId

Integer

The Parent Id key value relates to the Fusebill hierarchy feature. If hierarchy is enabled, the parent customer will have their own parentId and a child customer will display the id of their respective parent.​

quickBooksLatchType

quickBooksId

quickBooksSyncToken

hubSpotId

modifiedTimestamp

Timestamp

The timestamp of the last time this object was modified.

[Read Only]

id

Integer

The id uniquely identifies the customer.

The id field is always included in any response from any applicable calls on a Customer. It is also often used as part a URL parameter on GET calls.

[Read Only]

uri

String

Full path to a particular customer object.

[Read Only]

Customer Reference Fields

Property
Type
Description

reference1

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

reference2

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

reference3

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

salesTrackingCodes

Object (defined below)

A collection of up to 5 SalesTrackingCode objects

SalesTrackingCode Fields

Property
Type
Description

type

String

Identification of the sales tracking code type being set. The sales tracking code type can be configured under the sales tracking code section under your account settings

By default the accepted values are "Sales Tracking Code 1", "Sales Tracking Code 2" ... up to "Sales Tracking Code 5".

If you rename your Sales Tracking code, those names or the default names can be used.

**[Max default the accepted values are "Sales Tracking Code 1", "Sales Tracking Code 2" ... up to "Sales Tracking Code 5".

[Max Length: 255 characters]

code

String

The specific sales tracking code value. The code must exist under the appropriate salestrackingcode type being referenced

[Max Length: 255 characters]

name

String

Display name

[Max Length: 255 characters]

id

Integer

The Fusebill generated ID for the Sales Tracking Code

[Read Only]

uri

String

The full path to the Sales Tracking Code object

[Read Only]

Customer Acquisition Fields

Property
Type
Description

adContent

String

Typically used to set the content description for the campaign ad. For all campaigns, or for a particular campaign, this appears as Ad Content under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

campaign

String

This variable is used to define the name of your campaign, which appears in the Analytics reports on the top-level campaign report.

[Max Length: 255 characters]

keyword

String

These are the words that visitors use to find your Website when using a search engine. Google Analytics provides a list of keywords that have been searched by users who find your Website. This information shows you what searchers are actually looking for when they find your Website. This also allows you to discover potential new keywords to target.

[Max Length: 255 characters]

landingPage

String

The first page a visitor views during a session; also known as the entrance page.

[Max Length: 255 characters]

medium

String

Typically used to define the type of the campaign, such as a banner ad, email campaign, or click ad. For all campaigns, or for a particular campaign, this appears as Keyword under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

source

String

The source variable is typically used to define where the campaign is originating from, such as a website name or a company. For all campaigns, or for a particular campaign, this appears as Source under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

id

Integer

The Fusebill generated ID for the customer this customer acquisition belongs to

[Read Only]

uri

String

The full path to the customer object this customer acquisition belongs to

[Read Only]

Suggest Edits

List Customers

This function is used to retrieve a list of customer objects.

In order to manage the size of the data returned it is strongly recommended that pagination is used.

 
gethttps://secure.fusebill.com/v1/customers/?query=parameterName:value&pageSize=100&pageNumber=0
 

This call supports String Filtering (Read More) and Date Filtering (Read More)
&query=parameterName:Value

Parameter Name
Acceptable Values
Parameter name
Acceptable Values

AccountStatus

Good, PoorStanding, Collection

HubSpotId

Integer

CompanyName

String

LastName

String

CreatedTimestamp

DateRange

MiddleName

String

CurrencyId

Integer (1-24)*

ModifiedTimestamp

DateRange

CustomerAcquisition.AdContent

String

NetsuiteEntityType

Integer (1-2)**

CustomerAcquisition.Campaign

String

NetSuiteId

String

CustomerAcquisition.LandingPage

String

NetSuiteSynchStatusId

Enabled, Disabled

CustomerAcquisition.Medium

String

ParentId

Integer

CustomerAcquisition.Source

String

PrimaryEmail

String

CustomerReference.Reference1

String

PrimaryPhone

String

CustomerReference.Reference2

String

QuickBooksId

Integer

CustomerReference.Reference3

String

QuickBooksLatchTypeId

CreateNew, LatchExisting, DoNothing

CustomerReference.SalesTrackingCode1.Code

String

QuickBooksSyncToken

Integer

CustomerReference.SalesTrackingCode1.Name

String

Reference

String

CustomerReference.SalesTrackingCode2.Code

String

SalesforceAccountType

Company, Person

CustomerReference.SalesTrackingCode2.Name

String

SalesforceId

String

CustomerReference.SalesTrackingCode3.Code

String

SalesforceSynchStatus

Enabled, Disabled

CustomerReference.SalesTrackingCode3.Name

String

SecondaryEmail

String

CustomerReference.SalesTrackingCode4.Code

String

SecondaryPhone

String

CustomerReference.SalesTrackingCode4.Name

String

Status

Draft, Active, Cancelled, Hold, Suspended

CustomerReference.SalesTrackingCode5.Code

String

Suffix

String

CustomerReference.SalesTrackingCode5.Name

String

Title

Mr, Mrs, Ms, Miss, Dr

FirstName

String

*See here for Fusebill currency codes
**The NetsuiteEntityType is 1 for “Customer – Individual” and 2 for "Customer – Company”
This call supports Pagination (Read More)
&pageSize=100&pageNumber=0
This call supports Sorting Read More
&sortOrder=Ascending or &sortOrder=Descending
&sortExpression=expression

Example
curl -X GET "https://secure.fusebill.com/v1/customers?query=firstName:John" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//Query String
string queryString = "firstName:john";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://stg-secure.fusebill.com/v1/customers/?query="+queryString);
//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 requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI, Payload and Headers
r = requests.get('https://stg-secure.fusebill.com/v1/customers?query=firstName:John', headers=headers)
print(r.content)
Response
[
  {
    "firstName": "Bowen",
    "middleName": "Laurie",
    "lastName": "Rosales",
    "companyName": "Manglo",
    "suffix": "Jr.",
    "primaryEmail": "adarowe@aclima.com",
    "primaryPhone": 9454323791,
    "secondaryEmail": "lindsaywhitney@ziore.com",
    "secondaryPhone": 8784522075,
    "title": "Dr",
    "reference": 100986,
    "status": "Active",
    "customerAccountStatus": "Good",
    "currency": "USD",
    "customerReference": {
      "reference1": null,
      "reference2": "customValue",
      "reference3": null,
      "salesTrackingCodes": [],
      "id": 12000750,
      "uri": "https://secure.fusebill.com/v1/customers/12000750"
    },
    "customerAcquisition": {
      "adContent": null,
      "campaign": null,
      "keyword": null,
      "landingPage": null,
      "medium": null,
      "source": null,
      "id": 12000750,
      "uri": "https://secure.fusebill.com/v1/customers/12000750"
    },
    "monthlyRecurringRevenue": 250,
    "netMonthlyRecurringRevenue": 220,
    "salesforceId": 12345678,
    "salesforceAccountType": null,
    "salesforceSynchStatus": "Enabled",
    "netsuiteId": 12345678,
    "netsuiteSynchStatus": "Enabled",
    "netsuiteCustomerType": "Individual",
    "portalUserName": "Bowen1974",
    "parentId": 12000749,
    "quickBooksLatchType": null,
    "quickBooksId": null,
    "quickBooksSyncToken": null,
    "hubSpotId": null,
    "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  }
]
//if a malformed query string is used:
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Bad request, the query is not valid.  Please check your request and try again."
        }
    ]
}
Suggest Edits

Read Customer Overview

This resource is used to retrieve a short form customer object with some additional payment and account balance information. This is ideal for quickly checking if a customer has an unpaid balance, has a credit, or pending charges.

 
gethttps://secure.fusebill.com/v1/customers/id/overview
 

URL Properties

Property
Type
Description

id

Integer

This is the the Id value which uniquely identifies this Customer record in the Fusebill system. This value is unique to each customer.

Examples
curl -X GET "https://secure.fusebill.com/v1/customers/{id}/Overview" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//Path parameter, Fusebill Id which corresponds to the customerId 
int pathParameter = {customerId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://stg-secure.fusebill.com/v1/customers/"+pathParameter+"/Overview");
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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, Payload and Headers
r = requests.get('https://stg-secure.fusebill.com/v1/customers/{id}/overview', headers=headers)
print(r.content)
Response
{
  "title": "Dr",
  "firstName": "Foreman",
  "middleName": "Mai",
  "lastName": "Travis",
  "suffix": "Jr.",
  "primaryEmail": "terrawade@balooba.com",
  "primaryPhone": 9934643454,
  "companyName": 9984242269,
  "reference": 100986,
  "createdTimestamp": "2019-11-06T14:19:01",
  "status": "Active",
  "customerAccountStatus": "Good",
  "pendingCharges": 0,
  "arBalance": 0,
  "unallocatedPayments": 0,
  "unallocatedCredits": 0,
  "unallocatedOpeningBalance": 0,
  "currency": "USD",
  "daysUntilSuspension": 0,
  "daysUntilCancellation": 0,
  "customerAccountStatusTimestamp": "2019-11-06T14:19:01",
  "statusTimestamp": "2019-11-06T14:19:01",
  "lifetimeValue": 0,
  "monthlyRecurringRevenue": 0,
  "netMonthlyRecurringRevenue": 0,
  "nextBillingDate": null,
  "salesforceSynchStatus": "Enabled",
  "salesforceId": null,
  "quickbooksId": null,
  "netsuiteId": null,
  "hubSpotId": null,
  "parentId": null,
  "parentName": null,
  "isParent": false,
  "unknownPaymentActivityId": null,
  "id": 650084,
  "uri": "https://secure.fusebill.com/v1/CustomerOverview/650084"
}
Suggest Edits

Read Customer

This function is used to retrieve a customer object. Specify the unique Fusebill ID of the customer in your request.

 
gethttps://secure.fusebill.com/v1/customers/customerId
 

Property
Type
Description

customerId

integer

This is the id value which uniquely identifies a Customer record in the Fusebill system. This value is unique to each customer.

Examples
curl -X GET "https://secure.fusebill.com/v1/customers/{customerId}" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//query parameter
int queryParameter = {customerId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://stg-secure.fusebill.com/v1/customers/"+queryParameter);
//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 requests
import requests
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI, Payload and Headers
r = requests.get('https://stg-secure.fusebill.com/v1/customers/183365', headers=headers)
print(r.content)
Response
{
  "firstName": "Shields",
  "middleName": "Payne",
  "lastName": "Gillespie",
  "companyName": "Cuizine",
  "suffix": "Jr.",
  "primaryEmail": "chelseafox@hawkster.com",
  "primaryPhone": 8784473067,
  "secondaryEmail": "hutchinsonsargent@zentime.com",
  "secondaryPhone": 8955793436,
  "title": "Dr",
  "reference": 100986,
  "status": "Active",
  "customerAccountStatus": "Good",
  "currency": "USD",
  "customerReference": {
    "reference1": null,
    "reference2": "customValue",
    "reference3": null,
    "salesTrackingCodes": [],
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null,
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "monthlyRecurringRevenue": 250,
  "netMonthlyRecurringRevenue": 220,
  "salesforceId": 12345678,
  "salesforceAccountType": null,
  "salesforceSynchStatus": "Enabled",
  "netsuiteId": 12345678,
  "netsuiteSynchStatus": "Enabled",
  "netsuiteCustomerType": "Individual",
  "portalUserName": "Shields1974",
  "parentId": 12000749,
  "quickBooksLatchType": null,
  "quickBooksId": null,
  "quickBooksSyncToken": null,
  "hubSpotId": null,
  "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
  "id": 12000750,
  "uri": "https://secure.fusebill.com/v1/customers/12000750"
}
Suggest Edits

Create Customer

This function is used to create a new customer entity.

A successful result will return the id of the customer, otherwise known as the Fusebill ID. We recommend that you latch this unique ID into any system integrating with Fusebill.

It is possible to create a blank customer with no information, although we strongly recommend using at least some combination of firstName, lastName, comanyName, and primaryEmail as a bare minimum.

 
posthttps://secure.fusebill.com/v1/customers
 

If your account is configured to use more than one currency, you must specify the currency of the customer at the time of creation.

  • If no value is set, the account default will be used.
  • This value can not be edited after the customer has been created.
  • A customer can only have one currency.

Sample Requests

POST https://secure.fusebill.com/v1/customers
// Basic example to create a customer with a first/last name, company name, and email

{
    "firstName": "John",
    "lastName": "Smith",
    "companyName": "Fusebill",
    "primaryEmail": "test@example.com"
}


POST https://secure.fusebill.com/v1/customers
// This example will post a customer, and override some accounts level billing settings

{
  "firstName": "Bob",
  "companyName": "Fusebill",
  "billingSetting": [
    {
      "term": "Net30",
      "autoCollect": true,
      "rechargeType": "",
      "rechargeThresholdAmount": null,
      "rechargeTargetAmount": null,
      "statusOnThreshold": null,
      "autoPostDraftInvoice": true,
      "customerGracePeriod": 30,
      "gracePeriodExtension": null,
      "standingPoNumber": "PO#123",
      "acquisitionCost": 200,
      "showZeroDollarCharges": false,
      "taxExempt": true,
      "taxExemptCode": 123,
      "useCustomerBillingAddress": true,
      "avalaraUsageType": "",
      "vatIdentificationNumber": "",
      "customerServiceStartOption": "",
      "rollUpTaxes": null,
      "rollUpDiscounts": null
    }
  ],
  "trackedItemDisplay": [
    {
      "trackedItemDisplayFormat": null,
      "showTrackedItemName": null,
      "showTrackedItemReference": null,
      "showTrackedItemDescription": null,
      "showTrackedItemCreatedDate": null
    }
  ]
}
POST https://secure.fusebill.com/v1/customers
// This example will post a customer with basic contact details, reference data, acquisition data, Salesforce/Quickbooks ID's, and a billing address

{  
   "firstName":"Trev",
   "middleName":null,
   "lastName":"Smith",
   "companyName":"Fusebill",
   "suffix":"text",
   "primaryEmail":"test@example.com",
   "primaryPhone":"123-456-7890",
   "secondaryEmail":"test2@example.com",
   "secondaryPhone":"123-456-7890",
   "title":"Dr",
   "currency":"USD",
   "customerReference":{  
      "reference1":"google",
      "reference2":null,
      "reference3":"linkedIn",
      "salesTrackingCodes":[  

      ]
   },
   "customerAcquisition":{  
      "adContent":null,
      "campaign":null,
      "keyword":null,
      "landingPage":null,
      "medium":null,
      "source":null
   },
   "salesforceId":null,
   "salesforceAccountType":null,
   "salesforceSynchStatus":"Enabled",
   "portalUserName":"portal9000",
   "parentId":null,
   "quickBooksLatchType":null,
   "quickBooksId":null,
   "quickBooksSyncToken":null,
   "billing":{  
      "companyName":"Fusebill",
      "line1":"109 Old House Street",
      "line2":"Suite 17",
      "city":"Sittsville",
      "postalZip":"12345",
      "country":"CA",
      "state":"NY"
   },

}
POST https://secure.fusebill.com/v1/customers
// This customer will use a different currency 
// They also have separate billing & shipping addresses defined 

{  
   "firstName":"John",
   "lastName":"Smith",
   "companyName":"Fusebill",
   "primaryEmail":"test@example.com",
   "currency":"CAD",
   "billing":{  
      "companyName":"Billing Company",
      "line1":"109 Old House Street",
      "line2":"Suite 17",
      "city":"Sittsville",
      "postalZip":"12345",
      "country":"CA",
      "state":"NY"
   },
   "shipping":{  
      "companyName":"Shipping Company",
      "line1":"109 Old House Street",
      "line2":"Suite 17",
      "city":"Sittsville",
      "postalZip":"12345",
      "country":"CA",
      "state":"NY"
   }
}

Request Parameters

Property
Type
Description
Required

username

String

The username of the customer if they have login credentials [Read Only After Set]

Optional

firstName

String

The first name of the customer.

[Max Length: 50 characters]

Optional

middleName

String

The middle name of the customer.

[Max Length: 50 characters]

Optional

lastName

String

The last name of the customer.

[Max Length: 50 characters]

Optional

companyName

String

The company name associated with this customer.

[Max Length: 50 characters]

Optional

suffix

String

The name suffix of the customer, for example Jr. or Sr.

[Max Length: 50 characters]

Optional

primaryEmail

String

The primary contact email for the customer. Allows multiple entries in the format "emailA@email.ema; emailB@email.ema; emailC@email.ema". Invoices and other email communications will be sent to this address(s).

[Max Length: 255 characters]

Optional

primaryPhone

String

The primary contact number for the Customer.

[Max Length: 50 characters]

Optional

secondaryEmail

String

The secondary contact email for the customer. Allows multiple entries in the format "emailA@email.ema; emailB@email.ema; emailC@email.ema". No communications are sent to this address

[Max Length: 255 characters]

Optional

secondaryPhone

String

The secondary contact number for the customer.

[Max Length: 50 characters]

Optional

title

String

The prefix-title of the customer. Valid strings are: "Mr", "Mrs",
"Ms", "Miss" or "Dr".

Optional

reference

String

This is a free form reference field where you can store a reference string for this customer. Generally, this is used to store the reference/Id of this Customer in some external system to facilitate matching up the Fusebill Customer record to that system.

[Max Length: 255 characters]

Optional

currency

String

The Currency configured for this Customer. The currency is represented using a 3 Character ISO Currency code.

Optional

customerReference

Object (defined below)

This is a collection of key-value pairs. Each can be used to store additional data related to this Customer including salesTrackingCodes.

Optional

customerAcquisition

Object (defined below)

This is a collection of Strings. Each can be used to store different details about how this Customer was acquired. Generally, this is used to store marketing channel information.

Optional

billingSetting

Object (defined below)

Customer billing settings.

Optional

shipping

Object (defined below)

Customer shipping address.

Optional

billing

Object (defined below)

Customer billing address.

Optional

addressPreference

Object (defined below)

Set address preferences

Optional

monthlyBillingPeriodConfiguration

Object (defined below)

Monthly billing period definition for the customer.

Optional

yearlyBillingPeriodConfiguration

Object (defined below)

Annual billing period definition for the customer.

Optional

salesforceId

String

The Salesforce Account Id associated with this Customer. This field is only populated if you are using the Fusebill Salesforce plugin.

Optional

salesforceAccountType

String

This will dictate how the Salesforce account name will be created. Your options are:
1)"Company" where the company name and Fusebill Id will be combined and used as the account name
2)"Person" where the first and last names will be combined to populate the account name field.
3) NULL, the account level default will be used

Optional

salesforceSynchStatus

String

This setting controls if the account will synchronize the Fusebill account with Salesforce. The string options are "Enabled" or "Disabled"

Optional

netsuiteId

String

If you are using a Netsuite integration this is the number which uniquely identifies the customer in Netsuite.

[Read Only]

Optional

netsuiteSynchStatus

Optional

parentId

Integer

The parentId key value relates to the Fusebill hierarchy feature. If hierarchy is enabled, the parent customer will have their own parentId and a child customer will display the id of their respective parent.​

Optional

quickBooksId

Integer

Optional

quickBooksLatchType

Optional

hubSpotId

Optional

Customer Billing/Shipping Address

Property
Type
Description

companyName

String

The company name associated with this Customer.

line1

String

Line 1 of the address

line2

String

Line 2 of the address

city

String

City

postalZip

String

Postal or ZIP code

country

String

Country using 2-character ISO code

state

String

State using 2-character ISO code

Customer Reference Fields

Property
Type
Description

reference1

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

reference2

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

reference3

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

salesTrackingCodes

Object (defined below)

A collection of up to 5 SalesTrackingCode objects

SalesTracking Code Fields

Property
Type
Description

type

String

Identification of the sales tracking code type being set. The sales tracking code type can be configured under the sales tracking code section under your account settings

By default the accepted values are "Sales Tracking Code 1", "Sales Tracking Code 2" ... up to "Sales Tracking Code 5".

If you rename your Sales Tracking code, those names or the default names can be used.

**[Max default the accepted values are "Sales Tracking Code 1", "Sales Tracking Code 2" ... up to "Sales Tracking Code 5".

[Max Length: 255 characters]

code

String

The specific sales tracking code value. The code must exist under the appropriate salestrackingcode type being referenced

[Max Length: 255 characters]

Customer Acquisition Fields

Property
Type
Description

adContent

String

Typically used to set the content description for the campaign ad. For all campaigns, or for a particular campaign, this appears as Ad Content under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

campaign

String

This variable is used to define the name of your campaign, which appears in the Analytics reports on the top-level campaign report.

[Max Length: 255 characters]

keyword

String

These are the words that visitors use to find your Website when using a search engine. Google Analytics provides a list of keywords that have been searched by users who find your Website. This information shows you what searchers are actually looking for when they find your Website. This also allows you to discover potential new keywords to target.

[Max Length: 255 characters]

landingPage

String

The first page a visitor views during a session; also known as the entrance page.

[Max Length: 255 characters]

medium

String

Typically used to define the type of the campaign, such as a banner ad, email campaign, or click ad. For all campaigns, or for a particular campaign, this appears as Keyword under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

source

String

The source variable is typically used to define where the campaign is originating from, such as a website name or a company. For all campaigns, or for a particular campaign, this appears as Source under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

Customer BillingSetting

Property
Type
Description

term

String

This defines the Payment Terms for this Customer. Valid strings are "Net0", "Net5", "Net7", "Net10", "Net15", "Net21", "Net30", "Net45", "Net60", "Net75", "Net90", and "MFI1".

autocollect

String

This defines whether the billing system will automatically attempt to collect from the Customer's default payment method on file.

Valid values:
"true", "false", NULL (default)

rechargeType

String

This value should be set to "BringBalanceBackTo" in any case where you want to use the threshold billing feature.

rechargeThresholdAmount

String

This is the value which triggers a threshold collection. If the customer balance drops below this number when an invoice is posted the system will automatically collect enough funds to bring the balance back to the rechargeTargetAmount.

rechargeTargetAmount

Integer

This is the customer balance which will be collected when the customer balance dips below the threshold. For example, the threshold amount could be $20 and this value set to $50. In this case, the system will collect funds if to bring the balance back to $50 if the customer drops below $20

statusOnThreshold

Boolean

This setting determines if the customer should enter poor standing if their balance dips below the set threshold and the payment to restore the balance fails.

autoPostDraftInvoice

Boolean

This defines whether the billing system will attempt to automatically post draft Invoices against the Customer's account.

The global autoPostDraftInvoice setting is used by default and by setting this field explicitly on the Customer the setting can be overridden for this Customer.

If set to true then when an Invoice is generated in Draft status the Invoice will be automatically converted to a Posted invoice and the charges from the Invoice will be applied to the Customer. If set to false the billing system will not post the Invoices automatically. If set to NULL then the billing system will use the global autoPostDraftInvoice setting.

customerGracePeriod

Integer

This filed defines the number of days that the Customer is allowed to be in a PoorStanding status before the system will automatically place the Customer account in a Suspended state. Customer's enter PoorStanding when one or more Invoices go unpaid and enter an Overdue status.

gracePeriodExtension

Integer

This field is an add-on number of days which extends the Grace Period for this Customer. It is added to the normal Grace Period.

standingPoNumber

String

This is the PO number which will be added to this customer's invoices.

acquisitionCost

Integer

This is the cost in dollars spent to acquire this customer. This factors into the Customer Profitability metric.

showZeroDollarCharges

Boolean

This defines if this customer will show or not show $0 charges on their invoices. This can be either true, which means Fusebill will show charges, or false, which means Fusebill will hide these charges, or null which means the customer is using the account level default option.

taxExempt

Boolean

This defines if this customer should be charged taxes.

taxExemptCode

String

This is the tax exemption code for this customer. If taxExempt is set to True this field must be populated.

useCustomerBillingAddress

Boolean

If true, billing address is used as shipping address.

avalaraUsageType

String

This is a string sent to Alavara for determining the application of various sales taxes.

vatIdentificationNumber

Integer

The number associated with the clients EU Vat ID.

customerServiceStartOption

String

This setting allows you to specify how you would like the system to behave if a customer is automatically moved from Suspend Status back to Active status as a result of successfully auto-collecting outstanding balances.

rollUpTaxes

Boolean

This option determines if the taxes on the customer's invoices will appear 'rolled up' as one line (eg: Taxes: $4.56) or if the will be broken into multiple lines (eg: State Tax: $3.45 and Federal Tax: $1.34).

rollUpDiscounts

Boolean

This option determines if the discounts on the customer's invoices will appear 'rolled up' on invoices.

trackedItemDisplay

collection

see trackedItemDisplayFormat object definition below.

customerAutoCancel

Integer

overrides the account default number of days a customer is suspended before being automatically cancelled.

DefaultCancelOption

String

The earning option for when the customer is automatically cancelled. The options are "Full" (reverse all charges fully), "Unearned" (Reverse unearned amounts of all charges), and "None" (Earn all charges).

postReadyChargesOnRenew

Boolean

Controls whether ready-charges are posted upon customer renewal.

trackedItemDisplayFormat Object

Property
Type
Description

trackedItemDisplayFormat

String

One of "SeparatePage" or "Inline". Controls where tracked items are displayed on invoices for this customer

showTrackedItemName

Boolean

Controls whether the name of each tracked item appears on the invoice

showTrackedItemReference

Boolean

Controls whether the reference value of each tracked item appears on the invoice

showTrackedItemDescription

Boolean

Controls whether the description of each tracked item appears on the invoice

showTrackedItemCreatedDate

Boolean

Controls whether the created date for each tracked item appears on the invoice

Address Preference Object

Property
Type
Description

contactName

String

This is an optional field for storing the contact name of the recipient, if different from the name included in the address itself.

[Max Length: 100]

shippingInstructions

String

This free text field allows you to add shipping instructions such as "Bring to Loading Bay #7".

[Max Length: 1000]

useBillingAddressAsShippingAddress

Boolean

If true, billing address is used as the shipping address.

Monthly Billing Period Object

Property
Type
Description

type

String

Billing period types. Available options are: CustomerActivation, FirstSubscriptionActivation, SpecifiedDate.

rule

String

Invoicing rule. Available options are: SingleInvoice, MultipleInvoices, Prompt, OneInvoicePerDay.

day

Integer (1-28)

Day of the month to begin invoicing.

Annual Billing Period Object

Property
Type
Description

type

String

Billing period types. Available options are: CustomerActivation, FirstSubscriptionActivation, SpecifiedDate.

rule

String

Invoicing rule. Available options are: SingleInvoice, MultipleInvoices, Prompt, OneInvoicePerDay.

month

Integer (1-12)

Month to begin annual invoicing.

day

Integer (1-28)

Day of the month to begin invoicing.

Examples
curl -X POST "https://secure.fusebill.com/v1/customers" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{title:'Mr',firstName:'John',lastName:'Smith',companyName:'Acme Inc.'}"
//Json Payload
string jsonData = "{'firstName':'John', 'lastName':'Doe'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://stg-secure.fusebill.com/v1/customers");
//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 dict to the Payload parameter
payload = {'firstName': 'John', 'lastName': 'Smith'}
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI, Payload and Headers
r = requests.post('https://stg-secure.fusebill.com/v1/customers',data=json.dumps(payload), headers=headers)
print(r.content)
{
  "username": "Bob78",
  "firstName": "Robert",
  "middleName": "James",
  "lastName": "Smith",
  "companyName": "Fusebill",
  "suffix": "jr",
  "primaryEmail": "Bob@fusebill.com",
  "primaryPhone": 5551115555,
  "secondaryEmail": "Bob2@fusebill.com",
  "secondaryPhone": 1115551111,
  "title": "Dr",
  "reference": "CR12345",
  "currency": "USD",
  "customerReference": {
    "reference1": "custom value 1",
    "reference2": "custom value 2",
    "reference3": "custom value 3",
    "salesTrackingCodes": [
      {
        "type": "Sales Tracking Code 2",
        "code": "BravoCode"
      }
    ]
  },
  "customerAcquisition": {
    "adContent": "sample string 1",
    "campaign": "sample string 2",
    "keyword": "sample string 3",
    "landingPage": "sample string 4",
    "medium": "sample string 5",
    "source": "sample string 6"
  },
  "billingSetting": {
    "term": "Net0",
    "autoCollect": true,
    "rechargeType": "BringBalanceBackTo",
    "rechargeThresholdAmount": 100,
    "rechargeTargetAmount": 150,
    "statusOnThreshold": true,
    "autoPostDraftInvoice": true,
    "customerGracePeriod": 1,
    "gracePeriodExtension": 1,
    "showZeroDollarCharges": true,
    "taxExempt": false
  },
  "billing": {
    "companyName": "Fusebill",
    "line1": "38 Main St",
    "city": "Brisbane",
    "postalZip": 12345,
    "country": "USA",
    "state": "NM"
  },
  "Shipping": {
    "companyName": "Fusebill",
    "line1": "39 Main St",
    "city": "Brisbane",
    "postalZip": 12345,
    "country": "USA",
    "state": "NM"
  },
  "addressPreference": {
    "useBillingAddressAsShippingAddress": true
  },
  "monthlyBillingPeriodConfiguration": {
    "type": "CustomerActivation",
    "rule": "SingleInvoice",
    "day": 10
  }
}
Response
{
  "firstName": "Shields",
  "middleName": "Payne",
  "lastName": "Gillespie",
  "companyName": "Cuizine",
  "suffix": "Jr.",
  "primaryEmail": "chelseafox@hawkster.com",
  "primaryPhone": 8784473067,
  "secondaryEmail": "hutchinsonsargent@zentime.com",
  "secondaryPhone": 8955793436,
  "title": "Dr",
  "reference": 100986,
  "status": "Draft",
  "customerAccountStatus": "Good",
  "currency": "USD",
  "customerReference": {
    "reference1": null,
    "reference2": "customValue",
    "reference3": null,
    "salesTrackingCodes": [],
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null,
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "monthlyRecurringRevenue": 250,
  "netMonthlyRecurringRevenue": 220,
  "salesforceId": 12345678,
  "salesforceAccountType": null,
  "salesforceSynchStatus": "Enabled",
  "netsuiteId": 12345678,
  "netsuiteSynchStatus": "Enabled",
  "netsuiteCustomerType": "Individual",
  "portalUserName": "Shields1974",
  "parentId": 12000749,
  "quickBooksLatchType": null,
  "quickBooksId": null,
  "quickBooksSyncToken": null,
  "hubSpotId": null,
  "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
  "id": 12000750,
  "uri": "https://secure.fusebill.com/v1/customers/12000750"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "customer.PrimaryEmail",
            "Value": "Please enter valid email addresses"
        }
    ]
}
Suggest Edits

Activate Customer

This function allows you to activate a customer currently in draft status.

There are various fields in the JSON payload which are required when activating a draft customer. These options are activateAllSubscriptions , activateAllDraftPurchases and temporarilyDisableAutoPost. All of these fields are required unless preview has been set to true, in which case only the customerID is required.

To include the full invoice object created from the activation , you can include the parameter view=sideeffects in the URL. This will cause the newly created invoice object to be included in the response.

 
posthttps://secure.fusebill.com/v1/customeractivation?preview=preview&showzerodollarcharges=showzerodollarcharges&view=view
 

Sample Requests

POST https://secure.fusebill.com/v1/customerActivation?Preview=true&showzerodollarcharges=true&view=sideeffects

//This request will preview the customer activation, and show any zero dollar charges on invoices. After this call the customer will still be in draft state. 

{
  "customerId": 8708457,
  "activateAllSubscriptions": true,
  "activateAllDraftPurchases": true,
  "temporarilyDisableAutoPost": false
}


POST https://secure.fusebill.com/v1/customerActivation

//This request will activate the customer

{
  "customerId": 8708457,
  "activateAllSubscriptions": true,
  "activateAllDraftPurchases": true,
  "temporarilyDisableAutoPost": false
}
POST https://secure.fusebill.com/v1/customerActivation?view=sideeffects

//This request will activate the customer, and the resulting response will include the invoice object within the payload. 

{
  "customerId": 8708457,
  "activateAllSubscriptions": true,
  "activateAllDraftPurchases": true,
  "temporarilyDisableAutoPost": false
}

URL Parameters

Property
Type
Description
Required

preview

String

If the Preview url parameter is set to True the customer is not activated, the call will simple simulate the activation and calculate the mock invoice.

Optional

showZeroDollarCharges

Boolean

If set to true, zero dollar charges will be included on invoices.

Optional

view

String

Acceptable value is "Sideeffects". Displays resulting invoices

Optional

Request Parameters

Property
Type
Description
Required

customerId

Decimal

This is the Fusebill ID of the customer

Yes

activateAllSubscriptions

Boolean

If True, draft subscriptions will be activated along with the customer

Yes, unless preview is set to true.

activateAllDraftPurchases

Boolean

If True, draft purchases will be activated along with the customer

Yes, unless preview is set to true.

temporarilyDisableAutoPost

Boolean

This will specify whether or not the resulting invoice from this call will post the related invoice or not

Yes, unless preview is set to true.

Example
curl -X POST "https://secure.fusebill.com/v1/CustomerActivation?preview=true" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{"customerId": 8708457, "activateAllSubscriptions": true,                            	   "activateAllDraftPurchases": true, "temporarilyDisableAutoPost": false}"
//Query string
string previewQuery = "false";
//Json Payload
string jsonData = "{
  "customerId": 8708457,
  "activateAllSubscriptions": true,
  "activateAllDraftPurchases": true,
  "temporarilyDisableAutoPost": false
}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/CustomerActivation?preview="+previewQuery);
//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 json
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 = {"customerId": 8708457, "activateAllSubscriptions": true, "activateAllDraftPurchases": true, "temporarilyDisableAutoPost": false}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/CustomerActivation?preview=true',data=json.dumps(payload), headers=headers)
print(r.content)
{
  "customerId": 650512,
  "activateAllSubscriptions": true,
  "activateAllDraftPurchases": true,
  "temporarilyDisableAutoPost": true
}
Response
{
  "firstName": "Richardson",
  "middleName": "Reeves",
  "lastName": "Woods",
  "companyName": "Gadtron",
  "suffix": "Sr.",
  "primaryEmail": "millieshepherd@comtrail.com",
  "primaryPhone": 8874452248,
  "secondaryEmail": "knappchan@interloo.com",
  "secondaryPhone": 8585333923,
  "title": "Mrs",
  "reference": 100986,
  "status": "Active",
  "customerAccountStatus": "Good",
  "currency": "USD",
  "customerReference": {
    "reference1": null,
    "reference2": "customValue",
    "reference3": null,
    "salesTrackingCodes": [],
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null,
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "monthlyRecurringRevenue": 250,
  "netMonthlyRecurringRevenue": 220,
  "salesforceId": 12345678,
  "salesforceAccountType": null,
  "salesforceSynchStatus": "Enabled",
  "netsuiteId": 12345678,
  "netsuiteSynchStatus": "Enabled",
  "netsuiteCustomerType": "Individual",
  "portalUserName": "Richardson1974",
  "parentId": 12000749,
  "quickBooksLatchType": null,
  "quickBooksId": null,
  "quickBooksSyncToken": null,
  "hubSpotId": null,
  "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
  "id": 12000750,
  "uri": "https://secure.fusebill.com/v1/customers/12000750"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "This activity could not be processed since the service status is Active"
        }
    ]
}
Suggest Edits

Hold Customer

This function is used to put a customer on the hold status. Any subscriptions on the customer will be placed into status suspended.

 
posthttps://secure.fusebill.com/v1/customerhold/id
 

Path Parameters

Property
Type
Description

id

integer

This is the id value which uniquely identifies a customer record in the Fusebill system. This value is unique to each customer.

Examples
curl -X POST "https://secure.fusebill.com/v1/CustomerHold/{id}" \
	-H "Content-Type: application/json" \
	-H "Content-Length: 0" \
	-H "Authorization: Basic {APIKey}"
//path parameter, Fusebill Id which corresponds to the Id Field Returned by Create/Update customer
int pathParameter = {id};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/CustomerHold/"+pathParameter);
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "POST";
//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.post('https://secure.fusebill.com/v1/customerHold/{id}', headers=headers)
print(r.content)
This POST call does not take a JSON payload
Response
{
  "firstName": "Maryanne",
  "middleName": "Cecelia",
  "lastName": "Flores",
  "companyName": "Grok",
  "suffix": "Sr.",
  "primaryEmail": "latonyabyers@exotechno.com",
  "primaryPhone": 9594952713,
  "secondaryEmail": "leonawebb@netplode.com",
  "secondaryPhone": 8154223872,
  "title": "Mrs",
  "reference": 100986,
  "status": "Hold",
  "customerAccountStatus": "Good",
  "currency": "USD",
  "customerReference": {
    "reference1": null,
    "reference2": "customValue",
    "reference3": null,
    "salesTrackingCodes": [],
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null,
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "monthlyRecurringRevenue": 250,
  "netMonthlyRecurringRevenue": 220,
  "salesforceId": 12345678,
  "salesforceAccountType": null,
  "salesforceSynchStatus": "Enabled",
  "netsuiteId": 12345678,
  "netsuiteSynchStatus": "Enabled",
  "netsuiteCustomerType": "Individual",
  "portalUserName": "Maryanne1974",
  "parentId": 12000749,
  "quickBooksLatchType": null,
  "quickBooksId": null,
  "quickBooksSyncToken": null,
  "hubSpotId": null,
  "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
  "id": 12000750,
  "uri": "https://secure.fusebill.com/v1/customers/12000750"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Customer with id 128414930 not found."
        }
    ]
}
Suggest Edits

Un-Hold Customer

This function is used to remove the hold status from a customer. They will revert to active status.

 
posthttps://secure.fusebill.com/v1/customers/unhold
 

Request Parameters

Property
Type
Description
Required

customerId

Integer

This is the the Id value which uniquely identifies this
Customer record in the Fusebill system. This value is unique to each customer.

Yes

serviceStartOption

Enum: {"ChargeForAllMissedPeriods", "ChargeForLastMissedPeriods", "NoChargesForMissedPeriods", "ChargeForCurrentFullPeriod"}

When the customer is taken off of the Hold status, you are given a number of options for collection of outstanding funds owing.

Yes

preview

Boolean

If set to True the customer is not taken off hold, the call will simply simulate the unhold action and calculate the mock invoice.

Optional

showZeroDollarCharges

Boolean

Controls whether zero dollar charges are shown on the invoice preview if preview is true

Optional

temporarilyDisableAutoPost

Boolean

This key allows you to temporarily disable invoice post and thus the collection of outstanding amounts owing.

Optional

Examples
curl -X POST "https://secure.fusebill.com/v1/customers/unHold" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{id:{id},serviceStartOption:'ChargeForCurrentFullPeriod',showZeroDollarCharges:false,temporarilyDisableAutoPost:false,prorate:false,preview:true}"
//Json data, Fusebill Id which corresponds to the customerId Field
string jsonData = "{'id':{id},'serviceStartOption':'ChargeForCurrentFullPeriod','preview':false,'showZeroDollarCharges':false,'temporarilyDisableAutoPost':false,'prorate':false}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/unHold");
//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 dict to the Payload parameter
payload = {'customerId':{id},"serviceStartOption":"ChargeForAllMissedPeriods","preview":'false',"showZeroDollarCharges":'false',"temporarilyDisableAutoPost":'false'}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/customers/unHold', data=json.dumps(payload), headers=headers)
print(r.content)
{
  "customerId": 180513,
  "serviceStartOption": "ChargeForLastMissedPeriods",
  "preview": false,
  "showZeroDollarCharges": false,
  "temporarilyDisableAutoPost": false
}
Response
{
  "firstName": "Cleo",
  "middleName": "Flowers",
  "lastName": "Santiago",
  "companyName": "Bedder",
  "suffix": "Sr.",
  "primaryEmail": "montoyaburch@cipromox.com",
  "primaryPhone": 8435292637,
  "secondaryEmail": "tamrareilly@viagreat.com",
  "secondaryPhone": 9704712723,
  "title": "Ms",
  "reference": 100986,
  "status": "Active",
  "customerAccountStatus": "Good",
  "currency": "USD",
  "customerReference": {
    "reference1": null,
    "reference2": "customValue",
    "reference3": null,
    "salesTrackingCodes": [],
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null,
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "monthlyRecurringRevenue": 250,
  "netMonthlyRecurringRevenue": 220,
  "salesforceId": 12345678,
  "salesforceAccountType": null,
  "salesforceSynchStatus": "Enabled",
  "netsuiteId": 12345678,
  "netsuiteSynchStatus": "Enabled",
  "netsuiteCustomerType": "Individual",
  "portalUserName": "Cleo1974",
  "parentId": 12000749,
  "quickBooksLatchType": null,
  "quickBooksId": null,
  "quickBooksSyncToken": null,
  "hubSpotId": null,
  "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
  "id": 12000750,
  "uri": "https://secure.fusebill.com/v1/customers/12000750"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "customerHold.CustomerServiceStartOption",
            "Value": "Allowable Service Start Option are: null, ChargeForAllMissedPeriods, ChargeForLastMissedPeriods, NoChargesForMissedPeriods, ChargeForCurrentFullPeriod"
        }
    ]
}
Suggest Edits

Cancel Customer

This function allows you to cancel a customer currently in any non-cancelled status. Canceling a customer also cancels subscriptions associated with that customer. Cancelling applies the same cancellationOption to the Subscriptions as was specified in the Customer Cancellation action. For example, "Full" will refund the Customer the full value of each Subscription active on their account.

 
posthttps://secure.fusebill.com/v1/customercancellation
 

Request Parameters

Property
Type
Description
Required

customerId

integer

The customerId value uniquely identifies a Customer record in the Fusebill system. This value is unique to each customer.

Yes

cancellationOption

Enum: {"None", "Unearned", "Full"}

This field defines how the system behaves when cancelling the customer's subscriptions.

"None" indicates that no reversal will take place, and the system will fully earn the charges.

"Unearned" will reverse the unearned revenue amounts. This is a typically partial reversal based on monthly or daily earning rules set on the plan product level at the time the subscription was created.

"Full" will fully reverse all charges for the current period, regardless of how much is earned.

Yes

Examples
curl HTTPS://secure.fusebill.com/v1/CustomerCancellation \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{customerId:{Id}, cancellationOption:'None'}"
//Json Payload
string jsonData = "{'customerId':{Id}, 'cancellationOption':'None'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customerCancellation");
//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 dict to the Payload parameter
payload = {'customerId': {id}, 'cancellationOption': 'None'}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/customerCancellation',data=json.dumps(payload), headers=headers)
print(r.content)
{
  "customerId": 1234,
  "cancellationOption": "None"
}
Response
Returns a 204 No Content Response upon success
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Allowable Cancel Options are: None, Unearned, Full"
        }
    ]
}
Suggest Edits

Uncancel Customer

This function is used to un-cancel a previously cancelled customer.

 
posthttps://secure.fusebill.com/v1/customers/uncancel/customerId
 

Path Parameters

Property
Type
Description

customerId

integer

This is the id value which uniquely identifies a Customer record in the Fusebill system. This value is unique to each customer.

Examples
curl -X POST "https://secure.fusebill.com/v1/customers/uncancel/{id}" \
	-H "Content-Type: application/json" \
	-H "Content-Length: 0" \
	-H "Authorization: Basic {APIKey}"
//path parameter, Fusebill Id which corresponds to the Id Field Returned by Create/Update customer
int pathParameter = {id}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://stg-secure.fusebill.com/v1/customers/uncancel/"+pathParameter);
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "POST";
//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.post('https://stg-secure.fusebill.com/v1/customers/uncancel/{id}', headers=headers)
print(r.content)
This POST call does not take a JSON payload
Response
{
  "firstName": "Tammy",
  "middleName": "Gilliam",
  "lastName": "Campbell",
  "companyName": "Nitracyr",
  "suffix": "Jr.",
  "primaryEmail": "janellrogers@firewax.com",
  "primaryPhone": 8545163066,
  "secondaryEmail": "dyerowen@quilch.com",
  "secondaryPhone": 9135892729,
  "title": "Ms",
  "reference": 100986,
  "status": "Active",
  "customerAccountStatus": "Good",
  "currency": "USD",
  "customerReference": {
    "reference1": null,
    "reference2": "customValue",
    "reference3": null,
    "salesTrackingCodes": [],
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null,
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "monthlyRecurringRevenue": 250,
  "netMonthlyRecurringRevenue": 220,
  "salesforceId": 12345678,
  "salesforceAccountType": null,
  "salesforceSynchStatus": "Enabled",
  "netsuiteId": 12345678,
  "netsuiteSynchStatus": "Enabled",
  "netsuiteCustomerType": "Individual",
  "portalUserName": "Tammy1974",
  "parentId": 12000749,
  "quickBooksLatchType": null,
  "quickBooksId": null,
  "quickBooksSyncToken": null,
  "hubSpotId": null,
  "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
  "id": 12000750,
  "uri": "https://secure.fusebill.com/v1/customers/12000750"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Customer with id 1 not found."
        }
    ]
}
Suggest Edits

Update Customer

This function is used to modify an existing Customer object.

Please Note: Most fields must be fully detailed in the JSON passed in as the body of the PUT – The system will nullify fields that are not included and detailed.

Minimum Request: Currency does not need to be included as it will default to your selected default currency. In all cases, include id and status even if you are not planning to change the status value as failing to do so will return an error from the system.

The easiest way to use this and many other PUT endpoints is to read the object, copy the JSON response, modify the desired fields, then use that modified JSON as the payload for the PUT call.

 
puthttps://secure.fusebill.com/v1/customers
 

Request Parameters

Property
Type
Description

firstName

String

The first name of the Customer.

[Max Length: 50 characters]

middleName

String

The middle name of the Customer.

[Max Length: 50 characters]

lastName

String

The last name of the Customer.

[Max Length: 50 characters]

companyName

String

The company name associated with this Customer.

[Max Length: 50 characters]

suffix

String

The name suffix of the customer, for example Jr. or Sr.

[Max Length: 50 characters]

primaryEmail

String

The primary contact email for the Customer. Allows multiple entries in the format "emailA@email.ema; emailB@email.ema; emailC@email.ema". Invoices and other email communications will be sent to this address(s).

[Max Length: 255 characters]

primaryPhone

String

The primary contact number for the Customer.

[Max Length: 50 characters]

secondaryEmail

String

The secondary contact email for the Customer. Allows multiple entries in the format "emailA@email.ema; emailB@email.ema; emailC@email.ema". No communications are sent to this address

[Max Length: 255 characters]

secondaryPhone

String

The secondary contact number for the Customer.

[Max Length: 50 characters]

title

String

The prefix-title of the customer. Valid strings are: "Mr", "Mrs",
"Ms", "Miss" or "Dr".

reference

String

This is a free form reference field where you can store a reference string for this customer. Generally, this is used to store the reference/Id of this Customer in some external system to facilitate matching up the Fusebill Customer record to that system.

[Max Length: 255 characters]

status

Enum: {"Draft", "Active", "Hold", "Suspended", "Cancelled"}

The status of the Customer. This field can be used to change status under certain constraints. In general it is best to use methods like 'Hold Customer' and 'Activate Customer' to change customer status.

currency

String

The Currency configured for this Customer. The currency is represented using a 3 Character ISO Currency code.

customerReference

Object (defined below)

This is a collection of key. value pairs. Each can be used to store additional data related to this Customer including stalesTrackingCodes.

customerAcquisition

Object (defined below)

This is a collection of Strings. Each can be used to store different details about how this Customer was acquired. Generally, this is used to store marketing channel information.

[Object see below for object definition]

parentId

Integer

The Parent Id key value relates to the Fusebill hierarchy feature. If hierarchy is enabled, the parent customer will have their own parentId and a child customer will display the id of their respective parent.​

quickBooksLatchType

quickBooksId

hubSpotId

id

Integer

The id uniquely identifies the customer.

The id field is always included in any response from any applicable calls on a Customer. It is also often used as part a URL parameter on GET calls.

Customer Reference Fields

Property
Type
Description

reference1

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

reference2

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

reference3

String

An optional open field to hold any alpha-numeric value on the customer.

[Max Length: 255 characters]

salesTrackingCodes

Object (definition below)

A collection of up to 5 SalesTrackingCode objects

[Object definition Below]

SalesTracking Code Fields

Property
Type
Description

type

String

Identification of the sales tracking code type being set. The sales tracking code type can be configured under the sales tracking code section under your account settings

[Max Length: 255 characters]

code

String

The specific sales tracking code value. The code must exist under the appropriate salestrackingcode type being referenced

[Max Length: 255 characters]

Customer Acquisition Fields

Property
Type
Description

adContent

String

Typically used to set the content description for the campaign ad. For all campaigns, or for a particular campaign, this appears as Ad Content under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

campaign

String

This variable is used to define the name of your campaign, which appears in the Analytics reports on the top-level campaign report.

[Max Length: 255 characters]

keyword

String

These are the words that visitors use to find your Website when using a search engine. Google Analytics provides a list of keywords that have been searched by users who find your Website. This information shows you what searchers are actually looking for when they find your Website. This also allows you to discover potential new keywords to target.

[Max Length: 255 characters]

landingPage

String

The first page a visitor views during a session; also known as the entrance page.

[Max Length: 255 characters]

medium

String

Typically used to define the type of the campaign, such as a banner ad, email campaign, or click ad. For all campaigns, or for a particular campaign, this appears as Keyword under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

source

String

The source variable is typically used to define where the campaign is originating from, such as a website name or a company. For all campaigns, or for a particular campaign, this appears as Source under the Segment pull-down in the Analytics Reports.

[Max Length: 255 characters]

Examples
curl -X PUT "https://secure.fusebill.com/v1/customers" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{id:{id},title:'Mr',firstName:'John',lastName:'Smith',companyName:'Acme Inc.',Status:'Active'}"
//Json Payload
string jsonData = "{'firstName':'John','middleName':'B','lastName':'Smith','companyName':'Acme Inc','suffix':'Sr','primaryEmail':'jsmith@acme.com','primaryPhone':'809997777','secondaryEmail':'jdoe@gmail.com','secondaryPhone':'1 (800) 445-6000','title':'Mr','reference':null,'status':'Cancelled','customerAccountStatus':'Good','currency':'USD','customerReference':{'reference1':null,'reference2':null,'reference3':null,'salesTrackingCodes':[],'id':169458},'customerAcquisition':{'adContent':null,'campaign':null,'keyword':null,'landingPage':null,'medium':null,'source':null,'id':169458},'monthlyRecurringRevenue':0,'netMonthlyRecurringRevenue':0,'salesforceId':null,'salesforceAccountType':null,'salesforceSynchStatus':'Enabled','netsuiteId':null,'netsuiteCustomerType':'','portalUserName':null,'parentId':null,'id':169458}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "PUT";
//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 dict to the Payload parameter
payload = {'id': 183365, 'firstName': 'john', 'lastName': 'smith', 'Status': 'Active'}
#Pass in your URI, Payload and Headers
r = requests.put('https://secure.fusebill.com/v1/customers', data=json.dumps(payload), headers=headers)
print(r.content)
{
  "firstName": "James",
  "middleName": "Gilliam",
  "lastName": "Campbell",
  "companyName": "Nitracyr",
  "suffix": "Jr.",
  "primaryEmail": "janellrogers@firewax.com",
  "primaryPhone": 8545163066,
  "secondaryEmail": "dyerowen@quilch.com",
  "secondaryPhone": 9135892729,
  "title": "Ms",
  "reference": 100986,
  "status": "Active",
  "currency": "NZD",
  "customerReference": {
    "reference1": "some string 1",
    "reference2": "some string 2",
    "reference3": "some string 3",
    "salesTrackingCodes": [
      {
        "type": "Sales Tracking Code 1",
        "code": "Alpha"
      }
    ]
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null
  },
  "parentId": 12000749,
  "quickBooksLatchType": "Enabled",
  "quickBooksId": 12345,
  "hubSpotId": 12345,
  "id": 1524982
}
Response
{
  "firstName": "Katelyn",
  "middleName": "Kent",
  "lastName": "Floyd",
  "companyName": "Ronbert",
  "suffix": "Sr.",
  "primaryEmail": "esterbarlow@callflex.com",
  "primaryPhone": 9964413586,
  "secondaryEmail": "mayallen@updat.com",
  "secondaryPhone": 9555473089,
  "title": "Miss",
  "reference": 100986,
  "status": "Active",
  "customerAccountStatus": "Good",
  "currency": "USD",
  "customerReference": {
    "reference1": null,
    "reference2": "customValue",
    "reference3": null,
    "salesTrackingCodes": [],
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "customerAcquisition": {
    "adContent": null,
    "campaign": null,
    "keyword": null,
    "landingPage": null,
    "medium": null,
    "source": null,
    "id": 12000750,
    "uri": "https://secure.fusebill.com/v1/customers/12000750"
  },
  "monthlyRecurringRevenue": 250,
  "netMonthlyRecurringRevenue": 220,
  "salesforceId": 12345678,
  "salesforceAccountType": null,
  "salesforceSynchStatus": "Enabled",
  "netsuiteId": 12345678,
  "netsuiteSynchStatus": "Enabled",
  "netsuiteCustomerType": "Individual",
  "portalUserName": "Katelyn1974",
  "parentId": 12000749,
  "quickBooksLatchType": null,
  "quickBooksId": null,
  "quickBooksSyncToken": null,
  "hubSpotId": null,
  "modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
  "id": 12000750,
  "uri": "https://secure.fusebill.com/v1/customers/12000750"
}
//when changing status to 'Suspended'
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Cannot manually suspend customer, the system is in charge of suspending customers."
        }
    ]
}
Suggest Edits

Create Customer Note

This function is used to create a new Customer note.

 
posthttps://secure.fusebill.com/v1/customernotes
 

Request Parameters

Property
Type
Description
Required

customerid

Integer

This is the the Id value which uniquely identifies this Customer record in the Fusebill system. This value is unique to each customer.

Yes

note

String

The is the string of text you wish to store on a customer.

Yes

Examples
curl -X POST \
  https://secure.fusebill.com/v1/CustomerNotes \
  -H 'Authorization: Basic {APIKey}' \
  -H 'Content-Type: application/json' \
  -d '{
	"note":"Sample",
	"customerid":{CustomerId}
}'
//Json data, Fusebill Id which corresponds to the customerId Field
string jsonData = "{'customerId':{customerId},'note':'Test Note String'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customerNotes");
//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 = {'customerId': {id},"note":"Sample customer note"}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/customerNotes', data=json.dumps(payload), headers=headers)
print(r.content)
{
  "customerId": 5678131,
  "note": "This customer is hard of hearing, use email communications only"
}
Response
{
    "userWhoCreatedNote": "API - User not specified",
    "note": "hello world",
    "createdTimestamp": "2019-11-07T19:03:13.0001383Z",
    "id": 46600,
    "uri": null
}
Suggest Edits

Delete Customer Note

This request deletes a customer note using the Fusebill generated customer note ID

 
deletehttps://secure.fusebill.com/v1/customerNotes/noteID
 

URL Properties

Property
Type
Description

noteID

Integer

The Fusebill generated ID uniquely identifying the customer note

Examples
curl –X DELETE https://secure.fusebill.com/v1/customerNotes/Delete/{noteID} \ 
-H "Content-Type: application/json" \ 
-H "Authorization: Basic {APIKey}" 
//Setup Item ID 
Int noteID= {noteID} 
//Setup API key 
string apiKey = "{APIKey}"; 
//Configure URI 
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customerNotes/Delete/" + noteID); 
//Add Content type 
request.ContentType = "application/json"; 
//Add Api key authorization 
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey); 
//Set request method 
request.Method = "DELETE"; 
//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 your URI, and Headers 
r = requests.delete('https://secure.fusebill.com/v1/customerNotes/Delete/{noteID}',  headers=headers) 
print(r.content) 
Response
Returns a 204 No Content Response upon success
Suggest Edits

Customer Email Object

The customer email object defines the email messages and preferences a customer should receive. Messages include "Credit Card Expiry Notices", "Invoice Overdue Notices" and others.

 

Currently, there are preference entities for the following emailTypes

  • InvoicePost
  • PaymentReceived
  • InvoiceOverdue
  • PasswordReset
  • PaymentFailed
  • CustomerActivation
  • SubscriptionActivation
  • SubscriptionCancellation
  • CustomerCredentialCreate
  • CustomerCredentialPasswordReset
  • CustomerSuspend
  • PaymentMethodUpdate
  • CreditCardExpiry
  • StatementNotification
  • UpcomingBillingNotification
  • Refund
  • PendingExpiryRenewalNotice

Additional preference entities may be added in the future so when editing the email preferences via the API it is suggested to always perform a GET to retrieve the full email preferences list and to then modify the data in that list and PUT that list to perform the edit action. This ensures the PUT action includes all the required preference entities.

Customer Email Preferences Fields

Field
Type
Description

customerId

Integer

This is the Fusebill ID of the customer to whom these preferences apply.

[Read Only]

preferences

List of Objects (definition below)

This is the list of Preference entities.

Preferences Object Fields

Field
Type
Description

enabled

String

Specify whether or not the specified email notification is enabled. Values should be one of: "true", "false" or NULL (account default)

accountDefault

Boolean

The default preference across the account. To be used if enabled is NULL.

[Read Only]

emailType

String

Used to specify which email notification. Valid values are any of the following:
"InvoicePost", "PaymentReceived", "InvoiceOverdue", "PasswordReset", "PaymentFailed", "CustomerActivation", "SubscriptionActivation", "SubscriptionCancellation", "CustomerCredentialCreate", "CustomerCredentialPasswordReset", "CustomerSuspend", "PaymentMethodUpdate", "CreditCardExpiry", "StatementNotification", "UpcomingBillingNotification", "Refund", "PendingExpiryRenewalNotice"
[Read Only]

emailCategory

String

Describes the general category of the email. Mostly for internal use.

[Read Only]

Suggest Edits

Read Customer Email Preferences

This function allows you to get the email preferences for a specific customer.

 
gethttps://secure.fusebill.com/v1/customers/customerId/CustomerEmailPreferences
 

URL Properties

Property
Type
Description

customerId

Integer

This is the the ID value which uniquely identifies this Customer record in the Fusebill system. This value is unique to each customer.

Examples
curl -X GET "https://secure.fusebill.com/v1/customers/{customerId}/CustomerEmailPreferences" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//path parameter, Fusebill Id which corresponds to the Id Field Returned by Create/Update customer
int pathParameter = {customerId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/"+pathParameter+"/CustomerEmailPreferences");
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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/customers/{id}/CustomerEmailPreferences', headers=headers)
print(r.content)
Response
{
    "customerId": 648454,
    "preferences": [
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "CreditCardExpiry",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "CustomerActivation",
            "emailCategory": "Customers"
        },
        {
            "enabled": true,
            "accountDefault": false,
            "emailType": "CustomerCredentialCreate",
            "emailCategory": "Customers"
        },
        {
            "enabled": null,
            "accountDefault": true,
            "emailType": "CustomerCredentialPasswordReset",
            "emailCategory": "Customers"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "CustomerSuspend",
            "emailCategory": "Customers"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "DraftInvoice",
            "emailCategory": "InvoicesAndStatements"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "InvoiceOverdue",
            "emailCategory": "InvoicesAndStatements"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "InvoicePost",
            "emailCategory": "InvoicesAndStatements"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "PaymentFailed",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": true,
            "accountDefault": false,
            "emailType": "PaymentMethodUpdate",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": true,
            "accountDefault": false,
            "emailType": "PaymentReceived",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "PendingExpiryRenewalNotice",
            "emailCategory": "Subscriptions"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "Refund",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "StatementNotification",
            "emailCategory": "InvoicesAndStatements"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "SubscriptionActivation",
            "emailCategory": "Subscriptions"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "SubscriptionCancellation",
            "emailCategory": "Subscriptions"
        },
        {
            "enabled": null,
            "accountDefault": false,
            "emailType": "UpcomingBillingNotification",
            "emailCategory": "InvoicesAndStatements"
        }
    ]
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Customer with id 1 not found."
        }
    ]
}
Suggest Edits

Update Customer Email Preferences

This call allows you to edit the customer email preferences for a specific customer. You must include all the preference entities in the call to perform the edit action, even if you are not modifying some of those preference entities. They would be set to null (account default) otherwise.

 
puthttps://secure.fusebill.com/v1/CustomerEmailPreferences
 

Request Parameters

Field
Type
Description

customerId

Integer

This is the Fusebill ID of the customer to whom these preferences apply.

preferences

List of Objects (defined below)

This is the list of Preference entities.

Preferences Object Fields

Field
Type
Description

enabled

String

Specify whether or not the specified email notification is enabled. Values should be one of: "true", "false" or NULL (account default)

Note: To override the account default setting you must specify a value of either "true" or "false"

emailType

String

Used to specify which email notification. Valid values are any of the following:
"InvoicePost", "PaymentReceived", "InvoiceOverdue", "PasswordReset", "PaymentFailed", "CustomerActivation", "SubscriptionActivation", "SubscriptionCancellation", "CustomerCredentialCreate", "CustomerCredentialPasswordReset", "CustomerSuspend", "PaymentMethodUpdate", "CreditCardExpiry", "StatementNotification", "UpcomingBillingNotification", "Refund", "PendingExpiryRenewalNotice"

Examples
curl -X PUT "https://secure.fusebill.com/v1/CustomerEmailPreferences" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{'customerId':{customerId},'preferences':[{'enabled':true,'accountDefault':false,'emailType':'CreditCardExpiry','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'CustomerActivation','emailCategory':'Customers'},{'enabled':false,'accountDefault':false,'emailType':'CustomerCredentialCreate','emailCategory':'Customers'},{'enabled':false,'accountDefault':true,'emailType':'CustomerCredentialPasswordReset','emailCategory':'Customers'},{'enabled':false,'accountDefault':false,'emailType':'CustomerSuspend','emailCategory':'Customers'},{'enabled':false,'accountDefault':false,'emailType':'InvoiceOverdue','emailCategory':'InvoicesAndStatements'},{'enabled':false,'accountDefault':false,'emailType':'InvoicePost','emailCategory':'InvoicesAndStatements'},{'enabled':false,'accountDefault':true,'emailType':'PaymentFailed','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'PaymentMethodUpdate','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'PaymentReceived','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'PendingExpiryRenewalNotice','emailCategory':'Subscriptions'},{'enabled':true,'accountDefault':false,'emailType':'Refund','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'StatementNotification','emailCategory':'InvoicesAndStatements'},{'enabled':false,'accountDefault':false,'emailType':'SubscriptionActivation','emailCategory':'Subscriptions'},{'enabled':false,'accountDefault':false,'emailType':'SubscriptionCancellation','emailCategory':'Subscriptions'},{'enabled':false,'accountDefault':false,'emailType':'UpcomingBillingNotification','emailCategory':'InvoicesAndStatements'}]}"
//Json Payload, Replace this customer Id with the FusebillId of the customer you would like to update
string jsonData = "{'customerId':{customerId},'preferences':[{'enabled':false,'accountDefault':false,'emailType':'CreditCardExpiry','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'CustomerActivation','emailCategory':'Customers'},{'enabled':false,'accountDefault':false,'emailType':'CustomerCredentialCreate','emailCategory':'Customers'},{'enabled':false,'accountDefault':true,'emailType':'CustomerCredentialPasswordReset','emailCategory':'Customers'},{'enabled':false,'accountDefault':false,'emailType':'CustomerSuspend','emailCategory':'Customers'},{'enabled':false,'accountDefault':false,'emailType':'InvoiceOverdue','emailCategory':'InvoicesAndStatements'},{'enabled':false,'accountDefault':false,'emailType':'InvoicePost','emailCategory':'InvoicesAndStatements'},{'enabled':false,'accountDefault':true,'emailType':'PaymentFailed','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'PaymentMethodUpdate','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'PaymentReceived','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'PendingExpiryRenewalNotice','emailCategory':'Subscriptions'},{'enabled':true,'accountDefault':false,'emailType':'Refund','emailCategory':'PaymentsAndRefunds'},{'enabled':false,'accountDefault':false,'emailType':'StatementNotification','emailCategory':'InvoicesAndStatements'},{'enabled':false,'accountDefault':false,'emailType':'SubscriptionActivation','emailCategory':'Subscriptions'},{'enabled':false,'accountDefault':false,'emailType':'SubscriptionCancellation','emailCategory':'Subscriptions'},{'enabled':false,'accountDefault':false,'emailType':'UpcomingBillingNotification','emailCategory':'InvoicesAndStatements'}]}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/CustomerEmailPreferences");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "PUT";
//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 = {"customerId":{id},"preferences":

[{"enabled":None,"accountDefault":"false","emailType":"CreditCardExpiry","emailCategory":"PaymentsAndRefunds"},

{"enabled":None,"accountDefault":"false","emailType":"CustomerActivation","emailCategory":"Customers"},

{"enabled":None,"accountDefault":"false","emailType":"CustomerCredentialCreate","emailCategory":"Customers"},

{"enabled":None,"accountDefault":"true","emailType":"CustomerCredentialPasswordReset","emailCategory":"Customers"},

{"enabled":None,"accountDefault":"false","emailType":"CustomerSuspend","emailCategory":"Customers"},

{"enabled":None,"accountDefault":"false","emailType":"DraftInvoice","emailCategory":"InvoicesAndStatements"},

{"enabled":None,"accountDefault":"false","emailType":"InvoiceOverdue","emailCategory":"InvoicesAndStatements"},

{"enabled":None,"accountDefault":"false","emailType":"InvoicePost","emailCategory":"InvoicesAndStatements"},

{"enabled":None,"accountDefault":"false","emailType":"PaymentFailed","emailCategory":"PaymentsAndRefunds"},

{"enabled":None,"accountDefault":"false","emailType":"PaymentMethodUpdate","emailCategory":"PaymentsAndRefunds"},

{"enabled":None,"accountDefault":"true","emailType":"PaymentReceived","emailCategory":"PaymentsAndRefunds"},

{"enabled":None,"accountDefault":"false","emailType":"PendingExpiryRenewalNotice","emailCategory":"Subscriptions"},

{"enabled":None,"accountDefault":"false","emailType":"Refund","emailCategory":"PaymentsAndRefunds"},

{"enabled":None,"accountDefault":"false","emailType":"StatementNotification","emailCategory":"InvoicesAndStatements"},

{"enabled":None,"accountDefault":"false","emailType":"SubscriptionActivation","emailCategory":"Subscriptions"},

{"enabled":None,"accountDefault":"false","emailType":"SubscriptionCancellation","emailCategory":"Subscriptions"},

{"enabled":None,"accountDefault":"false","emailType":"UpcomingBillingNotification","emailCategory":"InvoicesAndStatements"}]}
#Pass in your URI, Payload and Headers
r = requests.put('https://secure.fusebill.com/v1/CustomerEmailPreferences', data=json.dumps(payload), headers=headers)
print(r.content)
{
  "customerId": 12661902,
  "preferences": [
    {
      "enabled": true,
      "emailType": "CreditCardExpiry",
      "emailCategory": "PaymentsAndRefunds"
    },
    {
      "enabled": null,
      "emailType": "CustomerActivation",
      "emailCategory": "Customers"
    },
    {
      "enabled": null,
      "emailType": "CustomerCredentialCreate",
      "emailCategory": "Customers"
    },
    {
      "enabled": null,
      "emailType": "CustomerCredentialPasswordReset",
      "emailCategory": "Customers"
    },
    {
      "enabled": null,
      "emailType": "CustomerSuspend",
      "emailCategory": "Customers"
    },
    {
      "enabled": null,
      "emailType": "DraftInvoice",
      "emailCategory": "InvoicesAndStatements"
    },
    {
      "enabled": null,
      "emailType": "InvoiceOverdue",
      "emailCategory": "InvoicesAndStatements"
    },
    {
      "enabled": null,
      "emailType": "InvoicePost",
      "emailCategory": "InvoicesAndStatements"
    },
    {
      "enabled": null,
      "emailType": "PaymentFailed",
      "emailCategory": "PaymentsAndRefunds"
    },
    {
      "enabled": null,
      "emailType": "PaymentMethodUpdate",
      "emailCategory": "PaymentsAndRefunds"
    },
    {
      "enabled": null,
      "emailType": "PaymentReceived",
      "emailCategory": "PaymentsAndRefunds"
    },
    {
      "enabled": null,
      "emailType": "PendingExpiryRenewalNotice",
      "emailCategory": "Subscriptions"
    },
    {
      "enabled": null,
      "emailType": "Refund",
      "emailCategory": "PaymentsAndRefunds"
    },
    {
      "enabled": null,
      "emailType": "StatementNotification",
      "emailCategory": "InvoicesAndStatements"
    },
    {
      "enabled": null,
      "emailType": "SubscriptionActivation",
      "emailCategory": "Subscriptions"
    },
    {
      "enabled": null,
      "emailType": "SubscriptionCancellation",
      "emailCategory": "Subscriptions"
    },
    {
      "enabled": null,
      "emailType": "UpcomingBillingNotification",
      "emailCategory": "InvoicesAndStatements"
    }
  ]
}
Response
{
    "customerId": 6737347,
    "preferences": [
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "CreditCardExpiry",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "CustomerActivation",
            "emailCategory": "Customers"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "CustomerCredentialCreate",
            "emailCategory": "Customers"
        },
        {
            "enabled": false,
            "accountDefault": true,
            "emailType": "CustomerCredentialPasswordReset",
            "emailCategory": "Customers"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "CustomerSuspend",
            "emailCategory": "Customers"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "InvoiceOverdue",
            "emailCategory": "InvoicesAndStatements"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "InvoicePost",
            "emailCategory": "InvoicesAndStatements"
        },
        {
            "enabled": false,
            "accountDefault": true,
            "emailType": "PaymentFailed",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "PaymentMethodUpdate",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "PaymentReceived",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "PendingExpiryRenewalNotice",
            "emailCategory": "Subscriptions"
        },
        {
            "enabled": true,
            "accountDefault": false,
            "emailType": "Refund",
            "emailCategory": "PaymentsAndRefunds"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "StatementNotification",
            "emailCategory": "InvoicesAndStatements"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "SubscriptionActivation",
            "emailCategory": "Subscriptions"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "SubscriptionCancellation",
            "emailCategory": "Subscriptions"
        },
        {
            "enabled": false,
            "accountDefault": false,
            "emailType": "UpcomingBillingNotification",
            "emailCategory": "InvoicesAndStatements"
        }
    ]
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Customer with id 1 not found."
        }
    ]
}
Suggest Edits

Customer Billing Object

The customer billing settings resource defines the billing settings for the customer. In specific, these preferences control the payment terms and grace period applied to the customer as well as whether invoices auto post to the account and whether payments are automatically collected from credit card or ACH accounts on file.

Additional preferences may be added in the future so when editing the customer billing settings via the API it is suggested to always perform a GET to retrieve the full customer billing settings list and to then modify the data in that response and PUT that response to perform the edit action. This ensures the PUT action includes all the required customer billing settings fields.

 

Customer Billing Settings Fields

Property
Type
Description

invoiceDay

Integer

This field is deprecated and no longer used.

[Read Only]

term

String

This defines the Payment Terms for this Customer. Valid strings are "Net0", "Net5", "Net7", "Net10", "Net15", "Net21", "Net30", "Net45", "Net60", "Net75", "Net90", and "MFI1".

interval

String

This field is deprecated and no longer used. One of "Monthly", "Yearly"

[Read Only]

autoCollect

String

This defines whether the billing system will attempt to collect from the Customer's payment method on file.

The global autoCollect setting is used by default and by setting this field explicitly on the Customer the setting can be overridden for this Customer. This setting can only be explicitly set to True if the customer has a Payment Method, such as a credit card of ACH account, on file.

If set to true then when charges are applied to the Customer the billing system will attempt to collect them in full form the payment method on file. If set to false the billing system will not collect automatically. If set to NULL then the billing system will use the global autoCollect setting.

rechargeType

String

This value should be set to "BringBalanceBackTo" in any case where you want to use the threshold billing feature.

rechargeThresholdAmount

String

This is the value which triggers a threshold collection. If the customer balance drops below this number when an invoice is posted the system will automatically collect enough funds to bring the balance back to the rechargeTargetAmount.

rechargeTargetAmount

String

This is the customer balance which will be collected when the customer balance dips below the threshold. For example, the threshold amount could be $20 and this value set to $50. In this case, the system will collect funds if to bring the balance back to $50 if the customer drops below $20.

statusOnThreshold

Boolean

This setting determines if the customer should enter poor standing if their balance dips below the set threshold and the payment to restore the balance fails.

autoPostDraftInvoice

Boolean

Controls whether ready draft invoices should be posted automatically or remain in draft to be posted manually. NULL means to follow account defaults

hasPaymentMethod

Boolean

Indicates whether the customer has a payment method

customerGracePeriod

Integer

The number of days a customer can be in poor standing before suspension occurs.

gracePeriodExtension

Integer

The default number of days a grace period can be manually extended

customerAutoCancel

Integer

The number of days after suspension before the customer is cancelled by the system.

defaultCancelOption

String

Controls revenue recognition in the event of customer automatic cancellation. "Full" means to reverse all charges fully. "None" means earn all charges. "Unearned" means to reverse unearned amounts for all charges. NULL means to follow the default of the Fusebill account.

standingPoNumber

String

This is the PO number which will be added to this customer's invoices.

billingPeriodConfigurations

Object (defined below)

This list is populated it the billing settings at the customer level have been overridden.

acquisitionCost

Decimal

This is the cost in dollars spent to acquire this customer. This factors into the Customer Profitability metric.

showZeroDollarCharges

String

This defines if this customer will show or not show $0 charges on their invoices. This can be either true, which means Fusebill will show charges, or false, which means Fusebill will hide these charges, or null which means the customer is using the account level default option.

taxExempt

Boolean

This defines if this customer should be charged taxes.

useCustomerBillingAddress

Boolean

This key-value pair allows you to set whether you want to use shipping address or billing address for taxation purposes. Available values include Null, True or False. If you choose "Null" - the system will use the customer's account level tax setting configuration, if set to "True" - the system will use the customer's billing address for taxes, if set to "False" - the system will use the customer's shipping address for taxes.

taxExemptCode

String

This is the tax exemption code for this customer. If taxExempt is set to True this field must be populated.

avalaraUsageType

String

This is a string sent to Alavara for determining the application of various sales taxes.

vatIdentificationNumber

Integer

The number associated with the clients EU Vat ID.

customerServiceStartOption

String

This setting allows you to specify how you would like the system to behave if a customer is automatically moved from Suspend Status back to Active status as a result of successfully auto-collecting outstanding balances. NULL means to follow the account defaults. Override options are "ChargeForAllMissedPeriods", "ChargeForLastMissedPeriods", "NoChargesForMissedPeriods", and "ChargeForCurrentFullPeriod"

rollUpTaxes

Boolean

This option determines if the taxes on the customer's invoices will appear 'rolled up' as one line (eg: Taxes: $4.56) or if the will be broken into multiple lines (eg: State Tax: $3.45 and Federal Tax: $1.34).

rollUpDiscounts

Boolean

If true, all of the discounts for all products and plans on the invoices for this customer will be rolled up into a single line item at the bottom of the invoice. NULL follows the default of the Fusebill account.

rollUpPdfsByPlanProduct

Boolean

Controls how subscription charges are displayed on downloaded invoices. True means to display summarized subscription product charges. False means to display detailed charges.

rollUpPdfsDisplayName

Boolean

Controls whether plan names are displayed on summarized invoices

rollUpPdfsDisplayDescription

Boolean

Controls whether plan descriptions are displayed on summarized invoices

rollUpPdfsDisplayAllUnitPrices

Boolean

Controls whether all unit prices are displayed on summarized invoices

pdfInvoiceEmailAttachmentOption

String

Controls how subscription charges are displayed on emailed invoices. "Details" means to show fully detailed charges. "Summary" means to show summarized charges. "Both" means to show both.

trackedItemDisplay

Object (defined below)

Controls the appearance of tracked items on invoices for the customer.

customerBillingStatementSetting

Object (defined below)

Controls the billing statement settings for this customer.

defaultPaymentMethodId

Integer

The Fusebill generated ID of the customer's default payment method.

postReadyChargesOnRenew

Boolean

Controls whether draft ready charges are posted on renewal. This includes new ready draft charges from renewals and any existing ready draft charges from subscriptions and purchases. NULL means to follow the Fusebill account default.

id

String

This is the Customer ID of the customer to whom these preferences apply.

uri

String

The full string path to this resource.

Billing Period Configuration Object Fields

Property
Type
Description

type

String

One of "SpecifiedDate", "CustomerActivation", or "FirstSubscriptionActivation". Controls when subscriptions of the configured interval are recharged

rule

String

One of "SingleInvoice", "MultipleInvoices, "OneInvoicePerDay", and "Prompt". Controls how to invoice. Single Invoice compiles subscriptions of the given interval on one invoice. Multiple Invoices separates them as one invoice per subscription. One Invoice Per Day posts an invoice every day. Prompt requires an agent to approve it each time.

interval

String

Either "Monthly" or "Yearly".

day

Integer (1-31)

The day of the month to recharge. Use only if type is "SpecifiedDate"

month

Integer (1-12)

The month of the year to recharge. Use only if type is "SpecifiedDate" and interval is "Yearly"

Tracked Item Display Object Fields

Property
Type
Description

trackedItemDisplayFormat

String

One of "Inline" or "SeperatePage". Controls where the tracked items are displayed.

showTrackedItemName

Boolean

This controls if the tracked items names are displayed.

showTrackedItemReference

Boolean

This controls if the tracked items' reference are displayed.

showTrackedItemDescription

Boolean

This controls if the tracked items' description are displayed.

showTrackedItemCreatedDate

Boolean

This controls if tracked items' created dates are displayed.

Customer Billing Statement Setting Object Fields

Property
Type
Description

option

String

One of "Detailed", "BySubscription", or "Summarized". Controls how the statement is generated.

type

String

One of "CustomerAnniversary" or "SpecifiedDate"

interval

String

One of "Monthly" or "Yearly". Controls frequency of statement generation.

day

Integer (1-31)

The day to generate the statement if type is "SpecifiedDate"

month

Integer (1-12)

The month to generate the statement if type is "SpecifiedDate" and interval is "Yearly".

trackedItemDisplay

Object (defined above)

Controls how tracked items are displayed on the statement.

statementActivityType

String

One of "OnlyParentActivity", "OnlyChildActivity", or "ParentAndChildActivity". Controls which activities to generate if customer hierarchy is being used.

Suggest Edits

Read Customer Billing Settings

This function allows you to get the Customer Billing Settings for a specific customer. In your request, the customerID is the primary unique identifier on the customer profile.

 
gethttps://secure.fusebill.com/v1/customerbillingsetting/customerId
 

Customer Billing Settings Fields

Field
Data Type
Description

id

Integer

This is the Customer ID of the customer to whom these preferences apply.

invoiceDay

Integer

This is the day of the month on which the Customer will be billed for their services. Currently, all invoices will line up to this date.

term

String

This defines the Payment Terms for this Customer. Valid strings are "Net0", "Net5", "Net7", "Net10", "Net15", "Net21", "Net30", "Net45", "Net60", "Net75", "Net90", and "MFI1".

internal

String

This field is used by the billing engine and should not be modified.

autoCollect

Boolean

This defines whether the billing system will attempt to collect from the Customer's payment method on file.

The global autoCollect setting is used by default and by setting this field explicitly on the Customer the setting can be overridden for this Customer. This setting can only be explicitly set to True if the customer has a Payment Method, such as a credit card of ACH account, on file.

If set to true then when charges are applied to the Customer the billing system will attempt to collect them in full form the payment method on file. If set to false the billing system will not collect automatically. If set to NULL then the billing system will use the global autoCollect setting.

rechargeType

String

This value should be set to "BringBalanceBackTo" in any case where you want to use the threshold billing feature.

rechargeThresholdAmount

Decimal

This is the value which triggers a threshold collection. If the customer balance drops below this number when an invoice is posted the system will automatically collect enough funds to bring the balance back to the rechargeTargetAmount.

useCustomerBillingAddress

Boolean

This key-value pair allows you to set whether you want to use shipping address or billing address for taxation purposes. Available values include Null, True or False. If you choose "Null" - the system will use the customer's account level tax setting configuration, if set to "True" - the system will use the customer's billing address for taxes, if set to "False" - the system will use the customer's shipping address for taxes.

rechargeTargetAmount

Currency

This is the customer balance which will be collected when the customer balance dips below the threshold. For example, the threshold amount could be $20 and this value set to $50. In this case, the system will collect funds if to bring the balance back to $50 if the customer drops below $20.

statusOnThreshold

Boolean

This setting determines if the customer should enter poor standing if their balance dips below the set threshold and the payment to restore the balance fails.

autoPostDraftInvoice

Boolean

This defines whether the billing system will attempt to automatically post draft Invoices against the Customer's account.

The global autoPostDraftInvoice setting is used by default and by setting this field explicitly on the Customer the setting can be overridden for this Customer.

If set to true then when an Invoice is generated in Draft status the Invoice will be automatically converted to a Posted invoice and the charges from the Invoice will be applied to the Customer. If set to false the billing system will not post the Invoices automatically. If set to NULL then the billing system will use the global autoPostDraftInvoice setting.

hasPaymentMethod

Boolean

This flag indicates if the customer has a Payment Method, such as a credit card of ACH account, on file.

customerGracePeriod

Integer

This filed defines the number of days that the Customer is allowed to be in a PoorStanding status before the system will automatically place the Customer account in a Suspended state. Customer's enter PoorStanding when one or more Invoices go unpaid and enter an Overdue status.

gracePeriodExtension

Integer

This field is an add-on number of days which extends the Grace Period for this Customer. It is added to the normal Grace Period.

standingPoNumber

String

This is the PO number which will be added to this customer's invoices.

billingPeriodConfigurations

String Collection

This list is populated it the billing settings at the customer level have been overridden.

acquisitionCost

Currency

This is the cost in dollars spent to acquire this customer. This factors into the Customer Profitability metric.

showZeroDollarCharges

Boolean

This defines if this customer will show or not show $0 charges on their invoices. This can be either true, which means Fusebill will show charges, or false, which means Fusebill will hide these charges, or null which means the customer is using the account level default option.

taxExempt

Boolean

This defines if this customer should be charged taxes.

taxExemptCode

String

This is the tax exemption code for this customer. If taxExempt is set to True this field must be populated.

avalaraUsageType

String

This is a string sent to Alavara for determining the application of various sales taxes.

vatIdentificationNumber

Integer

The number associated with the clients EU Vat ID

customerServiceStartOption

String

This setting allows you to specify how you would like the system to behave if a customer is automatically moved from Suspend Status back to Active status as a result of successfully auto-collecting outstanding balances.

rollUpTaxes

Boolean

This option determines if the taxes on the customer's invoices will appear 'rolled up' as one line (eg: Taxes: $4.56) or if the will be broken into multiple lines (eg: State Tax: $3.45 and Federal Tax: $1.34).

trackedItemDisplay

Collection

This option is a collection of boolean objects for invoice display options of tracked items.

billingPeriodConfigurations object

Field
Data Type
Description

type

String

Possible values are "FirstSubscriptionActivation", "CustomerActivation", or "SpecifiedDate".

rule

String

Possible values are "OneInvoicePerDay", "SingleInvoice", "MultipleInvoices", "Prompt".

interval

String

"Yearly" or "Monthly"

day

Integer

Required if using type of "SpecifiedDate"

month

integer

Required if using type of "SpecifiedDate" and interval of "Yearly"

Examples
curl -X GET "https://secure.fusebill.com/v1/customerbillingsetting/{customerId}" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//path parameter, Fusebill Id which corresponds to the Id returned by Get Customer
int pathParameter = {customerId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customerbillingsetting/"+pathParameter);
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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, Payload and Headers
r = requests.get('https://secure.fusebill.com/v1/CustomerBillingSetting/{id}', headers=headers)
print(r.content)
Response
{
    "invoiceDay": -1,
    "term": "Net30",
    "interval": "Monthly",
    "autoCollect": null,
    "rechargeType": "",
    "rechargeThresholdAmount": null,
    "rechargeTargetAmount": null,
    "statusOnThreshold": null,
    "autoPostDraftInvoice": null,
    "hasPaymentMethod": true,
    "customerGracePeriod": null,
    "gracePeriodExtension": null,
    "standingPoNumber": null,
    "billingPeriodConfigurations": [
        {
            "type": "FirstSubscriptionActivation",
            "rule": "OneInvoicePerDay",
            "interval": "Monthly",
            "day": null,
            "month": null
        },
        {
            "type": "FirstSubscriptionActivation",
            "rule": "OneInvoicePerDay",
            "interval": "Yearly",
            "day": null,
            "month": null
        }
    ],
    "acquisitionCost": 0,
    "showZeroDollarCharges": null,
    "taxExempt": false,
    "useCustomerBillingAddress": null,
    "taxExemptCode": null,
    "avalaraUsageType": null,
    "vatIdentificationNumber": null,
    "customerServiceStartOption": "",
    "rollUpTaxes": null,
    "rollUpDiscounts": null,
    "trackedItemDisplay": null,
    "customerBillingStatementSetting": {
        "option": null,
        "type": null,
        "interval": null,
        "day": null,
        "month": null,
        "trackedItemDisplay": null
    },
    "defaultPaymentMethodId": 142291,
    "id": 342780,
    "uri": "https://secure.fusebill.com/v1/customerbillingsetting/342780"
}
Suggest Edits

Update Customer Billing Settings

This function allows you to override the default customer billing settings for a specific customer.

Recommended Request: We recommend that the invoiceDay field either be omitted or the value set to null for the PUT method.

 
puthttps://secure.fusebill.com/v1/customerbillingsetting
 

Customer Billing Settings Fields

Field
Data Type
Description

id

Integer

This is the Customer ID of the customer to whom these preferences apply.

invoiceDay

Integer

This is the day of the month on which the Customer will be billed for their services. Currently, all invoices will line up to this date.

term

String

This defines the Payment Terms for this Customer. Valid strings are "Net0", "Net5", "Net7", "Net10", "Net15", "Net21", "Net30", "Net45", "Net60", "Net75", "Net90", and "MFI1".

internal

String

This field is used by the billing engine and should not be modified.

autoCollect

Boolean

This defines whether the billing system will attempt to collect from the Customer's payment method on file.

The global autoCollect setting is used by default and by setting this field explicitly on the Customer the setting can be overridden for this Customer. This setting can only be explicitly set to True if the customer has a Payment Method, such as a credit card of ACH account, on file.

If set to true then when charges are applied to the Customer the billing system will attempt to collect them in full form the payment method on file. If set to false the billing system will not collect automatically. If set to NULL then the billing system will use the global autoCollect setting.

rechargeType

String

This value should be set to "BringBalanceBackTo" in any case where you want to use the threshold billing feature.

rechargeThresholdAmount

Integer

This is the value which triggers a threshold collection. If the customer balance drops below this number when an invoice is posted the system will automatically collect enough funds to bring the balance back to the rechargeTargetAmount.

useCustomerBillingAddress

Boolean

This key-value pair allows you to set whether you want to use shipping address or billing address for taxation purposes. Available values include Null, True or False. If you choose "Null" - the system will use the customer's account level tax setting configuration, if set to "True" - the system will use the customer's billing address for taxes, if set to "False" - the system will use the customer's shipping address for taxes.

rechargeTargetAmount

Currency

This is the customer balance which will be collected when the customer balance dips below the threshold. For example, the threshold amount could be $20 and this value set to $50. In this case, the system will collect funds if to bring the balance back to $50 if the customer drops below $20.

statusOnThreshold

Boolean

This setting determines if the customer should enter poor standing if their balance dips below the set threshold and the payment to restore the balance fails.

autoPostDraftInvoice

Boolean

This defines whether the billing system will attempt to automatically post draft Invoices against the Customer's account.

The global autoPostDraftInvoice setting is used by default and by setting this field explicitly on the Customer the setting can be overridden for this Customer.

If set to true then when an Invoice is generated in Draft status the Invoice will be automatically converted to a Posted invoice and the charges from the Invoice will be applied to the Customer. If set to false the billing system will not post the Invoices automatically. If set to NULL then the billing system will use the global autoPostDraftInvoice setting.

hasPaymentMethod

Boolean

This flag indicates if the customer has a Payment Method, such as a credit card of ACH account, on file.

customerGracePeriod

Integer

This filed defines the number of days that the Customer is allowed to be in a PoorStanding status before the system will automatically place the Customer account in a Suspended state. Customer's enter PoorStanding when one or more Invoices go unpaid and enter an Overdue status.

gracePeriodExtension

Integer

This field is an add-on number of days which extends the Grace Period for this Customer. It is added to the normal Grace Period.

standingPoNumber

String

This is the PO number which will be added to this customer's invoices.

billingPeriodConfigurations

String Collection

This list is populated it the billing settings at the customer level have been overridden.

acquisitionCost

Currency

This is the cost in dollars spent to acquire this customer. This factors into the Customer Profitability metric.

showZeroDollarCharges

Boolean

This defines if this customer will show or not show $0 charges on their invoices. This can be either true, which means Fusebill will show charges, or false, which means Fusebill will hide these charges, or null which means the customer is using the account level default option.

taxExempt

Boolean

This defines if this customer should be charged taxes.

taxExemptCode

String

This is the tax exemption code for this customer. If taxExempt is set to True this field must be populated.

avalaraUsageType

String

This is a string sent to Alavara for determining the application of various sales taxes.

vatIdentificationNumber

Integer

The number associated with the clients EU Vat ID

customerServiceStartOption

String

This setting allows you to specify how you would like the system to behave if a customer is automatically moved from Suspend Status back to Active status as a result of successfully auto-collecting outstanding balances.

rollUpTaxes

Boolean

This option determines if the taxes on the customer's invoices will appear 'rolled up' as one line (eg: Taxes: $4.56) or if the will be broken into multiple lines (eg: State Tax: $3.45 and Federal Tax: $1.34).

trackedItemDisplay

Collection

This option is a collection of boolean objects for invoice display options of tracked items.

Examples
curl -X PUT "https://secure.fusebill.com/v1/customerbillingsetting" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{id:{customerId},invoiceDay:null,term:'Net0',interval:'Monthly',autoCollect:null,rechargeType:'',rechargeThresholdAmount:null,rechargeTargetAmount:null,statusOnThreshold:null,autoPostDraftInvoice:null,hasPaymentMethod:false,customerGracePeriod:null,gracePeriodExtension:null,standingPoNumber:null,billingPeriodConfigurations:[],acquisitionCost:0,showZeroDollarCharges:null,taxExempt:false,useCustomerBillingAddress:true,taxExemptCode:null,avalaraUsageType:null,vatIdentificationNumber:null,customerServiceStartOption:'',rollUpTaxes:null,rollUpDiscounts:null,trackedItemDisplay:null,customerBillingStatementSetting:{option:null,type:null,interval:null,day:null,month:null,trackedItemDisplay:null}}"
//Json data
string jsonData ="{id:{{customerId},invoiceDay:null,term:'Net0',interval:'Monthly',autoCollect:null,rechargeType:'',rechargeThresholdAmount:null,rechargeTargetAmount:null,statusOnThreshold:null,autoPostDraftInvoice:null,hasPaymentMethod:false,customerGracePeriod:null,gracePeriodExtension:null,standingPoNumber:null,billingPeriodConfigurations:[],acquisitionCost:0,showZeroDollarCharges:null,taxExempt:false,useCustomerBillingAddress:true,taxExemptCode:null,avalaraUsageType:null,vatIdentificationNumber:null,customerServiceStartOption:'',rollUpTaxes:null,rollUpDiscounts:null,trackedItemDisplay:null,customerBillingStatementSetting:{option:null,type:null,interval:null,day:null,month:null,trackedItemDisplay:null}}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customerbillingsetting");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "PUT";
//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 = {"invoiceDay": None,"term": "Net10","interval": "Monthly","autoCollect": None,"rechargeType": "","rechargeThresholdAmount": 

None,"rechargeTargetAmount": None,"statusOnThreshold": None,"autoPostDraftInvoice": None,"hasPaymentMethod": "false","customerGracePeriod": 

None,"gracePeriodExtension": None,"standingPoNumber": None,"billingPeriodConfigurations": [],"acquisitionCost": 0,"showZeroDollarCharges": None,"taxExempt": 

"false","useCustomerBillingAddress": None,"taxExemptCode": None,"avalaraUsageType": None,"vatIdentificationNumber": None,"customerServiceStartOption": 

"","rollUpTaxes": None,"rollUpDiscounts": None,"trackedItemDisplay": None,"customerBillingStatementSetting": {"option": None,"type": None,"interval": 

None,"day": None,"month": None,"trackedItemDisplay": None},"defaultPaymentMethodId": None,"id": {id},"uri": None}
#Pass in your URI, Payload and Headers
r = requests.put('https://secure.fusebill.com/v1/customerBillingSetting/{id}', data=json.dumps(payload), headers=headers)
print(r.content)
Response
{
    "invoiceDay": null,
    "term": "Net30",
    "interval": "Monthly",
    "autoCollect": null,
    "rechargeType": "",
    "rechargeThresholdAmount": null,
    "rechargeTargetAmount": null,
    "statusOnThreshold": null,
    "autoPostDraftInvoice": null,
    "hasPaymentMethod": true,
    "customerGracePeriod": null,
    "gracePeriodExtension": null,
    "standingPoNumber": null,
    "billingPeriodConfigurations": [
        {
            "type": "CustomerActivation",
            "rule": "OneInvoicePerDay",
            "interval": "Monthly",
            "day": null,
            "month": null
        },
        {
            "type": "FirstSubscriptionActivation",
            "rule": "OneInvoicePerDay",
            "interval": "Yearly",
            "day": null,
            "month": null
        }
    ],
    "acquisitionCost": 0,
    "showZeroDollarCharges": null,
    "taxExempt": false,
    "useCustomerBillingAddress": null,
    "taxExemptCode": null,
    "avalaraUsageType": null,
    "vatIdentificationNumber": null,
    "customerServiceStartOption": "",
    "rollUpTaxes": null,
    "rollUpDiscounts": null,
    "trackedItemDisplay": null,
    "customerBillingStatementSetting": {
        "option": null,
        "type": null,
        "interval": null,
        "day": null,
        "month": null,
        "trackedItemDisplay": null
    },
    "defaultPaymentMethodId": 142291,
    "id": 342780,
    "uri": "https://secure.fusebill.com/v1/customerbillingsetting/342780"
}
Suggest Edits

Customer Address Preferences Object

The customer address preferences object acts as a link between a customer resource and their billing and (optionally) shipping addresses. The preferences resource returns both billing and shipping addresses if they exist along with other address related information like which address should be used for shipping or the optional fields for the contact name and shipping instructions.

 

Customer Address Preferences Fields

Property
Type
Description

contactName

String

This is an optional field for storing the contact name of the recipient, if different from the name included in the address itself.

[Max Length: 100]

shippingInstructions

String

This free text field allows you to add shipping instructions such as "Bring to Loading Bay #7".

[Max Length: 1000]

useBillingAddressAsShippingAddress

Boolean

This determines if this resource will have both a shipping and billing address. If TRUE the shipping Address is hidden in the UI although it would still be returned in a call to Get CustomerAddressPreferences. If FALSE the shipping address is also displayed in the UI and, if the account level settings are set to show the shipping address, both addresses will appear on all invoices. Note that shipping instructions will appear in the notes section of all invoices.

billingAddress

Address Object

[See Address object definition]

shippingAddress

Address Object

[See Address object definition]

id

long

The Id uniquely identifies the customer.

The Id field is always included in any response from any applicable calls on a Customer. It is also often used as part a URL parameter on GET calls.

[Read Only]

uri

String

Full path to a particular customer address preference object.

[Read Only]

Suggest Edits

Read Address Preferences

This function allows you to retrieve customer address preferences by ID.

 
gethttps://secure.fusebill.com/v1/customerAddressPreferences/customerId
 

Field
Data Type
Description

customerId

Integer

This is the Fusebill ID for the customer you want to retrieve address information for.

Examples
curl -X GET "https://secure.fusebill.com/v1/customerAddressPreferences/{customerId}" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//path parameter, Fusebill Id which corresponds to the Id Field Returned by Create/Update customer
int pathParameter = {customerId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customerAddressPreferences/"+pathParameter);
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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, Payload and Headers
r = requests.get('https://secure.fusebill.com/v1/customerAddressPreferences/{id}', headers=headers)
print(r.content)
Response
{
	"contactName": "Frank",
	"shippingInstructions": null,
	"useBillingAddressAsShippingAddress": true,
	"billingAddress": null,
	"shippingAddress": null,
	"id": 84072,
	"uri": "https://secure.fusebill.com/v1/customerAddressPreferences/84072"
}
Suggest Edits

Update Address Preferences

This function allows you to edit a customer address preferences resource. The id field in the body is the id of the customer you wish to update the preferences for.

 
puthttps://secure.fusebill.com/v1/CustomerAddressPreferences
 

Customer Address Preferences Fields

Field
Data Type
Description

id

Integer

This is the Customer ID (Fusebill ID) of the custom to whom these preferences apply.

shippingInstructions

String, Max Length: 50 characters

This free field allows you to specify instructions for shipping.

useBillingAsShipping

Boolean

This determins if this resource will have both a shipping and billing address or if it will use the billing address for both.

contactName

String, Max Length: 50 characters

This field can be used to store the contact name of the recipient, if different from the name stored in the address.

Examples
curl -X PUT "https://secure.fusebill.com/v1/CustomerAddressPreferences" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{customerId:{customerId},contactname:'John',shippingInstructions:'Signature required.',useBillingAddressAsShippingAddress:true,billingAddress:null,shippingAddres:null}"
//Json data, Fusebill Id which corresponds to the customerId Field
string jsonData = "{id:{customerId},contactname:'John',shippingInstructions:'Signature required.',useBillingAddressAsShippingAddress:true,billingAddress:null,shippingAddres:null}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/CustomerAddressPreferences");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "PUT";
//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 = {"contactName":"John 

Doe","shippingInstructions":None,"useBillingAddressAsShippingAddress":"true","billingAddress":None,"shippingAddress":None,"id":{id},"uri":"https://stg-

secure.fusebill.com/v1/CustomerAddressPreferences/{id}"}
#Pass in your URI, Payload and Headers
r = requests.put('https://secure.fusebill.com/v1/customerAddressPreferences', data=json.dumps(payload), headers=headers)
print(r.content)
Response
{
	"contactName": "Frank",
	"shippingInstructions": "signature required",
	"useBillingAddressAsShippingAddress": true,
	"billingAddress": null,
	"shippingAddress": null,
	"id": 84072,
	"uri": "https://secure.fusebill.com/v1/customerAddressPreferences/84072"
}
Suggest Edits

Shipping/Billing Address Object

In Fusebill, customers can have 2 distinct addresses, one for their billing details and optionally one for shipping. The billing address is where invoices would be sent when physically mailing invoices to customers while the shipping address would be used if physical goods were to be shipped to customers.

 

Address Object Fields

Property
Type
Description

customerAddressPreferenceId

Integer

The Fusebill generated ID of the customer this address object belongs to.

[Read Only]

companyName

String

The company name if applicable.

[Max Length: 255]

line1

String

standard line 1 of an address.

[Max Length: 60]

line2

String

standard line 2 of an address.

[Max Length: 60]

countryId

Integer

The ID of the country. Retrievable with the Read Country ID call.

country

String

The name of the country.

[Read Only]

stateId

Integer

The ID of the state, province, or territory. Retrievable with the Read Country ID call.

state

String

The name of the state, province, or territory.

[Read Only]

city

String

The city name.

[Max Length: 50]

postalZip

String

The postal code or zip code.

[Max Length: 10]

addressType

Enum: {"Billing", "Shipping"}

In Fusebill a customer can have up to one billing and up to one shipping address

valid

Boolean

Indicates the validity of the address.

id

Integer

The Fusebill generated ID for this address object.

[Read Only]

uri

String

The full path to this resource.

[Read Only]

Making Fewer Calls to Fusebill

A customer address can also be added in the initial customer creation POST

Suggest Edits

Read Ship/Bill Address

This function is used to retrieve an address. Addresses are retrieved by their unique ID.

Our shipping and billing address calls accept a variety of values for the Country ID and State ID key-value pairs. The Country ID and State ID fields allow you to use standard ISO 3166-2 Numeric and Subdivision ISO codes. ISO standards are defined and maintained by ISO 3166/MA. For your convenience, we have included downloads of these codes here:

Country Reference List

 
gethttps://secure.fusebill.com/v1/Addresses/addressId
 
Examples
curl -X GET "https://secure.fusebill.com/v1/Addresses/{addressId}" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//path parameter
int pathParameter = {addressId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://stg-secure.fusebill.com/v1/Addresses/"+pathParameter);
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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://stg-secure.fusebill.com/v1/addresses/{id}', headers=headers)
print(r.content)
Response
{
	"customerAddressPreferenceId": 84636,
	"companyName": "DarkSide",
	"line1": "117 Waba Road",
	"line2": null,
	"countryId": 124,
	"country": "Canada",
	"stateId": 9,
	"state": "Ontario",
	"city": "Pakenham",
	"postalZip": "K0A2X0",
	"addressType": "Billing",
	"id": 63406,
	"uri": "https://secure.fusebill.com/v1/addresses/63406"
}
Suggest Edits

Create Ship/Bill Address

This function is used to create a new address resource. The address is linked to a specific customer when it is created.

When posting a new address, Fusebill accepts a variety of values for the Country ID and State ID key-value pairs. The Country ID and State ID fields allow you to use standard ISO 3166-2 Numeric and Subdivision ISO codes. ISO standards are defined and maintained by ISO 3166/MA. For your convenience, we have included downloads of these codes here:

Country Reference List

 
posthttps://secure.fusebill.com/v1/Addresses
 

Shipping and Billing Address Fields

Field
Data Type
Description
Required

customerAddressPreferenceId

Integer

This is the Fusebill generated customer ID.

Yes

companyName

String

The company name if applicable.
[Max Length: 255]

Optional

line1

String

standard line 1 of an address.

[Max Length: 60]

Optional

line2

String

standard line 2 of an address.

[Max Length: 60]

Optional

countryId

Integer

The ID of the country. Retrievable with the Read Country ID call.

Optional

stateId

Integer

The ID of the state, province, or territory. Retrievable with the Read Country ID call.

Optional

city

String

The city of the Customer.

Optional

postalZip

String

The postal code or zip code.

[Max Length: 10]

Optional

addressType

Enum: {"Billing", "Shipping"}

In Fusebill a customer can have up to one billing and up to one shipping address

Yes

Examples
curl -X POST "https://secure.fusebill.com/v1/Addresses" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{customerAddressPreferenceId:{customerId},companyName:'Fusebill',line1:'232 Herzberg Road',line2:'Suite 203',countryId:124,country:'Canada',stateId:9,state:'Ontario',city:'Kanata',postalZip:'K2K 2A1',addressType:'Billing'}"
//Json data, Fusebill Id which corresponds to the customerId Field
string jsonData ="{customerAddressPreferenceId:{customerId},companyName:'Fusebill',line1:'232 Herzberg Road',line2:'Suite 203',countryId:124,country:'Canada',stateId:9,state:'Ontario',city:'Kanata',postalZip:'K2K 2A1',addressType:'Billing'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/Addresses");
//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 = {"customerAddressPreferenceId":{id},"companyName":'Fusebill',"line1":'232 Herzberg Road',"line2":'Suite 
203',"countryId":124,"country":'Canada',"stateId":9,"state":'Ontario',"city":'Kanata',"postalZip":'K2K 2A1',"addressType":'Billing'}
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/addresses', data=json.dumps(payload), headers=headers)
print(r.content)
{
"CustomerAddressPreferenceId": 652929,
"companyName": "Electricity Inc",
"line1": "10 March Rd",
"line2": "Unit A",
"state": "New York",
"city": "New York",
"postalZip": 12345,
"addressType": "Shipping"
}
Response
{
		"customerAddressPreferenceId": 84636,
		"companyName": "DarkSide",
		"line1": "117 Waba Road",
		"line2": null,
		"countryId": 124,
		"country": "Canada",
		"stateId": 9,
		"state": "Ontario",
		"city": "Pakenham",
		"postalZip": "K0A2X0",
		"addressType": "Billing",
		"id": 63406,
		"uri": "https://secure.fusebill.com/v1/addresses/63406"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Only 1 Billing Address is allowed per customer. Please update it instead."
        }
    ]
}
Suggest Edits

Update Ship/Bill Address

This function is used to update an address resource. The address is linked to a specific customer when it is created.

Our shipping and billing address calls accept a variety of values for the Country ID and State ID key-value pairs. The Country ID and State ID fields allow you to use standard ISO 3166-2 Numeric and Subdivision ISO codes. ISO standards are defined and maintained by ISO 3166/MA. For your convenience, we have included downloads of these codes here:

Country Reference List

 
puthttps://secure.fusebill.com/v1/Addresses
 

Request Parameters

Field
Data Type
Description

companyName

String

The company name if applicable.
[Max Length: 255]

line1

String

standard line 1 of an address.

[Max Length: 60]

line2

String

standard line 2 of an address.

[Max Length: 60]

countryId

Integer

The ID of the country. Retrievable with the Read Country ID call.

stateId

Integer

The ID of the state, province, or territory. Retrievable with the Read Country ID call.

city

String

The city of the Customer.

postalZip

String

The postal code or zip code.

[Max Length: 10]

id

Integer

The Fusebill generated ID of the address

Examples
curl -X PUT "https://secure.fusebill.com/v1/Addresses" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{customerAddressPreferenceId:{customerId},id:{addressId},companyName:'Fusebill',line1:'232 Herzberg Road',line2:'Suite 203',countryId:124,country:'Canada',stateId:9,state:'Ontario',city:'Kanata',postalZip:'K2K 2A1',addressType:'Billing'}"
//Json data, Fusebill Id which corresponds to the customerId Field
string jsonData ="{customerAddressPreferenceId:{customerId},id:{addressId},companyName:'Fusebill',line1:'232 Herzberg Road',line2:'Suite 203',countryId:124,country:'Canada',stateId:9,state:'Ontario',city:'Kanata',postalZip:'K2K 2A1',addressType:'Billing'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/Addresses");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "PUT";
//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 ={"customerAddressPreferenceId":{id},"companyName":None,"line1":"","line2":None,"countryId":None,"country":None,"stateId":None,"state":None,"city":"","post
alZip":"","addressType":"Billing","id":{id},"uri":"https://stg-secure.fusebill.com/v1/addresses/{id}"}
#Pass in your URI, Payload and Headers
r = requests.put('https://secure.fusebill.com/v1/customerAddressPreferences', data=json.dumps(payload), headers=headers)
print(r.content)
{
    "customerAddressPreferenceId": 650594,
    "companyName": "EchoFoxtrot",
    "line1": "10 Jupiter Ave.",
    "line2": "suite 98",
    "countryId": 124,
    "country": "Canada",
    "stateId": 2,
    "state": "British Columbia",
    "city": "Vancouver",
    "postalZip": "V9C4V2",
    "addressType": "Billing",
    "valid": true,
    "id": 260543,
    "uri": "https://stg-secure.fusebill.com/v1/addresses/260543"
}
Response
{
	"customerAddressPreferenceId": 84421,
	"companyName": "DarkSide Inc.",
	"line1": "768 Farside",
	"line2": null,
	"countryId": "124",
	"country": "Canada",
	"stateId": 9,
	"state": "Ontario",
	"city": "Ottawa",
	"postalZip": "K3Y9Y7",
	"addressType": "Billing",
	"id": 63406
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Address with id 12 not found."
        }
    ]
}
Suggest Edits

Read Country ID

Returns a list of country IDs (and the IDs of their states/provinces) for use in address-related API calls.

 
gethttps://secure.fusebill.com/v1/Countries
 

This returns a list of Country and State IDs

Examples
curl -X PUT "https://secure.fusebill.com/v1/Countries" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//path parameter
int pathParameter = {addressId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/Countries/"+pathParameter);
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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/Countries', headers=headers)
print(r.content)
Response
[
    {
        "id": 840,
        "name": "United States",
        "iso": "US",
        "iso3": "USA",
        "states": [
            {
                "id": 100,
                "name": "AA",
                "subdivisionIsoCode": "AA",
                "combinedIsoCode": "US-AA"
            },
            {
                "id": 101,
                "name": "AE",
                "subdivisionIsoCode": "AE",
                "combinedIsoCode": "US-AE"
            },
            {
                "id": 15,
                "name": "Alabama",
                "subdivisionIsoCode": "AL",
                "combinedIsoCode": "US-AL"
            },
            {
                "id": 14,
                "name": "Alaska",
                "subdivisionIsoCode": "AK",
                "combinedIsoCode": "US-AK"
            },
            {
                "id": 102,
                "name": "AP",
                "subdivisionIsoCode": "AP",
                "combinedIsoCode": "US-AP"
            },
          
          
          ...
Suggest Edits

Subscription Object

 

Subscription Object Overview

Many systems use Plan and Subscription as interchangeable terms when discussing recurring billing but in Fusebill a Plan and a Subscription are very different.

Plans should be thought of as templates for a service you want to sell to your customers. A Subscription is the actual implementation of a Plan when that Plan is attached to a Customer. Changes to a Plan do not change the Subscriptions created from that Plan and changes made to a Subscription have no effect on the Plan they were created from.

In addition, Plans can have multiple frequencies (monthly, yearly, etc). Subscriptions are instances of a particular frequency of a particular Plan so a Subscription has only one frequency regardless of how many frequencies were in the Plan from which the Subscription was created.

Subscriptions, like their Plan counterparts, are complex and have multiple components that make up the full description of the Subscription. The Subscription object has the following fields:

Subscription Object Fields

Property
Type
Description

customerId

Integer

This is the Id of the Customer to whom this Subscription has been applied.

[Read Only]

planFrequency

Object (definition below)

This provides details of the plan frequency that was used to configure the subscription.

[Read Only]

planCode

String

This is the unique code which represents the Plan of which this Subscription is an instance.

[Read Only]

planName

String

This is the name of the plan of which this Subscription is an instance.

[Read Only]

planDescription

String

This is the description text of the Plan of which this Subscription is an instance of.

[Read Only]

planReference

String

This is a text field which will be populated with the reference text from the Plan. This field is not exposed on the Invoice.

[Read Only]

status

Enum: {Active, Draft, Cancelled, Provisioning, Expired, Migrated}

This is the status of this subscription. Draft indicates that the Subscription has not yet been activated. Provisioning indicates this Subscription has been provisioned but that the Setup Fee and recurring Charge has not been applied to the Customer. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future.

reference

String

This is a text field you can populate with reference text for this subscription. This field is not exposed on the Invoice.

[Max Length: 255 characters]

subscriptionOverride

Object. Defined below

This represents a subscription-level override made after the object's creation.

hasPostedInvoice

Boolean

This indicates if this Subscription has caused an invoice to be created and posted against the Customer's account.

[Read Only]

CreatedTimestamp

DateTime

This indicates when the Subscription was created.

[Read Only]

ActivatedTimestamp

DateTime

This indicates when the Subscription was activated.

[Read Only]

ProvisionedTimestamp

DateTime

This indicates when the Subscription was provisioned.

[Read Only]

NextPeriodStartDate

DateTime

This indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.This indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.

[Read Only]

lastPeriodStartDate

DateTime

This is the timestamp of when the previous period started for this subscription if there was a previous period.

[Read Only]

ScheduledActivationTimestamp

DateTime

If set, this indicates when the Subscription should activate. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future. The Subscription will automatically set to an "Active" status on the Scheduled Activation Date.

subscriptionProducts

List of Objects. See Subscriptions: Subscription Products Object for object definition.

The list of subscription products on the purchase, both included and excluded.

remainingInterval

Integer

This is the number of billing intervals in the lifetime of this Subscription. If this value is set to "null" the Subscription will renew indefinitely. If this is set to a number than after that number of intervals has passed the subscription will change into an "Expired" status automatically and stop billing the Customer.

remainingIntervalPushOut

Integer

This is the setting to default what the new remaining interval should be when the subscription is up for renewal.

openSubscriptionPeriodEndDate

DateTime

This is the date that the current billing period will end. Often, this field will match the "nextPeriodStartDate" value.

chargeDiscount

Object (defined below)

This is the Discount entity which applies to the base recurring charge for this subscription. (This is a legacy object. use chargeDiscounts collection instead)

setupFeeDiscount

Object (defined below)

This is the Discount entity which applies to the base setup fee charge for this subscription.(This is a legacy object use setupFeeDiscounts collection instead)

chargeDiscounts

List of Objects. Object defined below

This is the list of Discount entities which apply to the base recurring charge for this subscription.

setupFeeDiscounts

List of Objects. Object defined below

This is the list of Discount entities which apply to the setup fee for this subscription.

customFields

List of Objects. See Catalog: Custom Fields for object definition.

Custom fields hold additional data. This data is associated with the subscription.

planAutoApplyChanges

Boolean

This field related to Grandfathering control. If True, this indicates that the Plan from which this Subscription is made usually pushes changes to the Plan down to existing Subscriptions - this forces existing customers onto the newest version of the Plan.
If set to False, this 'grandfathers' the Customer into the version of the Plan they Subscribed to and does not push changes.

[Read Only]

autoApplyCatalogChanges

Boolean

This field controls if this specific Subscription should automatically push changes to the underlying Plan to this Subscription. If set to True, changes will be pushed automatically. If False, this Subscription will not reflect updates to the Plan from which it was made.

monthlyRecurringRevenue

Number, generated automatically by Fusebill, cannot be changed.

The calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.

[Read Only]

netMonthlyRecurringRevenue

Decimal

The net MRR of the customer. Calculated by considering any discounts on the customers active subscription products.

[Read Only]

amount

Number

The amount of the subscription.

[Read Only]

contractStartTimestamp

DateTime

This is the date that the contract period will begin.

contractEndTimestamp

DateTime

This is the date that the contract period will end.

expiredTimestamp

DateTime

The timestamp of when this subscription expired if it is in status "Expired"

[Read Only]

modifiedTimestamp

DateTime

The timestamp of the last modification to this entity.

[Read Only]

coupons

List of Objects. See Subscriptions: Coupons Object for details.

The list of coupons that have been applied to this subscription

invoiceDay

Integer

The day of the month recharge occurs for this subscription.

[Read Only]

invoiceMonth

Integer

The month of the year recharge occurs for this subscription if it is a yearly subsctiption

[Read Only]

canMigrate

Boolean

True as long as their is at least one plan family relationship with this subscription's plan code as the source.

[Read Only]

migrationDate

DateTime

The timestamp when this subscription entered status "Migrated"

scheduledMigrationDate

DateTime

The timestamp of when the scheduled migration for this subscription will occur if a migration has been scheduled.

subscriptionHasRecurringEndOfPeriodCharge

Boolean

True if the subscription has a recurring end of period charge

nextRechargeDate

DateTime

The timestamp for when this subscription will recharge next.

invoiceInAdvance

Integer

billingPeriodDefinitionId

Integer

The Fusebill generated ID that uniquely identifies the associated billing period definition.

salesforceId

id

Integer

This is the Subscription Id which uniquely identifies this individual Subscription. This Id is used to refer to this Subscription specifically.

uri

String

This is the URI which can be used to reference this Subscription directly.

PlanFrequency Fields

Property
Type
Description

planRevisionId

Integer

This is the unique identifier for this plan revision

[Read Only]

numberOfIntervals

Integer

This is the number of intervals that this plan will renew for

[Read Only]

interval

String

Valid strings are “Monthly”, “Yearly”

[Read Only]

numberOfSubscriptions

Integer

This is the number of instances of this plan currently in the system as subscriptions

[Read Only]

status

Enum: {Draft, Active, Retired}

Indicates the status of the plan this subscription was sourced from.

[Read Only]

setupFees

List of Objects. (definition below)

This is a list of setup fee objects. There are up to one object per active currency. Setup fees are optional and may not be included in a plan. If they are not included this array would be empty.

[Read Only]

charges

List of Objects. (definition below)

This is a list of charges objects. There are up to one object per active currency. These Charges are optional and may not be included in a plan. If they are not included this array would be empty.

[Read Only]

isProrated

Boolean

This indicates if this Subscription should prorate its charges if activated in the middle of a billing cycle.

[Read Only]

prorationGranularity

String

This defines how granular the proration calculation should be. Valid strings are "Monthly" or "Daily".

[Read Only]

planFrequencyUniqueId

Number

This is an internal identifier.

[Read Only]

remainingInterval

Integer

The default remaining interval for the plan. This is the number of periods before expiry. This can be overwritten or pushed out on the subscription

[Read Only]

invoiceInAdvance

salesforceId

id

Decimal

This is the unique identifier.

uri

String

This is the URI referring to this Plan Frequency object.

Subscription Override Properties

Property
Type
Description

name

String

This is the value which will override the PlanName field value. This override value will appear on invoices and in other Customer facing locations.

[Max Length: 100 characters]

description

String

This is the value which will override the PlanDescription field value. This override value will appear on invoices and in other Customer facing locations.

[Max Length: 500 characters]

charge

Decimal

This value will override the cost of the recurring charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription bills each period. Additional charges, from Products for example, are not affected by this and will continue to bill normally.

chargePriceRanges

chargePricingModelType

setupFee

Decimal

This value will override the cost of the setup fee charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription is activated. Additional charges, from Products for example, are not affected by this and will continue to bill normally.

setupFeePriceRanges

setupFeePricingModelType

id

Decimal

The Fusebill generated ID that uniquely identifies this subscription

uri

String

The full path to this subscription

Setup Fee Fields

Property
Type
Description

amount

Decimal

This is the cost of the setup fee

conditionAmount

Decimal

variableAmount

Decimal

currency

String

This indicates which currency this fee applied is charged in

id

Decimal

This is the unique identifier for this fee

url

String

This is the URI to view this object

Charge Fields

Property
Type
Description

amount

Decimal

This is the monthly recurring charge

conditionAmount

Decimal

variableAmount

Decimal

currency

String

This indicates which currency this charge is charged in

id

Decimal

This is the unique identifier for this charge

url

String

This is the URI to view this object

Earning Interval Settings

Property
Type
Description

earningTimingInterval

String

The period in which a product will earn. Strings may be "Daily", "Monthly", or "Yearly".

earningTimingType

String

This delineates if the earnage is to occur at the beginning or the end of the period. The accepted strings are "StartOfInterval" or "EndOfInterval"

Subscription Product Discounts

Property
Type
Description

discountType

String

This field indicates the type of discount applied. Valid entries are "Percentage" or "Amount".

amount

Decimal

For Percentage discounts, this is the percentage which is discounted from the charge (if the discount is 25%, this value will be 25). For Amount discounts this is the actual value to subtract from the charge.

remainingUsagesUntilStart

Integer

This is the number of billing cycles which must pass before the discount is applied.

remainingUsage

Integer

This is the number of billing cycles which must pass before the discount automatically expires and is removed. This will be NULL for discounts which are perpetual.

Suggest Edits

List Subscriptions

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.

 
gethttps://secure.fusebill.com/v1/subscriptions/getAll?query=field:queryString
 

This call supports String Filtering (Read More) and Date Filtering (Read More)
&query=parameterName:Value

Parameter Name
Acceptable Values
Parameter Name
Acceptable Values

contractEndTimestamp

DateRange

planName

String

contractStartTimestamp

DateRange

planReference

String

createdTimestamp

DateRange

provisionedTimestamp

DateRange

expiredTimestamp

DateRange

reference

String

interval

Monthly, Yearly

remainingInterval

Integer

invoiceDay

Integer (1-31)

remainingIntervalPushOut

Integer

modifiedTimestamp

DateRange

salesForceId

String

planCode

String

scheduledActivationTimestamp

DateRange

planDescription

String

status

Active, Draft, Cancelled, Provisioning, Expired

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":"Active",
         "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,
      "coupons":[  

      ],
      "subscriptionHasRecurringEndOfPeriodCharge":false,
      "id":122453,
      "uri":"https://secure.fusebill.com/v1/subscriptions/122453"
   }
]
Suggest Edits

List Subscription Summary

This action will retrieve a list of summarized subscriptions. The subscriptions returned will be from a search on the entire customer base. For example, a call can be made to retrieve a list of all active subscriptions for all customers on your account. Since this will likely return a very large list, it is strongly recommended that pagination is used.

 
gethttps://secure.fusebill.com/v1/subscriptionSummary?query=field:queryString
 

This call supports string filtering (Read More) and date filtering (Read More)
&query=parameterName:Value

Parameter Name
Acceptable Values
Parameter Name
Acceptable Values

activatedTimestamp

DateRange

nextBillingDate

DateRange

cancellationTimestamp

DateRange

nextPeriodStartDate

DateRange

canMigrate

Boolean

numberOfInterval

Integer

contractEndTimestamp

DateRange

planCode

String

contractStartTimestamp

DateRange

planId

Integer

createdTimestamp

DateRange

provisionedTimestamp

DateRange

description

String

Reference

String

expiryDate

DateRange

remainingInterval

Integer

interval

Monthly, Yearly

scheduledActivationTimestamp

DateRange

lastBillingDate

DateRange

scheduledMigrationDate

DateRange

modifiedTimestamp

DateRange

subscriptionStatus

Active, Draft, Cancelled, Provisioning, Expired

name

String

suspendedTimestamp

DateRange

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/subscriptionSummary" \
	-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/subscriptionSummary");
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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/subscriptionSummary', headers=headers)
print(r.content)
Response
[ 
   { 
      "customerId":129076,
      "planCode":"onlineaccessplan",
      "name":"Online Access Plan",
      "description":null,
      "reference":"1236",
      "interval":"Monthly",
      "numberOfInterval":1,
      "subscriptionStatus":"Active",
      "monthlyRecurringRevenue":0,
      "netMonthlyRecurringRevenue":0,
      "lastBillingDate":"2016-07-09T17:00:24",
      "nextBillingDate":"2016-08-09T04:00:00",
      "expiryDate":null,
      "scheduledActivationTimestamp":null,
      "cancellationTimestamp":null,
      "suspendedTimestamp":null,
      "createdTimestamp":"2016-07-09T17:00:11",
      "modifiedTimestamp": "2019-09-29T04:01:23.73",
      "activatedTimestamp":"2016-07-09T17:00:24",
      "provisionedTimestamp":null,
      "nextPeriodStartDate":"2016-08-09T04:00:00",
      "contractStartTimestamp":null,
      "contractEndTimestamp":null,
      "remainingInterval":null,
      "id":83907,
      "uri":"https://secure.fusebill.com/v1/subscriptionsummary/83907/"
   }
]
Suggest Edits

List Subscriptions By Customer

This function is used to retrieve a list of subscriptions belonging to a customer. That customer is specified by the Fusebill generated ID.

 
gethttps://secure.fusebill.com/v1/customers/customerId/subscriptions?query=parameterName:value
 
Property
Type
Description

customerId

Decimal

This is the ID of the Customer who owns the Subscriptions.

This call supports string filtering (Read More) and date filtering (Read More)
&query=parameterName:Value

Parameter Name
Acceptable Values
Parameter Name
Acceptable Values

contractEndTimestamp

DateRange

planName

String

contractStartTimestamp

DateRange

planReference

String

createdTimestamp

DateRange

provisionedTimestamp

DateRange

expiredTimestamp

DateRange

reference

String

interval

Monthly, Yearly

remainingInterval

Integer

invoiceDay

Integer (1-31)

remainingIntervalPushOut

Integer

modifiedTimestamp

DateRange

salesForceId

String

planCode

String

scheduledActivationTimestamp

DateRange

planDescription

String

status

Active, Draft, Cancelled, Provisioning, Expired

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/customers/{customerId}/subscriptions" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//path parameter, FusebillId
int pathParameter = {customerId}; 
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/"+pathParameter+"/subscriptions");
//Add Content type
request.ContentType = "application/json";
request.ContentLength = 0;
//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/customers/{id}/subscriptions', headers=headers)
print(r.content)
Response
[  
   {  
      "customerId":172677,
      "planFrequency":{  
         "planRevisionId":122453,
         "numberOfIntervals":1,
         "interval":"Monthly",
         "numberOfSubscriptions":1,
         "status":"Active",
         "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,
      "coupons":[  

      ],
      "subscriptionHasRecurringEndOfPeriodCharge":false,
      "id":122453,
      "uri":"https://secure.fusebill.com/v1/subscriptions/122453"
   }
]
Suggest Edits

Read Subscription

This action will return a Subscription response for a given Subscription ID. Note, setting the "PriceUpliftsEnabled" key-value to "False" from a previous value of "True" will delete existing, future and historical price uplifts.

 
gethttps://secure.fusebill.com/v1/subscriptions/subscriptionId
 
Examples
curl -X GET "https://secure.fusebill.com/v1/subscriptions/{subscriptionId}" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"
//query parameter
int queryParameter = {subscriptionId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/subscriptions/"+queryParameter);
//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/subscriptions/{id}', headers=headers)
print(r.content)
Response
{
    "customerId": 186838,
    "planFrequency": {
        "planRevisionId": 177229,
        "numberOfIntervals": 1,
        "interval": "Monthly",
        "numberOfSubscriptions": 1,
        "status": "Active",
        "setupFees": [
        ],
        "charges": [
        ],
        "isProrated": false,
        "prorationGranularity": null,
        "planFrequencyUniqueId": 4791,
        "remainingInterval": null,
        "id": 4791,
        "uri": null
    },
    "planCode": "simplemonthly",
    "planName": "Simple Monthly",
    "planDescription": null,
    "planReference": null,
    "status": "Active",
    "reference": null,
    "subscriptionOverride": null,
    "hasPostedInvoice": true,
    "createdTimestamp": "2017-04-05T17:11:10",
    "activatedTimestamp": "2017-04-05T17:15:11",
    "provisionedTimestamp": null,
    "nextPeriodStartDate": "2017-04-10T04:00:00",
    "scheduledActivationTimestamp": null,
    "subscriptionProducts": [
        {
            "subscriptionId": 177229,
            "planProduct": {
                "status": "Active",
                "productId": 16758,
                "planId": 2804,
                "productCode": "recurringmonthlyproduct",
                "productName": "Recurring Monthly Product",
                "productStatus": "Active",
                "productDescription": null,
                "productType": "RecurringService",
                "productGLCode": "",
                "quantity": 1,
                "maxQuantity": null,
                "isRecurring": true,
                "isFixed": false,
                "isOptional": true,
                "isIncludedByDefault": false,
                "isTrackingItems": false,
                "chargeAtSubscriptionActivation": true,
                "orderToCashCycles": [
                    {
                        "planFrequencyId": 4791,
                        "planProductId": 18374,
                        "numberOfIntervals": 1,
                        "interval": "Monthly",
                        "chargeModels": [
                            {
                                "chargeModelType": "Signup",
                                "chargeTimingType": "StartOfPeriod",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 970993,
                                "uri": null
                            },
                            {
                                "chargeModelType": "Lifetime",
                                "chargeTimingType": "Immediate",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 970993,
                                "uri": null
                            }
                        ],
                        "remainingInterval": null,
                        "groupQuantityChangeCharges": false,
                        "planProductPriceUplifts": null,
                        "customServiceDateNumberOfIntervals": 1,
                        "customServiceDateInterval": "Periods",
                        "customServiceDateProjection": "Future",
                        "earningInterval": "Monthly",
                        "earningNumberOfIntervals": 1,
                        "earningTimingInterval": "Daily",
                        "earningTimingType": "StartOfInterval",
                        "pricingModel": {
                            "pricingModelType": "Standard",
                            "quantityRanges": [
                                {
                                    "min": 0,
                                    "max": null,
                                    "prices": [
                                        {
                                            "amount": 20,
                                            "currency": "USD",
                                            "id": 970993,
                                            "uri": null
                                        }
                                    ],
                                    "id": 0,
                                    "uri": null
                                }
                            ],
                            "id": 970993,
                            "uri": null
                        },
                        "id": 970993,
                        "uri": null
                    }
                ],
                "resetType": "Never",
                "planProductUniqueId": 18108,
                "id": 18374,
                "uri": ""
            },
            "quantity": 1,
            "isIncluded": true,
            "startDate": null,
            "subscriptionProductOverride": null,
            "subscriptionProductPriceOverride": null,
            "chargeAtSubscriptionActivation": true,
            "isCharged": true,
            "subscriptionProductDiscount": null,
            "subscriptionProductDiscounts": [
            ],
            "customFields": null,
            "monthlyRecurringRevenue": 20,
            "netMonthlyRecurringRevenue": 20,
            "amount": 20,
            "status": "Active",
            "lastPurchaseDate": null,
            "earningSettings": {
                "earningTimingInterval": "Daily",
                "earningTimingType": "StartOfInterval"
            },
            "remainingInterval": null,
            "groupQuantityChangeCharges": false,
            "priceUpliftsEnabled": false,
            "priceUplifts": [
            ],
            "historicalPriceUplifts": [
            ],
            "customServiceDateNumberOfIntervals": 1,
            "customServiceDateInterval": "Periods",
            "customServiceDateProjection": "Future",
            "id": 970993,
            "uri": "https://secure.fusebill.com/v1/SubscriptionProducts/970993"
        }
    ],
    "remainingInterval": null,
    "remainingIntervalPushOut": null,
    "openSubscriptionPeriodEndDate": "2017-04-10T04:00:00",
    "chargeDiscount": null,
    "setupFeeDiscount": null,
    "chargeDiscounts": null,
    "setupFeeDiscounts": null,
    "customFields": null,
    "planAutoApplyChanges": false,
    "autoApplyCatalogChanges": false,
    "monthlyRecurringRevenue": 20,
    "netMonthlyRecurringRevenue": 20,
    "amount": 20,
    "contractStartTimestamp": null,
    "contractEndTimestamp": null,
    "expiredTimestamp": null,
    "coupons": [
    ],
    "subscriptionHasRecurringEndOfPeriodCharge": false,
    "id": 177229,
    "uri": "https://secure.fusebill.com/v1/subscriptions/177229"
}
Suggest Edits

Create Subscription

This action will create a new Subscription. Subscriptions are applied to specific Customers, identified by the customerId field, and are instances of a specific frequency of a specific Plan, identified by the planFrequencyId below.

When you create a Subscription you have the option of providing a subscriptionOverride. This override will allow you to change the name and description of the subscription, as it appears on the Customer's invoice.

Creating a Subscription will include all the Products in the associated Plan in the newly created Subscription. You can Edit the Subscription if you wish to modify aspects of the Products. See the Update Subscription page for more details.

Subscriptions have a status of Draft when created and you will need to perform an additional action to Activate the Subscription. See the Activate Subscription page for details. Coupons can be provided when creating the subscription using the "couponCodes" value.

The minimum request key-value pairs for a successful include fields "customerID" and "PlanFrequencyID".

 
posthttps://secure.fusebill.com/v1/subscriptions
 

This action will return the full Subscription object of the newly created Subscription. To include the full invoice in the response, include the parameter ?view=sideeffects as shown below

Previewing without creating a draft subscription

Sample JSON Payloads

//Most basic payload to create subscription with all default values
{
  "CustomerID": 310045,
  "planFrequencyID": '19384'
}
//Request that includes two coupon codes to immediately apply to the subscription
{
  "CustomerID": 310045,
  "planFrequencyID": '19384',
  "couponCodes": ["%5Off", "NextMonthFree"]
}
/**This sample payload creates a subscription while also overriding the default name, description, and price from the catalog. The subscription is also scheduled to activate at a future date. 
**/

{
  "customerId": 310045,
  "planFrequencyId": 19384,
  "subscriptionOverride": {
    "name": "override default name",
    "description": "override default description"
  },
  "scheduledActivationTimestamp": "2019-10-20",
  "reference": "sample reference string",

  "contractStartTimestamp": "2018-03-01",
  "contractEndTimestamp": "2018-03-01",
}
{
  "customerId":1234567,
  "planFrequencyId":12345,
  "monthlybillingperiodconfiguration":{
    "billingPeriodId":1234567890
  },
  "scheduledActivationTimestamp":null
}

Request Parameters

Property
Type
Description
Required

customerID

Decimal

This is the Fusebill ID of the customer.

Yes - Not required if preview=true is set

planFreqencyID

Collection

See planFrequency Object Fields below

Yes

subscriptionOverride

Collection

See subscriptionOverride Object Fields below

Optional

Reference

String

This will appear as the 3rd line item in the main subscription header on an invoice

Optional

scheduledActivationTimestamp

DateTime

It will accept a scheduled date in the future identifying when to Activate Subscription if it is placed into "Provisioning" Status. The submitted DateTime will automatically be interpreted in your account timezone. This field should be omited if the subscription should not be scheduled to activate in the future.

Optional

remainingInterval

Decimal

Number of billing intervals that can iterate before the subscription status is set to "Expired".

Optional

remainingIntervalPushOut

Decimal

Number of billing intervals that are added to the Remaining interval counter whenever the expiry pushout button is pressed by the customer via the Self-Service-Portal

Optional

contractStartTimestamp

String

This is the string of the contract start date returned in subscription reports

Optional

contractEndTimestamp

String

This is the string of the contract end date returned in subscription reports

Optional

billingPeriodID

Decimal

The unique id of an existing billing period on the customer that the subscription should be assigned to

Optional

invoiceDay

Integer (1-28)

Tells the system to create a billing period that cycles on the specified day and assign this subscription to it

Optional

invoiceMonth

Integer (1-12)

Tells the system to create a billing period that cycles on the specified day and month and assign this subscription to it. This parameter can only be used for subscriptions with an annual frequency

Optional

couponCodes

Collection

Can hold a list of coupon codes to be automatically applied to the subscription at time of creation, Coupons can be pre-configured to apply specific discounts to specific subscription products on the subscription

Optional

Subscription Object Fields

Property
Type
Description

id

Decimal

This is the Subscription Id which uniquely identifies this individual Subscription. This Id is used to refer to this Subscription specifically.

customerId

Decimal

This is the Id of the Customer to whom this Subscription has been applied.

planCode

String

This is the unique code which represents the Plan of which this Subscription is an instance.

planName

String

This is the name of the Plan of which this Subscription is an instance.

planDescription

String

This is the description text of the Plan of which this Subscription is an instance.

planReference

String

This is a text field which will be populated with the reference text from the Plan. This field is not exposed on the Invoice.

status

String

This is the status of this subscription. Accepted values are "Active", "Draft", "Cancelled", "Provisioning" and "Expired". Draft indicates that the Subscription has not yet been activated. Provisioning indicates this Subscription has been provisioned but that the Setup Fee and recurring Charge has not been applied to the Customer. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future.

reference

String

This is a text field you can populate with reference text for this subscription. This field is not exposed on the Invoice.

hasPostedInvoice

Boolean

This indicates if this Subscription has caused an invoice to be created and posted against the Customer's account.

CreatedTimestamp

DateTime

This indicates when the Subscription was created.

ActivatedTimestamp

DateTime

This indicates when the Subscription was activated.

ProvisionedTimestamp

DateTime

This indicates when the Subscription was provisioned.

NextPeriodStartDate

DateTime

This indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.This indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.

remainingInterval

Decimal

This is the number of billing intervals in the lifetime of this Subscription. If this value is set to "null" the Subscription will renew indefinitely. If this is set to a number than after that number of intervals has passed the subscription will change into an "Expired" status automatically and stop billing the Customer.

ScheduledActivationTimestamp

DateTime

If set, this indicates when the Subscription should activate. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future. The Subscription will automatically set to an "Active" status on the Scheduled Activation Date.

remainingInterval

Decimal

This lists the default number of intervals that remain before expiry. This is a default set at the plan level.

remainingIntervalPushOut

Decimal

This is the setting to default what the new remaining interval when the subscription is up for renewal.

openSubscriptionPeriodEndDate

DateTime

This is the date that the current billing period will end. Often, this field will match the "nextPeriodStartDate" value.

chargeDiscount

chargeDiscount

This is the Discount entity which applies to the base recurring charge for this subscription. (This is a legacy object use chargeDiscounts collection)

setupFeeDiscount

Decimal

This is the Discount entity which applies to the base setup fee charge for this subscription.(This is a legacy object use setupFeeDiscounts collection)

chargeDiscounts

Decimal

This is the Discount entity which applies to the base recurring charge for this subscription. (Use this collection for discounts)

setupFeeDiscount

Decimal

This is the Discount entity which applies to the base setup fee charge for this subscription.(This is a legacy object use setupFeeDiscounts collection)

chargeDiscounts

Discount

This is the Discount entity which applies to the base recurring charge for this subscription. (Use this collection for discounts)

setupFeeDiscounts

Decimal

This is the Discount entity which applies to the base setup fee charge for this subscription. (Use this collection for discounts)

planAutoApplyChanges

Boolean

This field related to Grandfathering control. If True, this indicates that the Plan from which this Subscription is made usually pushes changes to the Plan down to existing Subscriptions - this forces existing customers onto the newest version of the Plan.
If set to False, this 'grandfathers' the Customer into the version of the Plan they Subscribed to and does not push changes.

autoApplyCatalogChanges

Boolean

This field controls if this specific Subscription should automatically push changes to the underlying Plan to this Subscription. If set to True, changes will be pushed automatically. If False, this Subscription will not reflect updates to the Plan from which it was made.

monthlyRecurringRevenue

Decimal

The calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.

netMonthlyRecurringRevenue

Decimal

The net MRR of the customer. Calculated by considering any discounts on the customers active subscription products.

amount

Decimal

The amount of the subscription.

contractStartTimestamp

DateTime

This is the date that the contract period will begin.

contractEndTimestamp

DateTime

This is the date that the contract period will end.

uri

String

This is the URI which can be used to reference this Subscription Product directly.

PlanFrequency Fields

Property
Type
Description

planRevisionId

Decimal

This is the unique identifier for this plan revision

numberOfIntervals

Decimal

This is the number of intervals that this plan will renew for

interval

String

Valid strings are “Monthly”, “Yearly”

numberOfSubscriptions

Decimal

This is the number of instances of this plan currently in the system as subscriptions

status

String

Valid strings are “Draft”, “Active”, “Retired”

setupFees

Array

This is an Array of Setup Fee objects. There are up to one object per active currency. Setup Fees are optional and may not be included in a plan. If they are not included this array would be empty.

charges

Array

This is an Array of Charges objects. There are up to one object per active currency. These Charges are optional and may not be included in a plan. If they are not included this array would be empty.

isProrated

Boolean

This indicates if this Subscription should prorate its charges if activated in the middle of a billing cycle.

prorationGranularity

String

This defines how granular the proration calculation should be. Valid strings are "Monthly" or "Daily".

planFrequencyUniqueId

Number

This is an internal only identifier, do not modify this value.

id

Decimal

This is the unique identifier.

uri

String

This is the URI referring to this Plan Frequency object.

Subscription Override Fields

Property
Type
Description

Name

String

This is the value which will override the PlanName field value. This override value will appear on invoices and in other Customer facing locations.

Description

String

This is the value which will override the PlanDescription field value. This override value will appear on invoices and in other Customer facing locations.

Charge

Decimal

This value will override the cost of the recurring charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription bills each period. Additional charges, from Products for example, are not affected by this and will continue to bill normally.

SetupFee

Decimal

This value will override the cost of the setup fee charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription is activated. Additional charges, from Products for example, are not affected by this and will continue to bill normally.

PlanProducts Fields

Property
Type
Description

subscriptionId

Decimal

This is the Subscription Product Id that uniquely refers to this Subscription product. This is important for action including this object such as managing the Subscription Product Items inventory.

planProduct

Array

This is the Plan Product object. This object contains most of the details and configuration regarding the product being sold as part of this subscription. See Plan Product for more details.

Quantity

Decimal

This is the number of units of this Subscription Product being purchased.

isIncluded

Boolean

This indicates if this Subscription Product is included in the Customer's Subscription

subscriptionProductOverride

Array

This contains a set of fields to override the name and description of the Subscription Product.

subscriptionProductPriceOverride

Array

This contains a set of fields to override the pricing for the Subscription Product

ChargeAtSubscriptionActivation

Boolean

This flag informs the system to either charge for this Subscription Product when the Subscription is activated (True) or to charge when it is Provisioned (False).

StartDate

DateTime

This is the date on which this Subscription Product should begin to charge the Customer

IsCharged

Boolean

This flag indicates if this Subscription Product has been charged. If it has applied a charge then this field will be True.

subscriptionProductDiscount

Array

This is the Discount entity applied to this Subscription Product. See the ChargeDiscount description below for details.

customFields

Array

This is the list of Custom Fields applied to this Subscription Product. These fields will match the Plan Product fields unless the field values in the Subscription have been changed in which case these fields show the data applied to the Subscription Product and not the default value seen in the Plan Product.

monthlyRecurringRevenue

Number

The calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.

netMonthlyRecurringRevenue

Decimal

The net MRR of the customer. Calculated by considering any discounts on the customers active subscription products.

customServiceDateNumberOfIntervals

Decimal

This value represents the number of intervals in the past or in the future that you would like to set this service date for.

customServiceDateInterval

String

Possible service date values are "Periods", "Dates" and "Months".

customServiceDateProjection

String

Possible values are "Past" or "Future".

amount

Decimal

This is the dollar amount to apply against the above invoice.

status

String

This is the current status of the plan product.

lastPurchaseDate

DateTime

This is the last date of purchase.

earningSettings

Array

This is a small collection of th earning interval type and timing.

id

Decimal

This is the unique identifier

uri

String

This is the URI which can be used to reference this Subscription Product directly.

Earning Interval Settings

Property
Type
Description

earningInterval

String

The period in which a product will earn. Strings may be "Daily", "Monthly", or "Yearly".

earningNumberOfIntervals

Number

earningTimingInterval

String

earningTimingType

String

This delineates if the earnage is to occur at the beginning or the end of the period. The accepted strings are "StartOfInterval" or "EndOfInterval"

Subscription Product Override Fields

Property
Type
Description

Name

String

This is the value which will override the ProductName field value. This override value will appear on invoices and in other Customer facing locations.

Description

String

This is the value which will override the Product Description field value. This override value will appear on invoices and in other Customer facing locations.

Subscription Product Price Fields

Property
Type
Description

ChargeAmount

Decimal

This value will override the cost of the Product. The amount entered here becomes the new amount charged to the Customer when the Subscription bills each period or when the Quantity is increased on this Product. Additional charges, from the Subscription for example, are not affected by this and will continue to bill normally.

Subscription Product Discounts

Property
Type
Description

discountType

String

This field indicates the type of discount applied. Valid entries are "Percentage" or "Amount".

amount

Number

For Percentage discounts, this is the percentage which is discounted from the charge (if the discount is 25%, this value will be 25). For Amount discounts this is the actual value to subtract from the charge.

remainingUsagesUntilStart

Number

This is the number of billing cycles which must pass before the discount is applied.

remainingUsage

Number

This is the number of billing cycles which must pass before the discount automatically expires and is removed. This will be NULL for discounts which are perpetual.

Custom Fields

Property
Type
Description

key

String

This is the unique key of the Custom Field you wish to modify.

friendlyName

String

This is the text friendly label for the key.

dataType

String

This is the data type for the custom field.

value

String

This is the value you wish to update the custom field to. This will always be the string version of the value. If you wish to pass a number, for example, pass it as "123". Likewise, a DateTime would be passed as "2014-06-26T04:00:00". We will use the known data type of the custom field to properly convert the String to a Number, DateTime, etc.

Price Uplift Fields

Property
Type
Description

priceUpliftEnabled

Boolean

This is a True or False value, which allows you to set the price uplift feature as enabled or disabled.

priceUplifts

List

This is a list of price uplift interval objects.

historicalPriceUplifts

List

This is list of surpassed price uplift intervals.

Examples - Minimum Payload
curl -X POST "https://secure.fusebill.com/v1/subscriptions" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}"  \
  -d "{customerID:'310045',planFrequencyID: '19384'}"
//Json Payload
string jsonData = "{customerID:'310045',planFrequencyID: '19384'}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/subscriptions");
//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 = "{customerID:'310045',planFrequencyID: '19384'}"
#Pass in your URI, Payload and Headers
r = requests.post('https://secure.fusebill.com/v1/subscriptions', data=json.dumps(payload), headers=headers)
print(r.content)
Response
{
    "customerId": 1930362,
    "planFrequency": {
        "planRevisionId": 3135696,
        "numberOfIntervals": 1,
        "interval": "Monthly",
        "numberOfSubscriptions": 1,
        "status": "Active",
        "setupFees": [
        ],
        "charges": [
        ],
        "isProrated": false,
        "prorationGranularity": null,
        "planFrequencyUniqueId": 1283935,
        "remainingInterval": null,
        "id": 1868701,
        "uri": null
    },
    "planCode": "premiumplan",
    "planName": "Premium Plan",
    "planDescription": null,
    "planReference": null,
    "status": "Active",
    "reference": null,
    "subscriptionOverride": null,
    "hasPostedInvoice": true,
    "createdTimestamp": "2017-05-12T21:36:31.0000794Z",
    "activatedTimestamp": "2017-05-12T21:36:31.0000794Z",
    "provisionedTimestamp": null,
    "nextPeriodStartDate": "2017-06-12T04:00:00",
    "scheduledActivationTimestamp": null,
    "subscriptionProducts": [
        {
            "subscriptionId": 3135696,
            "planProduct": {
                "status": "Active",
                "productId": 1421752,
                "planId": 828556,
                "productCode": "premiumproduct",
                "productName": "Premium Product",
                "productStatus": "Active",
                "productDescription": null,
                "productType": "RecurringService",
                "productGLCode": "",
                "quantity": 1,
                "maxQuantity": null,
                "isRecurring": true,
                "isFixed": false,
                "isOptional": true,
                "isIncludedByDefault": true,
                "isTrackingItems": false,
                "chargeAtSubscriptionActivation": true,
                "orderToCashCycles": [
                    {
                        "planFrequencyId": 1868701,
                        "planProductId": 1719495,
                        "numberOfIntervals": 1,
                        "interval": "Monthly",
                        "chargeModels": [
                            {
                                "chargeModelType": "Signup",
                                "chargeTimingType": "StartOfPeriod",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 56403857,
                                "uri": null
                            },
                            {
                                "chargeModelType": "Lifetime",
                                "chargeTimingType": "Immediate",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 56403857,
                                "uri": null
                            }
                        ],
                        "remainingInterval": null,
                        "groupQuantityChangeCharges": false,
                        "planProductPriceUplifts": null,
                        "customServiceDateNumberOfIntervals": 0,
                        "customServiceDateInterval": "Periods",
                        "customServiceDateProjection": "Future",
                        "earningInterval": "Monthly",
                        "earningNumberOfIntervals": 1,
                        "earningTimingInterval": "Daily",
                        "earningTimingType": "StartOfInterval",
                        "pricingModel": {
                            "pricingModelType": "Standard",
                            "quantityRanges": [
                                {
                                    "min": 0,
                                    "max": null,
                                    "prices": [
                                        {
                                            "amount": 39.99,
                                            "currency": "USD",
                                            "id": 56403857,
                                            "uri": null
                                        }
                                    ],
                                    "id": 0,
                                    "uri": null
                                }
                            ],
                            "id": 56403857,
                            "uri": null
                        },
                        "id": 56403857,
                        "uri": null
                    }
                ],
                "resetType": "Never",
                "planProductUniqueId": 1509277,
                "id": 1719495,
                "uri": ""
            },
            "quantity": 1,
            "isIncluded": true,
            "startDate": null,
            "subscriptionProductOverride": null,
            "subscriptionProductPriceOverride": null,
            "chargeAtSubscriptionActivation": true,
            "isCharged": true,
            "subscriptionProductDiscount": null,
            "subscriptionProductDiscounts": [
            ],
            "customFields": null,
            "monthlyRecurringRevenue": 39.99,
            "netMonthlyRecurringRevenue": 39.99,
            "amount": 39.99,
            "status": "Active",
            "lastPurchaseDate": "2017-05-12T21:36:31.0000794Z",
            "earningSettings": {
                "earningTimingInterval": "Daily",
                "earningTimingType": "StartOfInterval"
            },
            "remainingInterval": null,
            "groupQuantityChangeCharges": false,
            "priceUpliftsEnabled": false,
            "priceUplifts": [
            ],
            "historicalPriceUplifts": [
            ],
            "customServiceDateNumberOfIntervals": 0,
            "customServiceDateInterval": "Periods",
            "customServiceDateProjection": "Future",
            "id": 56403857,
            "uri": "https://secure.fusebill.com/v1/SubscriptionProducts/56403857"
        }
    ],
    "remainingInterval": null,
    "remainingIntervalPushOut": null,
    "openSubscriptionPeriodEndDate": "2017-06-12T04:00:00",
    "chargeDiscount": null,
    "setupFeeDiscount": null,
    "chargeDiscounts": null,
    "setupFeeDiscounts": null,
    "customFields": null,
    "planAutoApplyChanges": false,
    "autoApplyCatalogChanges": false,
    "monthlyRecurringRevenue": 39.99,
    "netMonthlyRecurringRevenue": 39.99,
    "amount": 39.99,
    "contractStartTimestamp": null,
    "contractEndTimestamp": null,
    "expiredTimestamp": null,
    "coupons": [
    ],
    "subscriptionHasRecurringEndOfPeriodCharge": false,
    "id": 3135696,
    "uri": "https://secure.fusebill.com/v1/subscriptions/3135696"
}
Suggest Edits

Update Subscription

This action allows you to edit a Subscription. Editing a Subscription will return the updated Subscription object so you can verify your changes.

 
puthttps://secure.fusebill.com/v1/subscriptions/subscriptionId
 

Special Considerations

Request considerations: Due to the complex nature of the subscription DTO we recommend using a get/put methodology when modifying a subscription. If values are not included, they may get nullified.

Request limitations: Only the specific fields listed in the below Object tables can be edited via the PUT Subscription operation.

**To change quantity or to include or un-include a plan product the manipulation must occur here.

Change subscription name/description: To change the subscription name or description you must enter new values in the subscriptionOveride element

Editing reference: This can be done by simply submitting a value in the Reference field directly

Editing contract start and end dates: This can set by submitting UTC datetime values in the contract fields

Setting, modifying and removing the scheduled activation date: This can be set by submitting UTC date time value in the scheduledActivtionTimestamp field

Setting the expiry period: This can set by submitting a number for the remaining expiry periods in the remainingInterval field. Note that the value “0” will result in an initial charge and then immediate expiry of the subscription following activation.

Query considerations: If you wish to temporarily disable automatically sending invoice changes we have an appendable query that can temporarily turn off that feature. Here's an example of that

Example

secure.fusebill.com/v1/subscriptions/{subscription_id}?temporarilyDisableAutoPost=true

A few more important notes:

One consideration we must note is that the charges will remain on a draft unsent invoice until that draft invoice is posted.

When modifying a subscription with discounts you are required to remove the subscriptionProductDiscount (legacy object) entity and leave subscriptionProductDiscounts in place in order to carry forward your discounts.

Setting the PriceUpliftsEnabled key-value to "False" from a previous value of "True" will delete existing, future and historical price uplifts.

Property
Type
Description

subscriptionId

Decimal

This is the Subscription Id which uniquely identifies this individual Subscription. This Id is used to refer to this Subscription specifically.

customerId

Decimal

This is the Id of the Customer to whom this Subscription has been applied.

planCode

String

This is the unique code which represents the Plan of which this Subscription is an instance.

planName

String

This is the name of the Plan of which this Subscription is an instance.

planDescription

String

This is the description text of the Plan of which this Subscription is an instance.

planReference

String

This is a text field which will be populated with the reference text from the Plan. This field is not exposed on the Invoice.

status

String

This is the status of this subscription. Accepted values are "Active", "Draft", "Cancelled", "Provisioning" and "Expired". Draft indicates that the Subscription has not yet been activated. Provisioning indicates this Subscription has been provisioned but that the Setup Fee and recurring Charge has not been applied to the Customer. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future. "Migrated" if the Subscription was migrated to another.

reference

String

This is a text field you can populate with reference text for this subscription. This field is not exposed on the Invoice.

hasPostedInvoice

Boolean

This indicates if this Subscription has caused an invoice to be created and posted against the Customer's account.

CreatedTimestamp

DateTime

This indicates when the Subscription was created.

ActivatedTimestamp

DateTime

This indicates when the Subscription was activated.

ProvisionedTimestamp

DateTime

This indicates when the Subscription was provisioned.

NextPeriodStartDate

DateTime

This indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.This indicates when the next billing period for the Subscription will begin. Normally, this indicates when the Subscription will bill and apply charges to the Customer's account.

remainingInterval

Decimal

This is the number of billing intervals in the lifetime of this Subscription. If this value is set to "null" the Subscription will renew indefinitely. If this is set to a number than after that number of intervals has passed the subscription will change into an "Expired" status automatically and stop billing the Customer.

ScheduledActivationTimestamp

DateTime

If set, this indicates when the Subscription should activate. To set a Subscription as "Provisioned" you must set a Scheduled Activation Date for some time in the future. The Subscription will automatically set to an "Active" status on the Scheduled Activation Date.

remainingInterval

Number

This lists the default number of intervals that remain before expiry. This is a default set at the plan level.

remainingIntervalPushOut

Number

This is the setting to default what the new remaining interval when the subscription is up for renewal.

openSubscriptionPeriodEndDate

DateTime

This is the date that the current billing period will end. Often, this field will match the "nextPeriodStartDate" value.

chargeDiscount

chargeDiscount

This is the Discount entity which applies to the base recurring charge for this subscription. (This is a legacy object use chargeDiscounts collection)

setupFeeDiscount

Discount

This is the Discount entity which applies to the base setup fee charge for this subscription.(This is a legacy object use setupFeeDiscounts collection)

chargeDiscounts

Discount

This is the Discount entity which applies to the base recurring charge for this subscription. (Use this collection for discounts)

setupFeeDiscount

Discount

This is the Discount entity which applies to the base setup fee charge for this subscription.(This is a legacy object use setupFeeDiscounts collection)

chargeDiscounts

Discount

This is the Discount entity which applies to the base recurring charge for this subscription. (Use this collection for discounts)

setupFeeDiscounts

Discount

This is the Discount entity which applies to the base setup fee charge for this subscription. (Use this collection for discounts)

planAutoApplyChanges

Boolean

This field related to Grandfathering control. If True, this indicates that the Plan from which this Subscription is made usually pushes changes to the Plan down to existing Subscriptions - this forces existing customers onto the newest version of the Plan.
If set to False, this 'grandfathers' the Customer into the version of the Plan they Subscribed to and does not push changes.

autoApplyCatalogChanges

Boolean

This field controls if this specific Subscription should automatically push changes to the underlying Plan to this Subscription. If set to True, changes will be pushed automatically. If False, this Subscription will not reflect updates to the Plan from which it was made.

monthlyRecurringRevenue

Number, generated automatically by Fusebill, cannot be changed.

The calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.

netMonthlyRecurringRevenue

Decimal

The net MRR of the customer. Calculated by considering any discounts on the customers active subscription products.

amount

Number

The amount of the subscription.

contractStartTimestamp

DateTime

This is the date that the contract period will begin.

contractEndTimestamp

DateTime

This is the date that the contract period will end.

uri

String

This is the URI which can be used to reference this Subscription Product directly.

Plan Frequency Fields

Property
Type
Description

planRevisionId

Decimal

This is the unique identifier for this plan revision

numberOfIntervals

Decimal

This is the number of intervals that this plan will renew for

interval

String

Valid strings are “Monthly”, “Yearly”

numberOfSubscriptions

Decimal

This is the number of instances of this plan currently in the system as subscriptions

status

String

Valid strings are “Draft”, “Active”, “Retired”

setupFees

Array

This is an Array of Setup Fee objects. There are up to one object per active currency. Setup Fees are optional and may not be included in a plan. If they are not included this array would be empty.

charges

Array

This is an Array of Charges objects. There are up to one object per active currency. These Charges are optional and may not be included in a plan. If they are not included this array would be empty.

isProrated

Boolean

This indicates if this Subscription should prorate its charges if activated in the middle of a billing cycle.

prorationGranularity

String

This defines how granular the proration calculation should be. Valid strings are "Monthly" or "Daily".

planFrequencyUniqueId

Number

This is an internal only identifier, do not modify this value.

id

Decimal

This is the unique identifier.

uri

String

This is the URI referring to this Plan Frequency object.

Setup Fee Fields

Property
Type
Description

amount

Decimal

This is the cost of the setup fee

currency

String

This indicates which currency this fee applied is charged in

id

Decimal

This is the unique identifier for this fee

url

String

This is the URI to view this object

Charge Fields

Property
Type
Description

amount

Decimal

This is the monthly recurring charge

currency

String

This indicates which currency this charge is charged in

id

Decimal

This is the unique identifier for this charge

url

String

This is the URI to view this object

Subscription Override Properties

Property
Type
Description

Name

String

This is the value which will override the PlanName field value. This override value will appear on invoices and in other Customer facing locations.

Description

String

This is the value which will override the PlanDescription field value. This override value will appear on invoices and in other Customer facing locations.

Charge

Decimal

This value will override the cost of the recurring charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription bills each period. Additional charges, from Products for example, are not affected by this and will continue to bill normally.

SetupFee

Decimal

This value will override the cost of the setup fee charge in the Plan. The amount entered here becomes the new amount charged to the Customer when the Subscription is activated. Additional charges, from Products for example, are not affected by this and will continue to bill normally.

Plan Products Fields

Property
Type
Description

subscriptionId

Decimal

This is the Subscription Product Id that uniquely refers to this Subscription product. This is important for action including this object such as managing the Subscription Product Items inventory.

planProduct

Array

This is the Plan Product object. This object contains most of the details and configuration regarding the product being sold as part of this subscription. See Plan Product for more details.

Quantity

Decimal

This is the number of units of this Subscription Product being purchased.

isIncluded

Boolean

This indicates if this Subscription Product is included in the Customer's Subscription

subscriptionProductOverride

Array

This contains a set of fields to override the name and description of the Subscription Product.

subscriptionProductPriceOverride

Array

This contains a set of fields to override the pricing for the Subscription Product

ChargeAtSubscriptionActivation

Boolean

This flag informs the system to either charge for this Subscription Product when the Subscription is activated (True) or to charge when it is Provisioned (False).

StartDate

DateTime

This is the date on which this Subscription Product should begin to charge the Customer

IsCharged

Boolean

This flag indicates if this Subscription Product has been charged. If it has applied a charge then this field will be True.

subscriptionProductDiscount

Array

This is the Discount entity applied to this Subscription Product. See the ChargeDiscount description below for details.

customFields

Array

This is the list of Custom Fields applied to this Subscription Product. These fields will match the Plan Product fields unless the field values in the Subscription have been changed in which case these fields show the data applied to the Subscription Product and not the default value seen in the Plan Product.

monthlyRecurringRevenue

Number

The calculated monthly recurring revenue value for this Customer. This is calculated based on expected income based on the current Subscription value. Only recurring charges are included in this calculation and One Time Goods and Physical Goods purchases, which do not recur, are not included.

netMonthlyRecurringRevenue

Decimal

The net MRR of the customer. Calculated by considering any discounts on the customers active subscription products.

amount

Decimal

This is the dollar amount to apply against the above invoice.

customServiceDateNumberOfIntervals

Decimal

This value represents the number of intervals in the past or in the future that you would like to set this service date for.

customServiceDateInterval

String

Possible service date values are "Periods", "Dates" and "Months".

customServiceDateProjection

String

Possible values are "Past" or "Future".

status

String

This is the current status of the plan product.

lastPurchaseDate

DateTime

This is the last date of purchase.

earningSettings

Array

This is a small collection of th earning interval type and timing.

id

Decimal

This is the unique identifier

uri

String

This is the URI which can be used to reference this Subscription Product directly.

Earning Interval Settings

Property
Type
Description

earningInterval

String

The period in which a product will earn. Strings may be "Daily", "Monthly", or "Yearly".

earningNumberOfIntervals

Number

earningTimingInterval

String

earningTimingType

String

This delineates if the earnage is to occur at the beginning or the end of the period. The accepted strings are "StartOfInterval" or "EndOfInterval"

Subscription Product Override Fields

Property
Type
Description

Name

String

This is the value which will override the ProductName field value. This override value will appear on invoices and in other Customer facing locations.

Description

String

This is the value which will override the Product Description field value. This override value will appear on invoices and in other Customer facing locations.

Subscription Product Price Fields

Property
Type
Description

ChargeAmount

Decimal

This value will override the cost of the Product. The amount entered here becomes the new amount charged to the Customer when the Subscription bills each period or when the Quantity is increased on this Product. Additional charges, from the Subscription for example, are not affected by this and will continue to bill normally.

Property
Type
Description

discountType

String

This field indicates the type of discount applied. Valid entries are "Percentage" or "Amount".

amount

Number

For Percentage discounts, this is the percentage which is discounted from the charge (if the discount is 25%, this value will be 25). For Amount discounts this is the actual value to subtract from the charge.

remainingUsagesUntilStart

Number

This is the number of billing cycles which must pass before the discount is applied.

remainingUsage

Number

This is the number of billing cycles which must pass before the discount automatically expires and is removed. This will be NULL for discounts which are perpetual.

Custom Fields
Property
Type
Description

key

String

This is the unique key of the Custom Field you wish to modify.

friendlyName

String

This is the text friendly label for the key.

dataType

String

This is the data type for the custom field.

value

String

This is the value you wish to update the custom field to. This will always be the string version of the value. If you wish to pass a number, for example, pass it as "123". Likewise, a DateTime would be passed as "2014-06-26T04:00:00". We will use the known data type of the custom field to properly convert the String to a Number, DateTime, etc.

Price Uplift Fields

Property
Type
Description

priceUpliftEnabled

Boolean

This is a True or False value, which allows you to set the price uplift feature as enabled or disabled.

priceUplifts

List

This is a list of price uplift interval objects.

historicalPriceUplifts

List

This is list of surpassed price uplift intervals.

Examples
curl -X PUT "https://secure.fusebill.com/v1/subscriptions" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{id:{subscriptionId},customerId:{customerId},planCode:'PlanCode',planName:'PlanName',status:'Draft',reference:null,subscriptionProducts:[]}"
 //Json Payload
string jsonData = "{id:{subscriptionId},customerId:{customerId},planCode:'PlanCode',planName:'PlanName',status:'Draft',reference:null,subscriptionProducts:[]}";
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/subscriptions");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey);
//Set request method
request.Method = "PUT";
//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 = {"customerId":{id},"planFrequency":
{"planRevisionId":{id},"numberOfIntervals":1,"interval":"Monthly","numberOfSubscriptions":1,"status":"Active","setupFees":[],"charges":
[],"isProrated":"false","prorationGranularity":None,"planFrequencyUniqueId":{id},"remainingInterval":None,"id":{id},"uri":None},"planCode":"plan2","planName
":"Plan-
2","planDescription":None,"planReference":None,"status":"Active","reference":None,"subscriptionOverride":None,"hasPostedInvoice":"true","createdTimestamp":"
2017-02-09T19:35:55","activatedTimestamp":"2017-02-09T19:36:26","provisionedTimestamp":None,"nextPeriodStartDate":"2017-03-
09T05:00:00","scheduledActivationTimestamp":None,"subscriptionProducts":[{"subscriptionId":131087,"planProduct":
{"status":"Active","productId":{id},"planId":{id},"productCode":"product1","productName":"Product-
1","productStatus":"Active","productDescription":None,"productType":"RecurringService","productGLCode":"","quantity":1.0,"maxQuantity":None,"isRecurring":"t
rue","isFixed":"false","isOptional":"true","isIncludedByDefault":"false","isTrackingItems":"false","chargeAtSubscriptionActivation":"true","orderToCashCycle
s":[{"planFrequencyId":{id},"planProductId":{id},"numberOfIntervals":1,"interval":"Monthly","chargeModels":
[{"chargeModelType":"Signup","chargeTimingType":"StartOfPeriod","prorationGranularity":"Daily","prorateOnPositiveQuantity":"false","prorateOnNegativeQuantit
y":"false","reverseChargeOnNegativeQuantity":"false","id":{id},"uri":None},
{"chargeModelType":"Lifetime","chargeTimingType":"Immediate","prorationGranularity":"Daily","prorateOnPositiveQuantity":"false","prorateOnNegativeQuantity":
"false","reverseChargeOnNegativeQuantity":"false","id":{id},"uri":None}],"remainingInterval":None,"groupQuantityChangeCharges":"false","planProductPriceUp
lifts":None,"earningInterval":"Monthly","earningNumberOfIntervals":1,"earningTimingInterval":"Daily","earningTimingType":"StartOfInterval","pricingModel":
{"pricingModelType":"Standard","quantityRanges":[{"min":0.0,"max":None,"prices":
[{"amount":0.0,"currency":"USD","id":747012,"uri":None}],"id":0,"uri":None}],"id":{id},"uri":None},"id":{id},"uri":None}],"resetType":"Never","planProdu
ctUniqueId":{id},"id":{id},"uri":""},"quantity":1.0,"isIncluded":"true","startDate":None,"subscriptionProductOverride":None,"subscriptionProductPriceOverr
ide":None,"chargeAtSubscriptionActivation":"true","isCharged":"true","subscriptionProductDiscount":None,"subscriptionProductDiscounts":
[],"customFields":None,"monthlyRecurringRevenue":0.0,"netMonthlyRecurringRevenue":0.0,"amount":0.0,"status":"Active","lastPurchaseDate":None,"earningSetting
s":
{"earningTimingInterval":"Daily","earningTimingType":"StartOfInterval"},"remainingInterval":None,"groupQuantityChangeCharges":"false","priceUpliftsEnabled":
"false","priceUplifts":[],"historicalPriceUplifts":[],"id":{id},"uri":"https://stg-
secure.fusebill.com/v1/SubscriptionProducts/{id}"}],"remainingInterval":None,"remainingIntervalPushOut":None,"openSubscriptionPeriodEndDate":"2017-03-
09T05:00:00","chargeDiscount":None,"setupFeeDiscount":None,"chargeDiscounts":None,"setupFeeDiscounts":None,"customFields":None,"planAutoApplyChanges":"false
","autoApplyCatalogChanges":"false","monthlyRecurringRevenue":0.0000,"netMonthlyRecurringRevenue":0.0000,"amount":0.0000,"contractStartTimestamp":None,"cont
ractEndTimestamp":None,"expiredTimestamp":None,"coupons":[],"subscriptionHasRecurringEndOfPeriodCharge":"false","id":{id},"uri":"https://stg-
secure.fusebill.com/v1/subscriptions/{id}"}
#Pass in your URI, Payload and Headers
r = requests.put('https://secure.fusebill.com/v1/subscriptions', data=json.dumps(payload), headers=headers)
print(r.content)
Response
{
    "customerId": 186838,
    "planFrequency": {
        "planRevisionId": 177229,
        "numberOfIntervals": 1,
        "interval": "Monthly",
        "numberOfSubscriptions": 1,
        "status": "Active",
        "setupFees": [
        ],
        "charges": [
        ],
        "isProrated": false,
        "prorationGranularity": null,
        "planFrequencyUniqueId": 4791,
        "remainingInterval": null,
        "id": 4791,
        "uri": null
    },
    "planCode": "simplemonthly",
    "planName": "Simple Monthly",
    "planDescription": null,
    "planReference": null,
    "status": "Active",
    "reference": null,
    "subscriptionOverride": null,
    "hasPostedInvoice": true,
    "createdTimestamp": "2017-04-05T17:11:10",
    "activatedTimestamp": "2017-04-05T17:15:11",
    "provisionedTimestamp": null,
    "nextPeriodStartDate": "2017-04-10T04:00:00",
    "scheduledActivationTimestamp": null,
    "subscriptionProducts": [
        {
            "subscriptionId": 177229,
            "planProduct": {
                "status": "Active",
                "productId": 16758,
                "planId": 2804,
                "productCode": "recurringmonthlyproduct",
                "productName": "Recurring Monthly Product",
                "productStatus": "Active",
                "productDescription": null,
                "productType": "RecurringService",
                "productGLCode": "",
                "quantity": 1,
                "maxQuantity": null,
                "isRecurring": true,
                "isFixed": false,
                "isOptional": true,
                "isIncludedByDefault": false,
                "isTrackingItems": false,
                "chargeAtSubscriptionActivation": true,
                "orderToCashCycles": [
                    {
                        "planFrequencyId": 4791,
                        "planProductId": 18374,
                        "numberOfIntervals": 1,
                        "interval": "Monthly",
                        "chargeModels": [
                            {
                                "chargeModelType": "Signup",
                                "chargeTimingType": "StartOfPeriod",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 970993,
                                "uri": null
                            },
                            {
                                "chargeModelType": "Lifetime",
                                "chargeTimingType": "Immediate",
                                "prorationGranularity": "Daily",
                                "prorateOnPositiveQuantity": false,
                                "prorateOnNegativeQuantity": false,
                                "reverseChargeOnNegativeQuantity": false,
                                "id": 970993,
                                "uri": null
                            }
                        ],
                        "remainingInterval": null,
                        "groupQuantityChangeCharges": false,
                        "planProductPriceUplifts": null,
                        "customServiceDateNumberOfIntervals": 1,
                        "customServiceDateInterval": "Periods",
                        "customServiceDateProjection": "Future",
                        "earningInterval": "Monthly",
                        "earningNumberOfIntervals": 1,
                        "earningTimingInterval": "Daily",
                        "earningTimingType": "StartOfInterval",
                        "pricingModel": {
                            "pricingModelType": "Standard",
                            "quantityRanges": [
                                {
                                    "min": 0,
                                    "max": null,
                                    "prices": [
                                        {
                                            "amount": 20,
                                            "currency": "USD",
                                            "id": 970993,
                                            "uri": null
                                        }
                                    ],
                                    "id": 0,
                                    "uri": null
                                }
                            ],
                            "id": 970993,
                            "uri": null
                        },
                        "id": 970993,
                        "uri": null
                    }
                ],
                "resetType": "Never",
                "planProductUniqueId": 18108,
                "id": 18374,
                "uri": ""
            },
            "quantity": 1,
            "isIncluded": true,
            "startDate": null,
            "subscriptionProductOverride": null,
            "subscriptionProductPriceOverride": null,
            "chargeAtSubscriptionActivation": true,
            "isCharged": true,
            "subscriptionProductDiscount": null,
            "subscriptionProductDiscounts": [
            ],
            "customFields": null,
            "monthlyRecurringRevenue": 20,
            "netMonthlyRecurringRevenue": 20,
            "amount": 20,
            "status": "Active",
            "lastPurchaseDate": "2017-04-05T17:11:20",
            "earningSettings": {
                "earningTimingInterval": "Daily",
                "earningTimingType": "StartOfInterval"
            },
            "remainingInterval": null,
            "groupQuantityChangeCharges": false,
            "priceUpliftsEnabled": false,
            "priceUplifts": [
            ],
            "historicalPriceUplifts": [
            ],
            "customServiceDateNumberOfIntervals": 1,
            "customServiceDateInterval": "Periods",
            "customServiceDateProjection": "Future",
            "id": 970993,
            "uri": "https://secure.fusebill.com/v1/SubscriptionProducts/970993"
        }
    ],
    "remainingInterval": null,
    "remainingIntervalPushOut": null,
    "openSubscriptionPeriodEndDate": "2017-04-10T04:00:00",
    "chargeDiscount": null,
    "setupFeeDiscount": null,
    "chargeDiscounts": null,
    "setupFeeDiscounts": null,
    "customFields": null,
    "planAutoApplyChanges": false,
    "autoApplyCatalogChanges": false,
    "monthlyRecurringRevenue": 20,
    "netMonthlyRecurringRevenue": 20,
    "amount": 20,
    "contractStartTimestamp": null,
    "contractEndTimestamp": null,
    "expiredTimestamp": null,
    "coupons": [
    ],
    "subscriptionHasRecurringEndOfPeriodCharge": false,
    "id": 177229,
    "uri": "https://secure.fusebill.com/v1/subscriptions/177229"
}
Suggest Edits

Activate Subscription

The Subscription Activation call does not require a content body.

This action will set the status of a Subscription to Active, which in most cases this will generate an invoice, and depending on the customer's billing options, apply a charge and a collection attempt against the Customer's payment method.

The Subscription will activate regardless of the collection attempt failing or succeeding so you should review the invoices to ensure payment was successful. This call will return the Subscription which you have activated so you can verify that the status field is set to Active. This action can only be performed against Subscriptions which have a status value of Draft or Provisioning.

In Fusebill, each Subscription is attached to a Billing Period which defines the start and end of the billing cycle and the duration (eg: one month, starting from the 1st of January or 1 Year starting on the 4th of May). Fusebill allows a Customer to have multiple Billing Periods which means different Subscriptions can have different start and end dates (eg: one Subscription starting on the 4th of the month, one on the 9th, etc). You can define the Billing Period that the Subscription should align to when you perform this call by passing in the appropriate fields in the call body.

 
posthttps://secure.fusebill.com/v1/SubscriptionActivation/subscriptionId?preview=preview&showzerodollarcharges=showzerodollarcharges&temporarilyDisableAutoPost=temporarilyDisableAutoPost&view=sideeffects
 

Request Examples