12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
interface PrimerPaymentMethodTokenData {  analyticsId?: string;  id?: string;  isVaulted?: boolean;  paymentInstrumentData: PrimerPaymentInstrumentData;  paymentInstrumentType: string;  token: string;  tokenType?: PrimerTokenType;  threeDSecureAuthentication?: PrimerThreeDSAuthenticationData;  vaultData?: PrimerVaultData;}
enum PrimerTokenType {  SINGLE_USE = 'SINGLE_USE',  MULTI_USE = 'MULTI_USE',}
interface PrimerThreeDSAuthenticationData {  challengeIssued?: boolean;  protocolVersion?: string;  reasonCode?: string;  reasonText?: string;  responseCode?: string;}
interface PrimerVaultData {  customerId?: string;}
export interface IPrimerPaymentInstrumentData {  network?: string;  cardholderName?: string;  first6Digits?: number;  last4Digits?: number;  accountNumberLast4Digits?: number;  expirationMonth?: number;  expirationYear?: number;  externalPayerInfo?: IExternalPayerInfo;  klarnaCustomerToken?: string;  sessionData?: IKlarnaSessionData;  paymentMethodType?: string;  binData?: IBinData;  bankName?: string;}
export interface IKlarnaSessionData {  recurringDescription?: string;  billingAddress?: IKlarnaBillingAddress;}
export interface IKlarnaBillingAddress {  email?: string;}
interface ExternalPayerInfo {  email: string;  externalPayerId?: string;  firstName?: string;  lastName?: string;}
interface ShippingAddress {  firstName?: string;  lastName?: string;  addressLine1?: string;  addressLine2?: string;  city?: string;  state?: string;  countryCode?: string;  postalCode?: string;}
interface BinData {  network?: string;  issuerCountryCode?: string;  issuerName?: string;  issuerCurrencyCode?: string;  regionalRestriction?: string;  accountNumberType?: string;  accountFundingType?: string;  prepaidReloadableIndicator?: string;  productUsageType?: string;  productCode?: string;  productName?: string;}
ts
copy
Properties

An unique identifier for the payment instrument token.

id
string

Payment method identifier.

isVaulted
boolean

Indicating the use of vaulted instruments for the payment method.

paymentInstrumentData
PaymentInstrumentData

Additional information about the payment instrument. Depending on the payment method type, only some of the following properties are present on the object.

Properties
network
string?
The human readable representation of card network (e.g., Visa, Mastercard).
The name of the cardholder.
The first 6 digits of the card number.
The last 4 digits of the card number.
The last 4 digits of the account number.
The expiration month of the card, in 2-digit format.
The expiration year of the card, in 4-digit format.
externalPayerInfo
IExternalPayerInfo?
Additional Paypal data.
Properties
email
string
The payer's email address.
The payer's unique ID.
firstName
string?
The payer's given name.
lastName
string
The payer's given surname.
sessionData
IKlarnaSessionData?
A unique string identifier for the payment method. (e.g. `PAYPAL`, `GOOGLE_PAY`)
binData
IBinData?
Additional BIN data.
Properties
network
string?
The card network (e.g., VISA, MASTERCARD, AMEX).
bankName
string?
The name of the bank.

The type of the payment instrument.

Example of possible values (new values could be added as we add new payment methods):

  • APPLE_PAY
  • CARD_OFF_SESSION_PAYMENT
  • GOOGLE_PAY
  • KLARNA_CUSTOMER_TOKEN
  • OFF_SESSION_PAYMENT
  • PAYMENT_CARD
  • PAYPAL_BILLING_AGREEMENT
  • PAYPAL_ORDER
token
stringRequired

The payment instrument token you can use to create a payment request from your backend.

tokenType
"SINGLE_USE" | "MULTI_USE"
Whether this payment method token can be used only once or multiple times.
threeDSecureAuthentication
ThreeDSAuthenticationData
Properties
responseCode
ThreeDSecureStatus

Indicates the outcome of the 3D Secure authentication process.
Possible values:

  • AUTH_SUCCESS: The authentication was successful.
  • AUTH_FAILED: The authentication process failed.
  • SKIPPED: The authentication was skipped.
  • CHALLENGE: A challenge was issued during the authentication process.
An optional code indicating the reason for the outcome of the 3D Secure authentication.
An optional text description providing further details about the reason for the authentication outcome.
Specifies the version of the 3D Secure protocol that was used.

Indicates whether a challenge was issued as part of the authentication process.

  • true: A challenge was issued.
  • false: No challenge was issued.
vaultData
PrimerVaultData
Properties

The customerId associated to the payment method, if vaulted.