Kushki Developer Portal
  1. Card-Interface
Kushki Developer Portal
  • KUSHKI API
    • Kushki Developer Portal 🚀
    • Perú 🇵🇪
    • Ecuador 🇪🇨
    • Chile 🇨🇱
    • México 🇲🇽
    • Colombia 🇨🇴
    • Libraries & SDKs (Online Payments)
      • Release notes
      • Mobile
        • Kushki Android
        • Kushki iOS 
        • Kushki iOS ARM Setup
      • Web
        • Kushki.js 🌐
        • kushki.js-hosted-fields
          • kushki.js Hosted Fields
          • Guía de migración a Kushki.js 2.0
          • Javascript
          • Card Payouts
            • Interfaces
              • Interface `FormValidity`
              • Interface `Styles`
              • Interface `CardPayoutUniqueTokenResponse`
              • Interface `CardPayoutSubscriptionTokenResponse`
              • Interface `CardPayoutOptions`
              • Interface `Fields`
              • Interface `Field`
              • Interface `FieldValidity`
            • Type Aliases
              • Type Alias `InputTypeEnum`
              • Type Alias `CardPayoutTokenResponse`
            • Errors
              • Errors
            • Card Payouts Interface
              • Interface `ICardPayouts`
            • Enumerations
              • Enumeration `InputModelEnum`
            • Methods
              • initCardPayoutToken method
            • Types
              • Type Alias `CssProperties`
          • Antifraud
            • Interfaces
              • Untitled Doc
              • Untitled Doc
              • SiftScienceObject Interface
            • Methods
              • Untitled Doc
              • requestInitAntiFraud method
              • Untitled Doc
          • Kushki
            • Interfaces
              • Untitled Doc
              • CommissionConfigurationRequest interfaces
              • Untitled Doc
            • Classes
              • Untitled Doc
            • Methods
              • requestBankList function
              • requestCommissionConfiguration function
              • Kushki.js Hosted Fields init function
          • Card
            • Card-Interface
              • Untitled Doc
              • Untitled Doc
            • Interfaces
              • Untitled Doc
              • AppleTokenResponse Interface
              • Untitled Doc
              • Untitled Doc
              • BrandByMerchantResponse Interface
              • ApplePayOptions Interface
              • ApplePayPaymentContact Interface
              • ApplePayGetTokenOptions Interface
              • Untitled Doc
              • Untitled Doc
              • MasterCardBrandingRequest Interface
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • VisaBrandingRequest Interface
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
            • CarApplePay interface
              • ICardApplePay Interface
            • Errors
              • Untitled Doc
            • Methods
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
              • requestInitCardBrandingAnimation method
              • Untitled Doc
              • requestBrandsByMerchant method
            • Types
              • Untitled Doc
              • Untitled Doc
              • Untitled Doc
    • Schemas
      • webhooksChargeback
      • one-and-two-step-payment
      • webhooks
      • transactionType
      • threeDomainSecure
      • product
      • payment_submethod
      • paymentMethod
      • orderDetails
      • headers
      • extraTaxes
      • documentType
      • currency
      • currency-cash-in
      • currency-CL
      • binInfo
      • UnexpectedErrorResponse
      • SubscriptionUpdate
      • SubscriptionAdjustmentRequest
      • Subscription
      • Submerchant
      • Shipping-Address
      • Promotions
      • Metadata
      • Language
      • InvalidBinResponse
      • GetConfigurationRequest
      • ErrorResponse
      • Deferred
      • Country
      • ContactDetails
      • ChargesVoidCardResponse
      • Channel
      • Card
      • Billing-Address
      • BadRequestResponse
      • Amount
      • Amount-cash-in
      • Amount-CL
  • APPIAN-SUBMERCHANT-REGISTER
    • Submerchant Validation in Batch
    • Query submerchant status by requestId/submerchantId
    • Get submerchantIds
    • Get credentials for submerchants
  1. Card-Interface

Untitled Doc


ICard Interface#

This interface contains all the methods to be used when resolving initCardToken().

Methods#

METHODDESCRIPTION
focusFocus on a server-side field.
getFormValidityValidate all fields.
onFieldBlurThis event is emitted when the field loses focus.
onFieldFocusThis event is executed when the field is focused.
onFieldSubmitThis event is executed when the field has been submitted.
onFieldValidityThis event is executed when the validity of the field changes.
onOTPValidationThis event is triggered when OTP validation is required.
requestTokenObtain a payment token with a card.
resetReset a server-side field.

focus#



Focus on a server-side field.
This method asynchronously focuses on a form field of the specified type; otherwise, an exception will be generated.

Parameters#

PARAMETERTYPEREQUIRED
fieldTypeFieldTypeEnumNO

Errors#

CODEMESSAGEEXAMPLEDESCRIPTION
E010Error al realizar focus en el campo{ code: "E010", message: "Error al realizar focus en el campo" }If the specified field type is invalid, it will return an E010 error

Example#


getFormValidity#



This function returns a FormValidity representing the validation status of all fields.

Example#

Validation of all server-side fields.

onFieldBlur#



This event is emitted when the field loses focus.

Parameters#

PARAMETERTYPEREQUIREDDESCRIPTION
eventfieldEventYESThis callback is executed when the server-side field is blurry. fieldEvent: FieldValidity | FormValidity
fieldTypeFieldTypeEnumNOSet the field type if you want to control the event blurring of a specific server-side field

Examples#

Management of blur events of all server-side fields.
Management of the blur event of a specific server-side field.

onFieldFocus#



