Cards & Wallets · Digital Wallets · Apple Pay

Validate Apple Pay Merchant

Apple have documented the overall process and references to individual stages can be found in their documentation. Once you have created an Apple Pay session you will need to perform the merchant validation process. If you are using an Access PaySuite issued Apple Pay merchant identifier, you can use the following Access PaySuite API. This API is secured by HTTP Basic using the same credentials as the transaction processing API. Calls to this API must not be made from your JavaScript implementation directly, and must come from your own server.

If you are using your own Apple Pay developer account, you will need to perform the merchant validation call directly to Apple. Follow Apple’s guidance on requesting an Apple Pay payment session.

This is an example of how this could be used with the Apple Pay JavaScript SDK:

JavaScript
applePaySession.onvalidatemerchant = function( event ) {

  var url = event.validationURL;
  var siteDomain = window.location.hostname;

  // The function createSession( url ) will make an ajax call to the site server,
  // which will in turn call the Access PaySuite service
  // /acceptor/rest/applepay/{instId}/validate/{applePayMerchantIdentifier}?validationURL={url}&siteDomain={siteDomain}
  createSession( url, siteDomain ).done( ( response ) => {
      session.completeMerchantValidation( response );
  } );
};

API endpoint

POST/acceptor/rest/applepay/{instId}/validate/{applePayMerchantIdentifier}Validate a merchant#
description:

Validates an Apple Pay merchant session for the given installation and merchant identifier

authorization:HTTP Basic
content-type: application/json
path parameters:
{
  • instId
    stringMandatoryInstallation identifier
  • applePayMerchantIdentifier
    stringMandatoryConfigured Apple Pay merchant identifier
}
query parameters:
{
  • validationURL
    stringMandatoryThe validation URL will be provided to you when you create an Apple Pay session
  • siteDomain
    stringThe domain of the website on which the Apple Pay button is being displayed
}
request body:

{} — This call takes no request body — send an empty JSON object.

Responses

200Merchant validated
400Invalid Apple Pay validation request
response body:
shared schema advancedPayments/validation-failure-outcome
{
  • status
    stringReturnedPossible values: SUCCESS, FAILED, PROCESSINGThe overall outcome of the request.
  • reasonCode
    string (≤ 255 chars)ReturnedA code indicating the overall outcome of the request. Refer to Errors for more information.
  • reasonMessage
    string (≤ 255 chars)ReturnedA message indicating the overall outcome of the request. This is where we'll provide detailed reasons for any errors.
}
401Unauthorized
response body:
shared schema advancedPayments/error-response
{
  • status
    string
  • error
    string
  • message
    string
  • path
    string
  • timestamp
    string (date-time)
}
403Not authorised to validate Apple Pay for the installation
response body:
shared schema advancedPayments/error-response
{
  • status
    string
  • error
    string
  • message
    string
  • path
    string
  • timestamp
    string (date-time)
}
500Internal Server Error
response body:
shared schema advancedPayments/error-response
{
  • status
    string
  • error
    string
  • message
    string
  • path
    string
  • timestamp
    string (date-time)
}

No examples yet.

The response body will be in JSON containing an opaque merchant session object to pass to your Apple Pay session. This is defined in the Apple Pay documentation.

Once the merchant is validated, continue to Apple Pay Payments or Apple Pay Payouts.