Customers

What customers activated yesterday?

To get a list of these customers, a query string can be used with the query parameter name activationTimestamp and a date range. For example, if today is August 9th 2019 then this request returns the list of customers activated on the 8th:

GET https://secure.fusebill.com/v1/customers/?query=activationTimestamp:2019-08-08|2019-08-09&pageSize=10&pageNumber=0

A quick rundown on the date range format:

2018-01-01|2018-01-05
returns data with a timestamp from the beginning of the 1st to the end of the 4th, not including the 5th

2018-01-01|
returns data with a timestamp from the beginning of the 1st and beyond

|2018-01-05
returns data with a timestamp from the beginning of time to the end of the 4th, not including the 5th

These ranges can all be specified with a timestamp as well e.g. 2020-01-01T03:15:00

We recommend using paging for all listing calls to ensure manageable responses. This example returns the first 10 customers activated in the specified day. To get the next 10 the same request could be made with pageNumber=1,2,3,4... until an empty list is returned.

How many customers were created last month?

Assuming last month was April 2018, the following request will return the list of all customers created during that month. This is not the same thing as being activated.

GET https://local.secure.fusebill.com/v1/customers?query=createdTimestamp:2018-04-01|2018-05-01&pageSize=1

The body of this response is irrelevant (hence why the pageSize is set to 1) since the count of customers fitting the criteria is kept in the response headers. The specific header is called X-Count and its value is the number of customers created in April 2018. Note that the value of pageSize or pageNumber does not alter the value of X-Count, since X-Count is not the number of customers in the body of the response.

What customers are set to auto collect?

The query parameter needed is customerbillingsetting.autoCollect. This request returns a list of customers with autoCollect set to true.

GET https://secure.fusebill.com/v1/customers?query=customerbillingsetting.autoCollect:true&pageSize=10&pageNumber=0

We recommend using paging for all listing calls to ensure manageable responses. This example returns the first 10 customers set to auto collect. To get the next 10 the same request could be made with pageNumber=1,2,3,4... until an empty list is returned.

How can I find duplicate customers?

When a customer is created, Stax Bill generates a unique read-only ID number for that customer called the 'Stax Bill ID'. There is a value called 'Customer ID' in the UI which you can set as you see fit. Stax Bill does not enforce uniqueness for that value so it entirely possible for two customers to have the same 'Customer ID'. The Stax Bill ID is the only customer field for which Stax Bill enforces uniqueness, so it is entirely possible for two customers to have all the exact same field values for every field aside from the Stax Bill ID.

If we define two customers to be duplicates if they share a customer ID (called reference in the context of the API), then if this request returns more than one customer we have found duplicates:

GET https://secure.fusebill.com/v1/customers?query=reference:{referenceValue}

Alternatively, a duplicate could be defined as having the same email address in which case this request is the check:

GET https://secure.fusebill.com/v1/customers?query=primaryEmail:{email}

The fast way to check if these requests return multiple customers is to check the value of the X-Count header to see if it is more than 1. Assuming you have a list of customer IDs or emails, you can iterate through those lists with these GET requests above to find all instances of customer duplication. If you do not have lists of customer IDs or emails then you will need to iterate through all of the customers to populate a set of customer IDs or emails.

How do I check a customer's payment history?

This request will get the list of payment activities for a customer given their Fusebill ID:

GET https://secure.fusebill.com/v1/customers/{customerId}/paymentactivities?pageSize=20&pageNumber=0&SortOrder=Ascending&SortExpression=effectiveTimestamp

We recommend using paging headers as well as sorting headers. This request would return the first 20 payment activities for the given customer, organized from oldest to most recent based on the effective timestamp.

What currency is a customer using?

There is a currency field in the customer object which contains the 3 character ISO currency code they are using. This request gets a customer object based on their Stax Bill ID:

GET https://secure.fusebill.com/v1/customers/{customerId}

What customers are using a specific currency?

The query parameter needed is called currency. The following request returns all customers using United States Dollars (USD). It also using paging parameters to reduce the size of what would otherwise likely be a very large response.

Get https://secure.fusebill.com/v1/customers?query=CurrencyID:1&pageSize=20&pageNumber=0

The '1' is the Stax Bill ID for USD. For a table mapping Stax Bill currency IDs to ISO currency names see the Developer Reference