Getting 401 when registering a merchant in sandbox

Hello, I am getting a 401 when calling https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant to register a merchant and link it to a merchant identity.

The merchant identity has been created, and both the merchant identity and the payment processing certificates have been created.

I have then dowloaded the merchant identity certificate from Apple, and create a keystore with the private key used to create the CSR.

The command I am issuing is the following:

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

The response I am getting is the following:

*  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
}

Has anyone had the same issue?

Getting 401 when registering a merchant in sandbox
 
 
Q