This event is executed when the field is focused.

Parameters#

PARAMETERTYPEREQUIREDDESCRIPTION
eventfieldEventYESThis callback is executed when the server-side field is focused. fieldEvent: FieldValidity | FormValidity
fieldTypeFieldTypeEnumNOSet the field type if you want to control the event focus of a specific server-side field

Examples#

Management of the focus events of all server-side fields.
Management of the focus event of a specific server-side field.

onFieldSubmit#



This event is executed when the field has been sent.

Parameters#

PARAMETERTYPEREQUIREDDESCRIPTION
eventfieldEventYESThis callback is executed when the server-side field is sent.
fieldEvent: FieldValidity | FormValidity
fieldTypeFieldTypeEnumNOSet the field type if you want to control the event dispatch of a specific server-side field

Examples#

Management of the submit events for all server-side fields.
Management of the submit event of a specific server-side field.

onFieldValidity#



This event is executed when the field validation changes.

Parameters#

PARAMETERTYPEREQUIREDDESCRIPTION
eventfieldEventYESThis callback is executed when the server-side field changes its validity. fieldEvent: FieldValidity | FormValidity
fieldTypeFieldTypeEnumNOSet the field type if you want to control the validity of a specific server-side field event

Examples#

Management of the validity events of all server-side fields.
Management of the validity event of a specific server-side field.

onOTPValidation#



This event is executed when a value is entered in the OTP field to validate the code. OTP authentication requires a one-time password for enhanced security in online transactions. The user will have 3 attempts to enter a valid OTP; otherwise, the transaction will be rejected.
This validation will only be executed if the merchant has an OTP rule enabled, and the condition is met.
OTP validation is activated when the third digit is entered in the OTP field. It will activate each validation event, and you can capture these events using the onError or OnSuccess callbacks. .

Parameters#

PARAMETERTYPEREQUIREDDESCRIPTION
onRequiredcallbackYESThis callback is executed when the created token needs OTP validation
onErrorcallbackYESThis callback is executed when the OTP validation returns an error
onSuccesscallbackYESThis callback is executed when OTP validation is successful

Errors#

If the OTP validation is incorrect, the onError) callback will return the following error messages:

CODEMESSAGEEXAMPLEDESCRIPTION
E008OTP validation error{ code: "E008", message: "Error en la validación de OTP" }If the OTP validation is not correct, the onError callback will return the error code E008. Please try again by entering the correct data for the OTP validation.

Examples#

Management of onOTPValidation events of the server-side field for OTP.

requestToken#



Get a payment token with a card
This method validates if all fields are valid and obtains a payment token with a card; otherwise, it will throw an exception.
If the merchant has an OTP, 3DS, or SiftScience rule enabled, this method will automatically perform validations for each rule.
When the instance of the initCardToken method is configured as a subscription, the token must be used to create a subscription; otherwise, you can continue as usual with the flow for one-time payment.
This method returns an object of type TokenResponse with the generated token and in case there are deferrals they will be returned in the response.

Errors#

The following is the list of errors that can be returned by the requestToken() method as a KushkiError object:
CODEMESSAGEEXAMPLEDESCRIPTION
E002Error en solicitud de token (Error in token request){ code: "E002", message: "Error en solicitud de token" }If there was an error when requesting a token, the error code E002 will be returned. Please validate that the required information has been submitted correctly.
E003Error en solicitud de datos del comercio (Error in requesting merchant data ){ code: "E003", message: "Error en solicitud de datos del comercio" }If there was an error requesting the merchant information. Please try again if the error persists contact Kushki support.
E004Error en solicitud de JWT ( Error in JWT request ){ code: "E004", message: "Error en solicitud de JWT" }If the merchant has a 3DS rule enabled and there was an error requesting the JWT. Please try again if the error persists contact Kushki support
E005Campos 3DS inválidos ( Invalid 3DS fields){ code: "E005", message: "Campos 3DS inválidos" }If the merchant has a 3DS rule enabled and there was an error in the 3DS authentication. Please try again making sure to enter the data correctly for the 3DS validation.
E006Error en solicitud de validación de token ( Error in token validation request){ code: "E006", message: "Error en solicitud de validación de token" }If the merchant has a 3DS rule enabled and there was an error in the 3DS validation session. Please try again making sure to enter correctly the data for the 3DS validation, if the error persists contact Kushki support
E007Error en la validación del formulario (Error in form validation){ code: "E007", message: "Error en la validación del formulario" }If any server-side field is invalid the error code E007 will be returned. Please try again making sure to enter the requested data correctly.
E008Error en la validación de OTP (OTP validation error){ code: "E008", message: "Error en la validación de OTP" }If the OTP validation is not successful, the onError callback will return the error code E008. Please try again by entering the correct data for the OTP validation

Examples#

One-time payment or subscription
One-time payment or or deferred subscription

reset#



Reset a server-side field.
This method asynchronously resets a field in the form of the specified type to its default state; otherwise, it will throw an exception.

Parameters#

PARAMETERTYPEREQUIREDDESCRIPTION
fieldTypeFieldTypeEnumNOSet the field type if you want to control the event validity of a specific server-side field event

Errors#

CODEMESSAGEEXAMPLEDESCRIPTION
E009Error al limpiar el campo{ code: "E009", message: "Error al limpiar el campo" }If the specified field type is invalid, the onError callback will return the error code E009.

Example#

Modified at 2026-02-02 22:10:25
Previous
Kushki.js Hosted Fields init function
Next
Untitled Doc
Built with