Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

For general API request structure and authentication, see API Request & Response General Structure.

The getCardNo command uses the following endpoint:

POST https://your-hyp-environment-url/xpo/Relay

Request parameters

Parameter
Type
Description

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

terminalNumber - string

The terminal number associated with your merchant account.

cardId - string

The card identifier token obtained from a previous transaction or tokenization process.

Example: 1092880571131111

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 number

  • cardExpiration: Card expiration date (may be empty for security)

Error response

Code examples

Error codes

Code
Description
Solution

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

  • doDeal - Process payments using stored cards

Best practices

  1. Use for display purposes only - Never store the retrieved card numbers; use tokens for all processing

  2. Implement proper access controls - Ensure only authorized users can retrieve card information

  3. Cache card information temporarily - Avoid repeated API calls for the same card tokens within a session

  4. Handle expired tokens gracefully - Card tokens may expire and should be refreshed through new tokenization

  5. Mask sensitive information - The returned card number is already masked, and you need to ensure proper display in your UI

  6. Validate token integrity - Check that card tokens haven't been corrupted before making requests

Last updated

Was this helpful?