get https://secure.fusebill.com/v1/customers//paymentMethods/all?query=parameterName:value
This API endpoint allows a user to retrieve all payment methods against a specified 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 |
---|---|---|---|
AccountType | CHQ, SAV | firstName | String |
address1 | String | lastName | String |
address2 | String | originalPaymentMethodId | Integer |
city | String | postalZip | String |
countryId | Integer | stated | Integer |
email | String | storedInFusebillVault | Boolean |
externalCardId | String | token | String |
externalCustomerId | String |
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/all" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//Query parameter
int pathParameter = {customerId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/customers/" + pathParameter + "/paymentmethods/all" );
//Add Content type
request.ContentLength = 0;
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/all', headers=headers)
print(r.content)
Response
{
"creditCards": [
{
"maskedCardNumber": "************6128",
"cardType": "Visa",
"expirationMonth": 12,
"expirationYear": 20,
"customerId": 611718,
"firstName": "James",
"lastName": "GoldStein",
"address1": "10 Flip Ave",
"address2": null,
"countryId": 123,
"country": "CAN",
"stateId": 9,
"state": "British Columbia",
"city": "Vancouver",
"postalZip": "V9V 9V9",
"isDefault": false,
"externalCustomerId": null,
"externalCardId": null,
"storedInFusebillVault": true,
"email": null,
"modifiedDate": "2019-09-16T18:23:10.24",
"originalPaymentMethodId": null,
"isUsedForBillingPeriodOverride":false,
"id": 206997,
"uri": null
},
{
"maskedCardNumber": "************1111",
"cardType": "VISA",
"expirationMonth": 12,
"expirationYear": 20,
"customerId": 611718,
"firstName": "James",
"lastName": "GoldStein",
"address1": "10 Flip Ave",
"address2": null,
"countryId": 123,
"country": "CAN",
"stateId": 9,
"state": "British Columbia",
"city": "Vancouver",
"postalZip": "V9V 9V9",
"isDefault": false,
"externalCustomerId": null,
"externalCardId": null,
"storedInFusebillVault": true,
"email": null,
"modifiedDate": "2019-08-27T15:55:25.387",
"originalPaymentMethodId": null,
"isUsedForBillingPeriodOverride":false,
"id": 204232,
"uri": null
}
],
"achCards": [
{
"maskedAccountNumber": "****6789",
"maskedTransitNumber": "****2345",
"bankAccountType": "CHQ",
"customerId": 611718,
"firstName": "James",
"lastName": "GoldStein",
"address1": "10 Flip Ave",
"address2": null,
"countryId": 123,
"country": "CAN",
"stateId": 9,
"state": "British Columbia",
"city": "Vancouver",
"postalZip": "V9V 9V9",
"isDefault": false,
"externalCustomerId": null,
"externalCardId": null,
"storedInFusebillVault": true,
"email": null,
"modifiedDate": "2019-10-15T18:06:30.547",
"originalPaymentMethodId": null,
"isUsedForBillingPeriodOverride":false,
"id": 210575,
"uri": null
}
],
"paypalBillingAgreements": []
}
{
"ErrorId": 0,
"HttpStatusCode": 400,
"Errors": [
{
"Key": "Api Error",
"Value": "Bad request, the query is not valid. Please check your request and try again."
}
]
}