getCardNo
Overview
The getCardNo command retrieves the masked card number associated with a stored card token. This command allows merchants to display recognizable card information to customers while maintaining PCI compliance by working with tokenized card data.
Use cases
Use getCardNo when you need to:
Display masked card numbers to customers in account management interfaces
Show saved payment methods for customer selection during checkout
Retrieve card information for transaction verification purposes
Provide customers with card details for their own records
Implement saved card management features in your application
Request structure
The getCardNo command uses the following endpoint:
POST https://your-hyp-environment-url/xpo/Relay
Request parameters
user
string
Username for API authentication (body parameter)
password
string
Password for API authentication (body parameter)
int_in
string
XML payload containing the request data (body parameter)
XML request structure
Command parameters
Required parameters
Response structure
Success response
Key Response Fields:
cardNo: Masked card number (e.g.,xxxxxxxxxxxx1111)cardMask: Alternative masking format (e.g.,411111******1111)cardBin: Bank Identification Number (first 6 digits)cardBrand: Card brand with code (e.g., Visa, MasterCard)cardLength: Total length of the card numbercardExpiration: Card expiration date (may be empty for security)
Error response
Code examples
Error codes
000
Permitted transaction
Card information retrieved successfully
325
Invalid XML format
Check XML structure and ensure all required fields are present
342
Card id was not found
Verify the cardId token is valid and corresponds to an existing card
405
SSL HTTPS customers are not permitted to access the system
Verify username and password are correct
414
An XML field or an INT_IN parameter is too short/long
Check field lengths match API requirements
462
Wrong value in header
Verify terminal number is correct and authorized
Related commands
doDeal- Process payments using stored cards
Best practices
Use for display purposes only - Never store the retrieved card numbers; use tokens for all processing
Implement proper access controls - Ensure only authorized users can retrieve card information
Cache card information temporarily - Avoid repeated API calls for the same card tokens within a session
Handle expired tokens gracefully - Card tokens may expire and should be refreshed through new tokenization
Mask sensitive information - The returned card number is already masked, and you need to ensure proper display in your UI
Validate token integrity - Check that card tokens haven't been corrupted before making requests
Last updated
Was this helpful?