Hello Clover Community,
I'm facing an issue while trying to generate card tokens using the Clover API. Specifically, when attempting to generate a card token for American Express or MasterCard, I'm receiving a '400 Bad Request' response with the message 'Invalid JSON format.' Interestingly, this issue does not occur when using Visa or Discover cards for token generation.
I have provided the request payloads and responses for both unsuccessful (American Express/MasterCard) and successful (Visa/Discover) cases. I'm seeking insights, advice, or potential solutions to resolve this issue and achieve successful token generation for American Express and MasterCard transactions.
Any assistance or recommendations on debugging and resolving this issue would be greatly appreciated. Thank you for your time and expertise!
CardTokenApi Endpoint: https://token-sandbox.dev.clover.com/v1/tokens
For Mastercard and American Express:
Response
{"message":"Invalid JSON format"}
Request Payload
card: {brand: "American Express", number: "371111111111114", exp_month: "4", exp_year: "2024", cvv: "5434",…}
brand: "American Express"
cvv: "5434"
exp_month: "4"
exp_year: "2024"
first6: "371111"
last4: "1114"
number: "371111111111114"
For Visa and Discover (successfull):
{card: {brand: "Visa", number: "4242424242424242", exp_month: "3", exp_year: "2025", cvv: "654",…}}
card: {brand: "Visa", number: "4242424242424242", exp_month: "3", exp_year: "2025", cvv: "654",…}
brand: "Visa"
cvv: "654"
exp_month: "3"
exp_year: "2025"
first6: "424242"
last4: "4242"
number: "4242424242424242"
{id: "clv_1TSTShChcBuTFiuaUaT1dSp3", object: "token",…}
card: {exp_month: "3", exp_year: "2025", first6: "424242", last4: "4242", brand: "VISA"}
id: "clv_1TSTShChcBuTFiuaUaT1dSp3"
object: "token"
RequestResponse:
{
"id": "clv_1TSTShChcBuTFiuaUaT1dSp3",
"object": "token",
"card": {
"exp_month": "3",
"exp_year": "2025",
"first6": "424242",
"last4": "4242",
"brand": "VISA"
}
}