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


ICardSubscriptions Interface#

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

Methods#

METHODDESCRIPTION
focusFocus on a hosted 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.
requestDeviceTokenObtain a payment token with a card.
resetReset a hosted field.

focus#



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

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 the CVV field.

Example#

CVV field validation

onFieldBlur#



This event is emitted when the field loses focus.

Parameters#

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

Examples#

Handling the blur event to get FormValidity.
Handling blur event to get cvv FieldValidity

onFieldFocus#



This event is executed when the field is focused.

Parameters#

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

Examples#

Handling focus event to get FormValidity
Handling focus event to get cvv FieldValidity

onFieldSubmit#



This event is executed when the field has been sent.

Parameters#

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

Examples#

Handling submit event to get FormValidity
Handling submit event to get FieldValidity

onFieldValidity#



This event is executed when the field validity changes.

Parameters#

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

Examples#

Handling FormValidity event of cvv field
Handling FieldValidity event of cvv field

requestDeviceToken#



Retrieve a secure device token for on-demand subscriptions or one-click payments.
This method validates whether the cvv field is valid and generates a device token. If the validation fails, an exception is thrown.
If the merchant or subscription requires 3DS or Sift Science services, this method automatically performs the necessary validations according to each rule.

Parameters#

- body: DeviceTokenRequest (Optional)Object with subscriptionId and other params for specific cases.

Returns#

- Promise<TokenResponse>: TokenResponse object with token

Throws#

KushkiErrorResponse object with code and message of error

Errors#

The following is the list of errors that can be returned by the requestToken() method as a KushkiError object:
- If an error occurs on the "requestDeviceToken" endpoint, the system throws an E002 error.
- If an error occurs on the "requestMerchantSettings" endpoint, the system throws an E003 error.
- If the merchant has Sift Science configurations and options.subscriptionId is missing in the request body or the request fails, the system throws an E016 error.
- If the merchant is configured with a 3DS rule and an error occurs on the "requestJWT" endpoint, the system throws an E004 error.
- If the merchant is configured with a 3DS rule and an error occurs during 3DS authentication, the system throws an E005 error.
- If the merchant is configured with a 3DS rule and an error occurs during 3DS session validation, the system throws an E006 error.
- If the cvv field is invalid, the system throws an E007 error.
- If the "DeviceTokenRequest" body is not defined, the system throws an E020 error.

Examples#

Example for 3DS and Sift validations

reset#



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

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
Untitled Doc
Next
Untitled Doc
Built with