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.

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

PropertyTypeDescriptionRequired
previewStringIf 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
showZeroDollarChargesBooleanIf set to true, zero dollar charges will be included on invoices.Optional
viewStringAcceptable value is "Sideeffects". Displays resulting invoicesOptional

Request Parameters

PropertyTypeDescriptionRequired
customerIdIntegerThis is the Fusebill ID of the customerYes
activateAllSubscriptionsBooleanIf True, draft subscriptions will be activated along with the customerYes, unless preview is set to true.
activateAllDraftPurchasesBooleanIf True, draft purchases will be activated along with the customerYes, unless preview is set to true.
temporarilyDisableAutoPostBooleanThis will specify whether or not the resulting invoice from this call will post the related invoice or notYes, 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": "[email protected]",
  "primaryPhone": 8874452248,
  "secondaryEmail": "[email protected]",
  "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,
  "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"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "This activity could not be processed since the service status is Active"
        }
    ]
}
Language
Authorization