get https://secure.fusebill.com/v1/customers//paymentMethods/creditCard?query=field:queryString
This function allows you to retrieve a list of Credit Card Payment Methods on a specific customer.
Path Parameters
Property | Type | Description |
---|---|---|
customerId | Integer | The Fusebill generated ID of the customer |
This call supports string filtering (Read More)
Parameter Name | Acceptable Values | Parameter Name | Acceptable Values |
---|---|---|---|
address1 | String | firstName | String |
address2 | String | lastName | String |
city | String | maskedCardNumber | Integer (last 4 digits) |
countryId | Integer | originalPaymentMethodId | Integer |
email | String | postalZip | String |
expirationMonth | Integer (1-12) | stated | Integer |
expirationYear | Integer (2 digits) |
This call supports pagination (Read More)
&pageSize=100&pageNumber=0
This call supports sorting (Read More)
&sortOrder=Ascending
or &sortOrder=Descending
&sortExpression=expression
Examples
curl -X GET "https://secure.fusebill.com/v1/customers/{customerId}/paymentMethods/creditCard" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//query parameter
int customerId = {customerId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/"+ customerId + "/paymentMethods/creditCard/");
//Add Content type
request.ContentType = "application/json";
//Add Api key authorization
request.Headers.Add(HttpRequestHeader.Authorization, "Basic " + apiKey);
//Set request method
request.Method = "GET";
//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
#Pass in a dictionary to the Headers parameter
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'}
#Pass in your URI and Headers
r = requests.get('https://secure.fusebill.com/v1/customers/{id}/paymentMethods/creditCard/', headers=headers)
print(r.content)
Response
[
{
"maskedCardNumber":"************1111",
"cardType":"Visa",
"expirationMonth":1,
"expirationYear":20,
"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,
"isUsedForBillingPeriodOverride": false,
"id":82620,
"uri":null
},
{
"maskedCardNumber":"************1111",
"cardType":"Visa",
"expirationMonth":1,
"expirationYear":20,
"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":false,
"externalCustomerId":null,
"externalCardId":null,
"storedInFusebillVault":true,
"isUsedForBillingPeriodOverride": false,
"id":81613,
"uri":null
}
]
{
"ErrorId": 0,
"HttpStatusCode": 400,
"Errors": [
{
"Key": "Api Error",
"Value": "Bad request, the query is not valid. Please check your request and try again."
}
]
}