Skip to main content

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;
/** Support reference ID for the failure — see below */
correlationId?: string;
};

correlationId

When a transaction fails and it is unrecoverable (e.g. a failed init, create, or tokenization step — not a simple field-validation error the user can correct), the Tokenizer reports diagnostic logs to the gateway. The gateway responds with a generated correlation_id, which the Tokenizer surfaces on the ErrorResponse as correlationId.

This ID lets support trace the exact failed attempt in the backend logs. Surface it to the user (or capture it) in your onError handler and include it when contacting support:

reverePay.onError = (status, validation, err?: ErrorResponse) => {
if (err?.correlationId) {
console.error(`Payment failed. Support reference: ${err.correlationId}`);
}
};

correlationId is only present when the log report reaches the gateway; for recoverable validation errors it is undefined.

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 = {
/** ID of the bank account*/
bankAccountID: string;
/** 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';