Braintree Card Token Import

This method takes a Braintree customer ID and payment method token and latches it to the Fusebill customer. The payment method remains in the Braintree vault but is usable through Fusebill. Once imported, the payment method can be employed in the usual way with the Fusebill generated payment method ID.

Request Parameters

customerIdIntegerThe Fusebill generated customer IDYes
braintreeCustomerIdStringThe ID uniquely identifying the customer in BraintreeYes
braintreeCardIdStringThe ID of the Braintree cardYes
curl -X POST " \ 
-H "Content-Type: application/json" \ 
-H "Authorization: Basic {APIKey}" \ 
-d "{customerId:{customerId}, braintreeCustomerId:{ID}, braintreeCardId:{ID}}"
//Json Payload 
 string jsonData ="{customerId:{customerId}, braintreeCustomerId:{ID}, braintreeCardId:{ID}}" 
//Setup API key 
string apiKey = "{APIKey}"; 
//Configure URI 
WebRequest request = WebRequest.Create("HTTPS:// "); 
//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())) 
//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 
#Import library json 
import json 
#Define your payload parameters  
payload = {"customerid":{CustomerID}," braintreeCustomerId ":{ID}",  braintreeCardId ": "{ID}"} 
#Define your header parameters 
headers = {'Authorization' : 'Basic {API Key}', 'Content-Type' : 'application/json'} 
#Pass in your header and payload and store your response object 
r ='',data=json.dumps(payload), headers=headers) 
  "maskedCardNumber": "************1111", 
  "cardType": "Visa", 
  "expirationMonth": 1, 
  "expirationYear": 23, 
  "customerId": 172677, 
  "firstName": "John", 
  "lastName": "Doe", 
  "address1": "232 Herzberg Road", 
  "address2": "Suite 203", 
  "countryId": 124, 
  "country": "", 
  "stateId": 9, 
  "state": "", 
  "city": "Kanata", 
  "postalZip": "K2K 2A1", 
  "isDefault": true, 
  "externalCustomerId": "597374124", 
  "externalCardId": "fy8sdk", 
  "storedInFusebillVault": false, 
  "id": 82620, 
  "uri": null 
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
            "Key": "Api Error",
            "Value": "Customer with id 1 not found."