Menu
Guides
API Reference

Guides

Setting up Merchant ID in Apple Pay

Learn how to create a Merchant ID in your Apple Developer account, generate the Apple Pay certificates, and validate your store domains to process Apple Pay payments on VTEX.

6 min read

To receive payments with Apple Pay, your store needs a Merchant ID, which is the identifier of your store in the Apple system. You create the Merchant ID in your Apple Developer account and then enter it in the payment provider that processes Apple Pay payments.

Setting up the Merchant ID has four stages, described in the following sections:

  1. Create the Merchant ID.
  2. Create the payment processing certificate.
  3. Validate the domains of your store.
  4. Create the merchant identity certificate.

Before you begin

Make sure you have the following:

  • An Apple Developer account.
  • A computer running macOS, required to create the merchant identity certificate, because you use Keychain Access to generate its certificate signing request and to export the certificate.
  • An API key of your VTEX account, used to upload the domain validation file.
  • A payment provider selected for your store that supports Apple Pay. You'll configure it after completing this guide.

VTEX generates the certificate signing request (CSR) used to create the payment processing certificate. Open a ticket with VTEX Support to request this file before you begin, because Apple asks for it in the middle of the certificate creation flow.

Creating the Merchant ID

The Merchant ID identifies your store in the Apple system. Apple ensures that each Merchant ID is unique, and a Merchant ID never expires. Choose an identifier that is easy to remember, such as merchant.yourStoreName.vtexpayments.com.br.apple.

To create the Merchant ID, follow these instructions:

  1. Access your Apple Developer account.

  2. Go to Certificates, IDs & Profiles > Identifiers.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAECAIAAAArjXluAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAIElEQVR4nGNwdHS8d+8eg66uLpSaPn06w9GjR+/duwcAqmUNtPK4/U4AAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-0.png","width":208,"height":335,"type":"png"}}

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAECAIAAADETxJQAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAJklEQVR4nGOQlZXNyck5fvw4g5CQ0Pz583fu3MkwadKk/2CAYAEAelIXj+a+JjgAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-1.png","width":194,"height":237,"type":"png"}}

  3. Click the add (+) button next to Identifiers.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAFklEQVR4nGOQkpZetXrtx48fr169CgAmpgelFHWrswAAAABJRU5ErkJggg==","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-2.png","width":418,"height":91,"type":"png"}}

  4. Select Merchant IDs.

  5. Click Continue.

    {"base64":"  ","img":{"width":579,"height":397,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":56195,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-3.png"}}

  6. Complete the Description and Identifier fields.

  7. Click Continue.

    {"base64":"  ","img":{"width":619,"height":126,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":11206,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-4.png"}}

  8. Review the settings.

  9. Click Register.

Creating the payment processing certificate

The payment processing certificate is associated with your Merchant ID and encrypts payment data for transactions. VTEX creates the CSR of this certificate, so keep the file sent by VTEX Support available before you begin.

The payment processing certificate expires periodically, currently every 25 months, according to the Apple documentation. Create a new certificate before the expiration date to avoid interrupting Apple Pay transactions in your store.

To create the certificate, follow these instructions:

  1. Go to Certificates, IDs & Profiles > Identifiers.

  2. In the filter at the top right of the page, select Merchant IDs.

    {"base64":"  ","img":{"width":611,"height":49,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":5409,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-5.png"}}

  3. Select the Merchant ID you created.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAI0lEQVR4nGOQlZWrrKy6evXqpctXGFTV1CoqKo4fP/7//38AmfQN6H0NGSIAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-6.png","width":611,"height":356,"type":"png"}}

  4. Under Apple Pay Payment Processing Certificate, click Create Certificate.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAFklEQVR4nGPQMTCZNXv2oUOHrl27BgAlFgcpfFKmywAAAABJRU5ErkJggg==","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-7.png","width":448,"height":80,"type":"png"}}

  5. Keep the default option No for the question about processing payments exclusively in mainland China.

    {"base64":"  ","img":{"width":623,"height":143,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":13362,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-8.png"}}

Use the CSR sent by VTEX Support instead of generating your own. The payment processing certificate requires a CSR created with the key pair that VTEX controls.

  1. On the screen with the instructions to create the CSR, click Continue.

  2. Click Choose File.

  3. Select the {merchantID}.csr file sent by VTEX Support.

  4. Click Continue.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAFklEQVR4nGOQkZE9cuTI////nz1/DgAqawhTOtqM0AAAAABJRU5ErkJggg==","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-9.png","width":597,"height":156,"type":"png"}}

  5. Click Download.

    {"base64":"  ","img":{"width":626,"height":165,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":20350,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-10.png"}}

  6. Click Done.

Validating the domains of your store

Apple requires you to register and validate every top-level domain and subdomain that displays the Apple Pay button. In this stage, Apple generates a validation file, and you publish it in your store domain through the VTEX API.

Plan to complete this stage without interruptions, because VTEX stores the domain validation file for only 60 minutes after the upload.

Validate one domain at a time. If your store uses 10 domains, repeat this procedure 10 times. According to the Apple Pay Merchant Integration Guide, domains can't be behind a proxy or a redirect, and they must be reachable by the Apple servers.

