get https://secure.fusebill.com/v1/paymentMethods//creditCard
This function allows you to retrieve a specific credit card payment method by it's ID.
Path Parameters
Property | Type | Description |
---|---|---|
paymentMethodId | Integer | This is the unique ID of the CreditCard Payment Method you want to retrieve. |
Examples
curl -X GET "https://secure.fusebill.com/v1/paymentMethods/{paymentMethodId}/creditCard/" \
-H "Content-Type: application/json" \
-H "Authorization: Basic {APIKey}"
//query parameter
int paymentId = {paymentMethodId};
//Setup API key
string apiKey = "{APIKey}";
//Configure URI
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/paymentMethods/" + paymentId + "/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/paymentMethods/{id}/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":false,
"externalCustomerId":null,
"externalCardId":null,
"storedInFusebillVault":true,
"isUsedForBillingPeriodOverride": false,
"id":82620,
"uri":null
}
{
"ErrorId": 0,
"HttpStatusCode": 404,
"Errors": [
{
"Key": "Api Error",
"Value": "CreditCard with id 123 not found."
}
]
}