Card Token Import

Uploads a new payment method onto the StaxBill customer using an OpenEdge Gateway (GlobalPayments) token or transaction Id. The payment method remains in the OpenEdge Gateway (GlobalPayments) vault but is usable through StaxBill.

Request Parameters

PropertyTypeDescriptionRequired
customerIdIntegerThe StaxBill generated customer IDYes
transactionIdStringThe OpenEdge transactionId used to successfully collect for a customer in the past.No
regionStringThe region of the transaction (US or CAD)Yes
tokenStringCredit card tokenYes, if no transactionId is supplied
lastFourStringThe last four digits of the credit card number.Yes, if no transactionId is supplied
firstSixStringThe first six digits of the credit card number.Yes, if no transactionId is supplied
maskedCardNumberStringMasked credit card numberYes, if no transactionId is supplied
expirationMonthIntegerMonth number of expirationYes, if no transactionId is supplied
expirationYearIntegerYear of expirationYes, if no transactionId is supplied
cardTypeStringType of cardYes, if no transactionId is supplied
makeDefaultBooleanDetermine whether you want to make this card a default payment method.No

Example

curl -X POST "https://secure.fusebill.com/v1/paymentMethodImport/GlobalPayments" \ 
-H "Content-Type: application/json" \ 
-H "Authorization: Basic {APIKey}" \ 
-d DEFINE_PAYLOAD
//Json Payload 
 string jsonData = DEFINE_PAYLOAD 
//Setup API key 
string apiKey = "{APIKey}"; 
//Configure URI 
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/paymentMethodImport/GlobalPayments "); 
//Add Content type 
request.ContentType = "application/json"; 
//Add Api key authorization 
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey); 
//Set request method 
request.Method = "POST"; 
//Add the json data to request 
using (var streamWriter = new StreamWriter(request.GetRequestStream())) 
{ 
  streamWriter.Write(jsonData); 
  streamWriter.Flush(); 
  streamWriter.Close(); 
} 
//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 
#Import library json 
import json 
#Define your payload parameters  
payload = { DEFINE_PAYLOAD } 
#Define your header parameters 
headers = {'Authorization' : 'Basic {API Key}', 'Content-Type' : 'application/json'} 
#Pass in your header and payload and store your response object 
r = requests.post('https://secure.fusebill.com/v1/paymentMethodImport/GlobalPayments',data=json.dumps(payload), headers=headers) 
print(r.content)
{
  "customerId": 123456,
  "maskedCardNumber": "424242XXXXXX4242",
  "token": "4rDs76F",
  "lastFour": "1234",
  "firstSix": "452098",
  "region": "US",
  "transactionId": null,
  "cardType": "Visa",
  "expirationMonth": 2,
  "expirationYear": 23,
  "makeDefault": true
}

Response

{
  "maskedCardNumber": "sample string 1",
  "cardType": "sample string 2",
  "expirationMonth": 3,
  "expirationYear": 4,
  "isDebit": true,
  "isGooglePay": true,
  "customerId": 5,
  "firstName": "sample string 6",
  "lastName": "sample string 7",
  "address1": "sample string 8",
  "address2": "sample string 9",
  "countryId": 1,
  "country": "sample string 10",
  "stateId": 1,
  "state": "sample string 11",
  "city": "sample string 12",
  "postalZip": "sample string 13",
  "isDefault": true,
  "isParent": true,
  "externalCustomerId": "sample string 16",
  "externalCardId": "sample string 17",
  "storedInFusebillVault": true,
  "email": "sample string 19",
  "modifiedDate": "2023-12-11T16:40:15.1968465+00:00",
  "originalPaymentMethodId": 1,
  "isUsedForBillingPeriodOverride": true,
  "businessTaxId": "sample string 21",
  "storedInStax": true,
  "paymentMethodType": "sample string 23",
  "sharing": true,
  "descendantOverrides": [
    {
      "id": 1,
      "customerId": 2,
      "sharing": true
    },
    {
      "id": 1,
      "customerId": 2,
      "sharing": true
    },
    {
      "id": 1,
      "customerId": 2,
      "sharing": true
    }
  ],
  "status": "sample string 24",
  "repeatFailureCount": 25,
  "id": 26,
  "uri": "sample string 27"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 404,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Customer with id 1 not found."
        }
    ]
}
Response
200
Language
Credentials
Header
LoadingLoading…