Merchant not registered for domain error after successful Register Merchant API call

We have recently enrolled to the platform integrator program in order to be able to use this API https://developer.apple.com/documentation/applepaywebmerchantregistrationapi to verify our customers' domains for apple pay.

We have distributed certifications and the domain association file and have successfully conducted the domain verification call. Consequently, the domain is registered for a given merchant. However, when conducting a payment session request, we receive an error response saying that the domain is not registered.

Specific example:

We POST to https://apple-pay-gateway.apple.com/paymentservices/registerMerchant

with body:

{
    "domainNames": [
        "example.com"
    ],
    "encryptTo": "platformintegrator.com.example",
    "partnerInternalMerchantIdentifier": "example",
    "partnerMerchantName": "example"
}

and get a 200 response. The apple server successfully conducts the call to the example.com/.well-known/apple-developer-merchantid-domain-association resource.

Then the GET request to https://apple-pay-gateway.apple.com/paymentservices/merchant/example

lists the domain for this merchant:

Response

{
    "domainNames": [
        "example.com"
    ],
    "partnerMerchantName": "example",
    "partnerInternalMerchantIdentifier": "example",
    "partnerMerchantValidationURI": "/.well-known/apple-developer-merchantid-domain-association",
    "encryptTo": "<hashed merchant id>",
    "delegatedCommerce": {
        "enabled": true
    }
}

However, when trying to initiate an apple pay payment session here:

POST https://apple-pay-gateway.apple.com/paymentservices/paymentSession

Body:

{
    "merchantIdentifier": "platformintegrator.com.example",
    "displayName": "example",
    "initiative": "web",
    "initiativeContext": "example.com"
}

we receive this error response:


{
    "statusMessage": "Payment Services Exception merchantId=<hashed merchant id> not registered for domain=example.com",
    "statusCode": "400"
}

Our assumption is that after registering a domain for a merchant the apple pay process should work.

We already have a working apple pay implementation with the traditional domain verification process with merchant IDs.

We would like to know if we are missing any detail or what is causing this error in our payment process.

Answered by DTS Engineer in 893841022

Hi @foodtecsolutions,

You wrote:

We would like to know if we are missing any detail or what is causing this error in our payment process.

When you call the /registerMerchant endpoint below:

POST /paymentservices/registerMerchant

Apple Pay creates a domain-to-merchant association scoped to the sub-merchant record (identified by partnerInternalMerchantIdentifier). It doesn't create an association for your platform integrator's own Merchant ID (platformintegrator.com.example).

Your /paymentSession call then references merchantIdentifier: "platform integrator.com.example", and the Apple Pay servers fail to find the link between that ID and example.com—because it doesn't exist.

If sub-merchants have their own Merchant IDs, use those Merchant IDs in paymentSession, not your platform integrator ID:

POST /paymentservices/paymentSession
{
  "merchantIdentifier": "merchant.com.sub-merchant-id",
  "displayName": "example",
  "initiative": "web",
  "initiativeContext": "example.com"
}

However, if you (the platform) need to use your own Merchant ID in paymentSession, the domain must also be separately registered under your platform integrator's own developer account. The /registerMerchant endpoint alone will not create this association as these are two independent registries.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Hi @foodtecsolutions,

You wrote:

We would like to know if we are missing any detail or what is causing this error in our payment process.

When you call the /registerMerchant endpoint below:

POST /paymentservices/registerMerchant

Apple Pay creates a domain-to-merchant association scoped to the sub-merchant record (identified by partnerInternalMerchantIdentifier). It doesn't create an association for your platform integrator's own Merchant ID (platformintegrator.com.example).

Your /paymentSession call then references merchantIdentifier: "platform integrator.com.example", and the Apple Pay servers fail to find the link between that ID and example.com—because it doesn't exist.

If sub-merchants have their own Merchant IDs, use those Merchant IDs in paymentSession, not your platform integrator ID:

POST /paymentservices/paymentSession
{
  "merchantIdentifier": "merchant.com.sub-merchant-id",
  "displayName": "example",
  "initiative": "web",
  "initiativeContext": "example.com"
}

However, if you (the platform) need to use your own Merchant ID in paymentSession, the domain must also be separately registered under your platform integrator's own developer account. The /registerMerchant endpoint alone will not create this association as these are two independent registries.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Merchant not registered for domain error after successful Register Merchant API call
 
 
Q