API Reference
Tokenize a card
POST
/credit_cardsIt is possible to define an alias for a tokenized credit card to allow for a merchant defined value to be used in place of the system generated token. Aliases can also be assigned to new cards allowing for a card to be updated while maintaining the merchant system reference.
Body Parameters
card_numberstringNumber on the card
card_holderstringName on the card
card_expirystringCard expiry date; format: MM/YYYY
cvvstringCVV of the card
aliasstring(optional)Alias to associate with the card
is_billingboolean(optional)· Defaults to falseFor Recurring transactions this field can be included set to true, which will make the cvv field optional
Request
shell
curl https://gateway.pmnts-sandbox.io/v1.0/credit_cards -u TEST:TEST -d'
{
"card_number": "5123456789012346",
"card_holder": "Bob Smith",
"card_expiry": "05/2030",
"cvv": "987"
}'Response
200Result
json
{
"successful": true,
"response": {
"token": "abcdef",
"card_holder": "Bob Smitch",
"card_number": "512345XXXXXX2346",
"card_expiry": "2030-05-31",
"card_type": "MasterCard",
"card_category": "Credit",
"card_subcategory": "Credit",
"card_issuer": "Westpac",
"card_country": "Australia",
"authorized": true,
"transaction_count": 0,
"alias": null
},
"errors": [],
"test": true
}422Result
json
{
"successful": false,
"response": {
"token": null,
"card_holder": "",
"scheme_token_status": "Failed",
"scheme_token_ready": false,
"scheme_response_id": "16660930105abc",
"request_timestamp": "2022-10-18T11:36:51+00:00",
"issuer_decision": null
},
"errors": [
"Invalid Push Account Receipt"
],
"test": false
}