Zid Docs
Merchant APIPayment APIAppsThemes
Merchant APIPayment APIAppsThemes
Help Center
Slack
  1. ApplePay
  • Our custom MCP server
  • Overview
  • Merchant Activation
  • Payment
    • Overview
    • Embedded Payment
    • Gateway Error Codes
    • Direct Payment
      POST
    • Execute Payment Request
      POST
    • Get payment status
      GET
  • ApplePay
    • ApplePay Checkout
    • Register ApplePay Domain
      POST
    • Providing Merchant Validation
      POST
  • Refund
    • Request Refund
      POST
  • Webhooks
    • Overview
    • Link Merchant Event
      POST
    • Payment Paid Event
      POST
    • Refund Event
      POST
  1. ApplePay

ApplePay Checkout

Overview#

We will integrate directly with Apple Pay on the web JS API: https://developer.apple.com/documentation/applepayontheweb
Apple Pay JS API Version 6 will be used for Apple Pay in the checkout page (as the minimal supported version).

Creating an Apple Pay Session#

An ApplePaySession will be initiated by Zid on the client side using the following params / ApplePayPaymentRequest object;
{
   currencyCode: {Merchant Currency based on country},
   countryCode: {Merchant Country},
   total: {
     label: {Store Name}, 
     amount: **
   },
   supportedNetworks: ['masterCard', 'visa', 'mada'], // Merchant Networks
   merchantCapabilities: ['supports3DS', 'supportsCredit', 'supportsDebit']
};

Validating the merchant and obtaining merchant session#

The next step is handling the onvalidatemerchant event in the payment sheet. Here we call an API provided by the partner / provider to validate the merchant with Apple, and obtain a merchant session to be passed to completeMerchantValidation callback function defined by Apple.
Here's a detailed description of this step: Providing Merchant Validation
Note: The domain where the Apple Pay button is displayed must be registered with Apple as a prerequisite. We will do this through an API endpoint exposed by the provider.
See Register Domain for more details

On Payment Authorized #

During the onpaymentauthorized event after the customer authenticates the transaction through FaceID or TouchID or whatever, an Apple payemnt token will be obtained on the client side. After obtaining the token, the payment sheet will be closed using the completePayment function. Then, a request will be sent to Zid Payments backend with the encrypted payment payload / token. From there, an execute payment API request will be sent to the payment provider passing the token.
Once the payment is authorized and an execute payment request is sent to the provider, the customer should be charged immediately.
Modified at 2025-08-10 18:55:59
Previous
ApplePay
Next
Register ApplePay Domain
Built with