To validate a domain, follow these instructions:

  1. Go to Certificates, IDs & Profiles > Identifiers.

  2. In the filter at the top right of the page, select Merchant IDs.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAFUlEQVR4nGNQVlY+cfLk379/mhoaACk0BzygSHYTAAAAAElFTkSuQmCC","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-11.png","width":615,"height":55,"type":"png"}}

  3. Select the Merchant ID you created.

  4. Under Merchant Domains, click Add Domain.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAI0lEQVR4nGPg5eWTk5PPys6eOnUaQ119/b179758+fL16zcAdTsNVnxP8r8AAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-12.png","width":602,"height":238,"type":"png"}}

  5. In the Enter the domain you wish to register field, enter the fully qualified domain name.

  6. Click Save.

  7. Click Download to get the .txt validation file.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAI0lEQVR4nGMQFhGxs7WdN2/uvn37GBYtXMDAzCUup/Tv318AdB8KR+uTpfUAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-13.png","width":599,"height":267,"type":"png"}}

  8. Open the .txt validation file.

Don't change the content of the validation file.

  1. Copy the entire content of the file, respecting the following format:

    • Inside quotation marks
    • In JSON format, as in "{tokenContent}"
    • Without line breaks
  2. Publish the content in your store domain with the following request, using an API client such as cURL or Postman:


    _10
    curl --request POST \
    _10
    --url https://{storeDomain}/.well-known/raw/apple-developer-merchantid-domain-association.txt \
    _10
    --header 'Content-Type: application/json' \
    _10
    --header 'X-VTEX-API-AppKey: {appKey}' \
    _10
    --header 'X-VTEX-API-AppToken: {appToken}' \
    _10
    --data '"{tokenContent}"'

    Replace storeDomain with the domain you're validating, appKey and appToken with your API key credentials, and tokenContent with the content of the validation file.

    {"base64":"  ","img":{"width":1836,"height":535,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":659545,"url":"https://raw.githubusercontent.com/vtexdocs/dev-portal-content/main/docs/guides/Payments/payments-configuration-guides/setting-up-merchant-id-in-apple-pay-20.png"}}

    The response confirms that VTEX stores the file for 60 minutes. Complete the following steps within this period, or send the request again.

  3. In the Apple Developer account, return to the screen where you downloaded the validation file.

  4. Click Verify.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAI0lEQVR4nGMQFxcvLSk+eGD/uXPnGMpKS5k4+WWV1R8+uA8AhvcKzcbxM1kAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-14.png","width":596,"height":354,"type":"png"}}

When the validation succeeds, the domain appears with the Verified status. To add more domains, repeat this procedure using the Add Domain button in the Merchant Domains section.

Creating the merchant identity certificate

The merchant identity certificate authenticates the sessions between your store and the Apple Pay servers, and Apple uses it every time the Apple Pay screen is displayed to a customer.

This stage requires a computer running macOS, because you use Keychain Access to generate the certificate signing request and to export the certificate. During the export, you define a password that protects the exported data. Keep this password because you'll need it to enter it in the Apple Merchant Password field when configuring the payment provider on VTEX.

To create the certificate, follow these instructions:

  1. Go to Certificates, IDs & Profiles > Identifiers.

  2. In the filter at the top right of the page, select Merchant IDs.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAFUlEQVR4nGNQUVHZsWPn379/mhoaACfNBw4EKbYoAAAAAElFTkSuQmCC","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-15.png","width":617,"height":56,"type":"png"}}

  3. Select the Merchant ID you created.

  4. Under Apple Pay Merchant Identity Certificate, click Create Certificate.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAFUlEQVR4nGMQEBCIi4ubOXPmy5cvARlaBdFhVnZ6AAAAAElFTkSuQmCC","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-16.png","width":397,"height":107,"type":"png"}}

The merchant identity certificate requires a CSR generated with an RSA 2048-bit key pair, as described in the Apple Pay Merchant Integration Guide. This CSR is different from the one VTEX sends for the payment processing certificate.

  1. Follow the instructions displayed on the screen to create the CSR.

  2. Click Continue.

    {"base64":"  ","img":{"width":605,"height":682,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":75082,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-17.png"}}

  3. Click Download.

    {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAIAAAA7ljmRAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAALElEQVR4nGOoqKjIycl5DAYMHh4e4WFhjY2NkyZNYjh18oSYtIKqrvGxY0cBfjASlZgZCuIAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-18.png","width":588,"height":377,"type":"png"}}

  4. Double-click the downloaded file to install it in Keychain Access.

  5. Open Keychain Access.

  6. Locate the certificate you installed.

  7. Right-click the key icon of the certificate.

    {"base64":"  ","img":{"width":582,"height":109,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":40336,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/setting-up-merchant-id-in-apple-pay-19.png"}}

  8. Select Export.

  9. Name the certificate.

  10. Select the .p12 export format.

  11. Click OK.

  12. Define the password that protects the exported data.

  13. Save the certificate on your computer.

Next steps

After completing the previous stages, you have a Merchant ID, validated domains, a .p12 certificate saved on your computer, and the export password. Use this data to configure the payment provider that processes Apple Pay payments in your store, as described in Register payment and anti-fraud providers and Setting up payments with Apple Pay.

Learn more