Register merchant with apple-pay-gateway-cert

Hello everyone, I would like to register a merchant with a merchant identifier, calling https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant, but I am getting a 401 error.

The payment processing certificate and the merchant identity certificate (with name merchant.com.identity.us.test) have already been defined on the apple account account.

I am executing this post request:

curl -v --cert-type P12 --cert keystore.p12:passwordForMyKeystore -d '{"domainNames":["my-test-domain.com","my-live-test-domain.com"], "partnerMerchantName":"TESTMERCH1", "partnerInternalMerchantIdentifier":"test-merch-partner", "encryptTo":"merchant.com.identity.us.test"}' -H "Content-Type: application/json" -X POST https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant

The keystore.p12 I am using in the above post request, has been created with the identity certificate (merchant.com.identity.us.test) and with the private key created when generating the CSR.

The response I am getting is this one:

* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=apple-pay-gateway-cert.apple.com; O=Apple Inc.; L=Cupertino; ST=California; C=US; serialNumber=C0806592; jurisdictionStateOrProvinceName=California; jurisdictionCountryName=US; businessCategory=Private Organization
*  start date: Jul 17 17:32:39 2023 GMT
*  expire date: Oct 15 17:42:39 2023 GMT
*  subjectAltName: host "apple-pay-gateway-cert.apple.com" matched cert's "apple-pay-gateway-cert.apple.com"
*  issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 1 - G1
*  SSL certificate verify ok.
* using HTTP/1.1
> POST /paymentservices/registerMerchant HTTP/1.1
> Host: apple-pay-gateway-cert.apple.com
> User-Agent: curl/8.1.2
> Accept: */*
> Content-Type: application/json
> Content-Length: 304
> 
< HTTP/1.1 401 Unauthorized
< x-keystone-correlationid: cdcf1cc6-1f6f-4b92-bd6c-245a602bcaa3
< content-type: application/json
< content-length: 87
< date: Thu, 05 Oct 2023 08:28:18 GMT
< x-envoy-upstream-service-time: 14
< x-apay-service-response-details: via_upstream
< 
{
  "statusMessage": "Payment Services Exception Unauthorized",
  "statusCode": "401"
* Connection #0 to host apple-pay-gateway-cert.apple.com left intact
}

Have I done anything wrong in generating the Keystore?

Kind regards, Antonio.

Register merchant with apple-pay-gateway-cert
 
 
Q