put https://secure.fusebill.com/v1/customers
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.
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 "[email protected]; [email protected]; [email protected]". 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 "[email protected]; [email protected]; [email protected]". 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 | Enum:{Mr, Mrs, Ms, Miss, Dr} | The prefix-title of the customer. |
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 | 3 character ISO currency code | The Currency configured for this Customer. |
customerReference | Object (defined below) | This is used to store additional data related to this customer, including sales tracking codes. |
customerAcquisition | Object (defined below) | This is used to store different details about how this customer was acquired. Generally, this is used to store marketing channel information. |
parentId | Integer | The Parent ID relates to the Fusebill hierarchy feature. If hierarchy is enabled, this is the id of the parent customer. |
quickBooksLatchType | Enum:{CreateNew, LatchExisting, DoNothing} | Indicates how Fusebill is handling latching for this customer object and the possible corresponding customer in QuickBooks Online. This is for the QuickBooks Online plugin. |
quickBooksId | Integer | The name ID of this customer in QuickBooks Online. For the QuickBooks Online plugin. |
id | Integer | The Fusebill generated ID that uniquely identifies this customer. |
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 |
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 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':'[email protected]','primaryPhone':'809997777','secondaryEmail':'[email protected]','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": "Katelyn",
"middleName": "Kent",
"lastName": "Floyd",
"companyName": "Ronbert",
"suffix": "Sr.",
"primaryEmail": "[email protected]",
"primaryPhone": 9964413586,
"secondaryEmail": "[email protected]",
"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"
}
Response
{
"firstName": "Katelyn",
"middleName": "Kent",
"lastName": "Floyd",
"companyName": "Ronbert",
"suffix": "Sr.",
"primaryEmail": "[email protected]",
"primaryPhone": 9964413586,
"secondaryEmail": "[email protected]",
"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,
"hubSpotCompanyId":null,
"geotabId": "7813",
"modifiedTimestamp": "2019-11-07T15:51:11.1915461Z",
"createdTimestamp": "2018-01-01T03:33:33.02",
"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."
}
]
}