getCardId
Overview
The getCardId command creates a secure card token from card number information. This command enables merchants to tokenize credit card data for secure storage and future use while maintaining PCI DSS compliance by converting sensitive card data into non-sensitive tokens.
Use cases
Use getCardId when you need to:
Tokenize credit card information for secure storage and future transactions
Convert card numbers into tokens for recurring payment processing
Enable saved payment method functionality for customers
Implement secure card-on-file services
Reduce PCI DSS compliance scope by storing tokens instead of card numbers
Request structure
The getCardId 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
Error response
Code examples
Error codes
000
Success
Card tokenized successfully
039
Incorrect control number
Card number value is not valid - check card number
325
Invalid XML format
Verify XML structure is properly formatted
405
SSL HTTPS customers are not permitted to access the system
User/password authentication failed
414
An XML field or an INT_IN parameter is too short/long
Check field lengths - cardNo should be 8-19 digits
462
Wrong value in header
Terminal number is incorrect - verify terminal configuration
Related commands
doDeal- Process payments using generated tokens
Best practices
Validate card numbers - Use Luhn algorithm validation before tokenization to avoid unnecessary API calls
Handle expiration validation - Ensure expiration dates are not in the past before tokenization
Store tokens securely - Even though tokens are non-sensitive, store them securely in your database
Implement token refresh - Tokens may expire and need to be refreshed periodically
Never log card numbers - Ensure sensitive card data is never logged or stored after tokenization
Use HTTPS always - All tokenization requests must use secure HTTPS connections
Test with various card types - Validate that your implementation works with different card brands
Implement duplicate detection - Avoid creating multiple tokens for the same card number
Last updated
Was this helpful?