Response Types
This page documents the shared response types used throughout the Tokenizer API, applicable to both Simple and Advanced modes.
Common Response Types
SuccessResponse
Response format for successful operations.
type SuccessResponse = {
/** Token for making payment on your backend */
token: string;
/** Type of payment method used */
paymentMethod: 'card' | 'ach';
/** Detailed information about the transaction */
details: CardPaymentResponse | ACHPaymentResponse;
};
See also: CardPaymentResponse, ACHPaymentResponse
ErrorResponse
Attributes of the error response for failed transactions:
type ErrorResponse = {
/** Specific error related to the card number */
cardNumber?: string;
/** Specific error related to the card's expiration date */
cardExpiration?: string;
/** Specific error related to the card's CVV */
cardCVV?: string;
/** Specific error related to the cardholder's postal code */
'billingAddress.postalCode'?: string;
/** A general error message describing the issue encountered */
error?: string;
};
Validation
Validation object provided to the onCheckValidity callback. Each property indicates whether the corresponding field passes validation.
type Validation = {
/** Validation state of the email */
email?: boolean;
/** Validation state of the email format */
emailFormat?: boolean;
/** Validation state of the postal code */
postalCode?: boolean;
/** Validation state of the cardholder name */
cardHolderName?: boolean;
/** Validation state of the card number */
cardNumber?: boolean;
/** Validation state of the card expiration */
cardExpiration?: boolean;
/** Validation state of the card CVV */
cardCVV?: boolean;
};
Card Payment Types
CardPaymentResponse
Details associated with a card payment method.
type CardPaymentResponse = {
/** Bank Identification Number */
bin: string;
/** Card brand (e.g., Visa, MasterCard) */
brand: string;
/** Type of card (e.g., credit, debit) */
cardType: string;
/** Verification details for the card */
cardVerification: CardVerification;
/** Indicator if the card supports domestic push */
domesticPushToCard: string;
/** Expiration details of the card */
expiration: CardExpiration;
/** Name of the cardholder */
holderName: string;
/** Last four digits of the card number */
lastFourCardNumber: string;
};
See also: CardVerification, CardExpiration
CardExpiration
Details regarding the card's expiration.
type CardExpiration = {
/** Expiration month of the card */
month: string;
/** Expiration year of the card */
year: string;
};
CardVerification
Information about the card's verification status.
type CardVerification = {
/** Verification status of the card */
status: string;
};
ACH Payment Types
ACHPaymentResponse
Details associated with an ACH payment method.
type ACHPaymentResponse = {
/** Status of the bank account */
status: BankAccountStatusType;
/** Name of the account holder */
holderName: string;
/** Type of account holder */
holderType: string;
/** Name of the bank */
bankName: string;
/** Type of the bank account */
bankAccountType: BankAccountType;
/** Bank routing number */
routingNumber: string;
/** Last four digits of the account number */
lastFourAccountNumber: string;
};
See also: BankAccountStatusType, BankAccountType
BankAccountStatusType
Possible statuses of the bank account.
type BankAccountStatusType = 'new' | 'validated' | 'pending' | 'errored';
BankAccountType
Types of bank accounts.
type BankAccountType = 'checking' | 'savings' | 'unknown';