Kushki Developer Portal
  1. CarApplePay 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. CarApplePay interface

ICardApplePay Interface

This interface contains all methods available in the instance returned by initApplePayButton.

Watch Out!#

The Apple Pay functionality is currently in a testing phase. It is only available for merchants in Chile 🇨🇱 and Peru 🇵🇪, and supports Visa and Mastercard cards.
Please note that this functionality is subject to change without prior notice.

Hierarchy#

ICardApplePay

Methods#

Index
MethodDescription
onCancel(callback): voidTriggered when the Apple Pay token process is canceled.
onClick(callback): voidTriggered when the user clicks on the Apple Pay button.
requestApplePayToken(options): Promise<AppleTokenResponse>Starts the Apple Pay payment flow and requests a Kushki card token.

onCancel#


This event is triggered when the Apple Pay token process is canceled

Parameters#

NameTypeDescription
callback() => voidFunction executed when the tokenization process is canceled.

Returns#

void

Example#

The instance of cardApplePay must be previously initialized with initApplePayButton.
cardApplePay.onCancel(() => {
  console.log("Apple Pay token process canceled");
});

onClick#

This event is triggered when the user clicks on the Apple Pay button.

Parameters#

NameTypeDescription
callback() => voidFunction executed when the Apple Pay button is clicked.

Returns#

void

Example#

The instance of cardApplePay must be previously initialized with initApplePayButton.
cardApplePay.onClick(() => {
  console.log("Apple Pay button clicked");
});

requestApplePayToken#

Starts the Apple Pay payment flow and requests a Kushki card token.
This token is already processed and ready to be used in Kushki’s API to perform a charge.
⚠️ Important: This method requires that initApplePayButton has been successfully initialized and uses a valid ICardApplePay instance.

Parameters#

NameTypeDescription
optionsApplePayGetTokenOptionsConfiguration options for the Apple Pay payment request.
ApplePayGetTokenOptions fields:
FieldTypeDescription
countryCodestringMerchant’s country (e.g., "BR", "CL", "CO", "CR", "EC", "SV", "GT", "HN", "MX", "NI", "PA", "PE").
currencyCodestringCurrency for the transaction (e.g., "USD", "COP", "CLP", "UF", "PEN", "MXN", "BRL", "CRC", "GTQ", "HNL", "NIO").
displayNamestringThe merchant name displayed in the Apple Pay sheet.
amountnumberTransaction amount.
optionalApplePayFieldsobject (optional)Additional Apple Pay configuration fields, following Apple’s official specification. These fields allow merchants to customize their checkout experience (e.g., required shipping methods, billing address, etc.).

Returns#

Promise<AppleTokenResponse>
A promise that resolves with the tokenized payment response.

Throws#

CodeDescription
ERRORS.E025Apple Pay payments are not available.
ERRORS.E026Apple Pay token process fails.
ERRORS.E027Apple Pay token process canceled.

Example 1 — Basic usage#

try {
  const response = await cardApplePay.requestApplePayToken({
    countryCode: "EC",
    currencyCode: "USD",
    displayName: "My Store",
    amount: 5000
  });

  console.log("Card token:", response.token);
} catch (error) {
  console.error("Error requesting token:", error);
}

Example — Required billing and shipping data#

try {
  const response = await cardApplePay.requestApplePayToken({
    countryCode: "EC",
    currencyCode: "USD",
    displayName: "My Store",
    amount: 5000,
    optionalApplePayFields: {
      requiredBillingContactFields: ["postalAddress"],
      requiredShippingContactFields: ["postalAddress"],
    },
  });

  console.log("Card token:", response.token);
  console.log("Apple Wallet billing data:", response.billingContact);
  console.log("Apple Wallet shipping data:", response.shippingContact);
} catch (error) {
  console.error("Error requesting token:", error);
}
Modified at 2026-02-02 22:10:25
Previous
Untitled Doc
Next
Untitled Doc
Built with