Set Default Payment Method

This function allows you to set the default payment method on a customer.

URL Parameters

PropertyTypeDescriptionRequired
idIntegerThis is the ID of the Payment Method you want to set as the default.Yes
customerIdIntegerThis is the ID of the customer the default payment will apply to.Yes

📘

This can be set when creating payment method

When adding a payment method, the default can be set at that time as well.

Examples
curl -X POST "https://secure.fusebill.com/v1/paymentMethods/makeDefault?id={paymentMethodId}&customerId={customerId}" \
	-H "Content-Type: application/json" \
	-H "Content-Length: 0" \
	-H "Authorization: Basic {APIKey}"
//Path Parameters
int customerId = {customerId};
int paymentMethodId = {paymentMethodId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/paymentMethods/makeDefault?id="+ paymentMethodId + "&customerId="+ customerId);
//Set content Length
request.ContentLength = 0;
//Add Content type
request.ContentType = "application/json";
//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/paymentMethods/makeDefault?id={id}&customerId={id}', headers=headers)
print(r.content)
This request does not have a JSON payload
Response
{ 
   "maskedAccountNumber":"****7890",
   "maskedTransitNumber":"****1234",
   "bankAccountType":"CHQ",
   "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":null,
   "externalCardId":null,
   "storedInFusebillVault":true,
   "id":82138,
   "uri":null
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Payment method with id 206997 not found."
        }
    ]
}
Language
Authorization