Set Default Payment Method

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

URL Parameters

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.

curl -X POST "{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://"+ 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 ='{id}&customerId={id}', headers=headers)
This request does not have a JSON payload
   "address1":"232 Herzberg Road",
   "address2":"Suite 203",
   "postalZip":"K2K 2A1",
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
            "Key": "Api Error",
            "Value": "Payment method with id 206997 not found."