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

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

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

The getCardId 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.

cardNo - string

The credit card number to be tokenized. Should be 8-19 digits without spaces or hyphens.

Response structure

Success response

Error response

Code examples

Error codes

Code
Description
Solution

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

  • doDeal - Process payments using generated tokens

Best practices

  1. Validate card numbers - Use Luhn algorithm validation before tokenization to avoid unnecessary API calls

  2. Handle expiration validation - Ensure expiration dates are not in the past before tokenization

  3. Store tokens securely - Even though tokens are non-sensitive, store them securely in your database

  4. Implement token refresh - Tokens may expire and need to be refreshed periodically

  5. Never log card numbers - Ensure sensitive card data is never logged or stored after tokenization

  6. Use HTTPS always - All tokenization requests must use secure HTTPS connections

  7. Test with various card types - Validate that your implementation works with different card brands

  8. Implement duplicate detection - Avoid creating multiple tokens for the same card number

Last updated

Was this helpful?