Replace Credit Card Method

This function allows you to update a credit card payment method on a customer. It returns the updated Payment Method on success, which will have a new Fusebill generated ID. Using this method of editing a Payment Method exposes you to PCI Compliance requirements. If you wish to minimize your PCI Compliance risk please use the Transparent Redirect method instead.


PCI Compliance

We strongly recommended that you use the Transparent Redirect or the AJAX Redirect in order to comply with PCI compliance requirements when submitting payment method information to Fusebill.

Directly submitting payment method information through the API exposes your company to PCI compliance requirements. If your company is already PCI compliant, this could potentially allow for more advanced payment method entry scenarios.

Do not use this endpoint if your company is not PCI compliant and does not intend to adhere to these requirements.


GET/PUT pattern

Since the DTO returned by the GET methods contain masked card numbers (e.g. '***1234'), the usual GET/PUT pattern does not work for updating credit cards. To update a credit card, read the DTO from a GET, then add in the unmasked cardNumber and cvv. Use that JSON as the payload for this PUT request

Request Parameters

customerIdIntegerThis is the customer Id for the customer that this payment method is attached to.
cardNumberStringThis is the credit card number
firstNameStringThis is the first name associated with the card. Max Length: 50 characters]
lastNameStringThis is the last name associated with the card.
Max Length: 50 characters]
expirationMonthIntegerThis is the month the credit card expires.
expirationYearIntegerThis is the year the credit card expires. format: YY
cvvStringThis is the credit card cvv value.
address1Stringstandard line 1 of an address. [Max Length: 50 characters]
address2Stringstandard line 2 of an address. [Max Length: 50 characters]
countryIdIntegerThis is the Fusebill generated country code. Call Read Country ID to find the appropriate code
stateIdIntegerThis is the Fusebill generated state code. Call Read Country ID to find the appropriate code
cityStringThis is the city associated with the address associated with the card. This is required if Address Verification Services is in use. [Max Length: 50 characters]
postalZipStringThis is the regional location code (eg. ZIP code in the USA) associated with the address associated with the card. This is required if Address Verification Services is in use. [Max Length: 10 characters]
idIntegerThis is the unique ID of the Payment Method to update.
paymentCollectOptionsObject. Defined below.If the card is validated successfully, this object is used to collect a specified amount

Payment Collect Options Object

collectionAmountDecimalThe amount to be collected
curl -X PUT "" \
	-H "Content-Type: application/json" \
	-H "Authorization: Basic {APIKey}" \
	-d "{id:{paymentMethodId},customerId:{customerId},cardNumber:'4111111111111111',firstName:'John',lastName:'Doe',expirationMonth:10,expirationYear:20,cvv:'123',address1:'232 Herzberg Road',address2:'Suite 203',countryId:124,stateId:9,city:'Kanata',postalZip:'K2K 2A1',isDefault:true}"
//Json Payload
string jsonData =
  "{id:{paymentMethodId},customerId:{cutomerId},cardNumber:'4111111111111111',firstName:'John',lastName:'Doe',expirationMonth:10,expirationYear:20,cvv:'123',address1:'232 Herzberg Road',address2:'Suite 203',countryId:124,stateId:9,city:'Kanata',postalZip:'K2K 2A1',isDefault:true}";
//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 = "PUT";
//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 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 dictionary to the Payload parameter
payload = {"cardNumber":"4242424242424242","cardType":"Visa","expirationMonth":11,"expirationYear":17,"cvv":"123","customerId":186838,"firstName":"matt","lastName":"larr","address1":None,"address2":None,"countryId":None,"country":"","stateId":None,"state":"","city":None,"postalZip":None,"isDefault":"false","externalCustomerId":None,"externalCardId":None,"storedInFusebillVault":"true","id":{id},"uri":None}
#Pass in your URI, Payload and Headers
r = requests.put('', data=json.dumps(payload), headers=headers)
    "cardNumber": "4242424242424242",
    "cardType": "Visa",
    "expirationMonth": 2,
    "expirationYear": 23,
    "customerId": 611718,
    "firstName": "Veronica",
    "lastName": "Betties",
    "address1": "10 Dodge St",
    "address2": "",
    "countryId": 124,
    "country": "CAN",
    "stateId": 1,
    "state": "Alberta",
    "city": "Columbia",
    "postalZip": "V9V 9V9",
    "isDefault": false,
    "externalCustomerId": null,
    "externalCardId": null,
    "storedInFusebillVault": true,
    "email": null,
    "modifiedDate": "2019-11-28T21:07:22.9648586Z",
    "originalPaymentMethodId": null,
    "isUsedForBillingPeriodOverride": false,
    "id": 214608,
    "uri": null
   "address1":"232 Herzberg Road",
   "address2":"Suite 203",
   "postalZip":"K2K 2A1",
   "isUsedForBillingPeriodOverride": false,
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
            "Key": "Api Error",
            "Value": "Cannot edit payment method 214608 because it has been deleted."