We’re attempting to call the Apple Pay Web Merchant Registration API using our Platform Integrator flow and consistently receive 401 Unauthorized, despite successful TLS/mTLS.
Details: Endpoint: https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant (POST) Payload: { "domainNames": ["breakerfy.com"], "encryptTo": "platformintegrator.ai.packman", "partnerInternalMerchantIdentifier": "merchant.ai.packman.1", "partnerMerchantName": "breakerfy", "merchantUrl": "https://breakerfy.com" } Domain association: URL: https://breakerfy.com/.well-known/apple-developer-merchantid-domain-association
What we tried: We created a Payment Platform Integrator ID (platformintegrator.ai.packman) We created a CertificateSigningRequest We used the certificate signing request to create an Apple Pay Platform Integrator Identity Certificate and downloaded the signed certificate. We exported the Private Key from keychain access in PKCS 12 format We converted both the private key and the signed certificate to PEM format We created a merchant id We used the converted keys to send requests to the API We received { "statusMessage": "Payment Services Exception Unauthorized", "statusCode": "401" }
we also tried curl with the original p12 file and also had no luck.
What could be the issue ?
Hi @yamanlakis,
Sorry for the delayed response while we focused on planning, preparing and staffing WWDC26.
I want to provide more guidance for other platform integrators receiving 401 errors from the registerMerchant endpoint.
Troubleshoot the 401 Unauthorized error
A 401 Unauthorized error when calling the Apple Pay Web Merchant Registration API typically indicates that the platform integrator identity certificate used for mutual TLS (mTLS) authentication is not correctly configured or is not recognized by Apple Pay servers. Ensure that you are using the correct platform integrator identity certificate and that your server is configured for mutual TLS 1.2 or later with a supported cipher suite.
Verify certificate and key configuration
-
Ensure the platform integrator identity certificate is correctly associated with your Payment Platform Integrator ID in the Apple Developer portal and that you're approved to use the API.
-
Verify that the private key used for the mTLS connection matches the public key of the identity certificate uploaded to the Apple Developer portal.
-
If you exported the identity from Keychain, ensure you exported it as a
.p12file containing both the certificate and the private key, and then correctly extracted them into PEM format.
Confirm you're using the correct certificate type
There are multiple certificates in the Apple Pay ecosystem:
- Merchant Identity Certificate — Used with mTLS for individual merchant integrations.
- Platform Integrator Identity Certificate — Used with mTLS for platform/PSP integrations.
- Payment Processing Certificate — Used for encrypting payment tokens and decrypting payment data.
Since you're a platform integrator, please confirm the following:
- Your certificate was generated under the correct Platform Integrator ID (not a Merchant ID).
- The certificate is specifically the Identity Certificate (not the Payment Processing one).
- It was created in the Apple Developer portal under Certificates, Identifiers & Profiles > Identifiers > Platform Integrator IDs.
Validate server-side mTLS setup
Your server must perform mutual TLS authentication when calling the registration API. Ensure your server is configured to present the platform integrator identity certificate during the TLS handshake. You can test your certificate configuration using curl to verify that the certificate is accepted by the Apple Pay gateway:
% curl -v \
--cert /path/to/cert.pem \
--key /path/to/key.pem \
https://apple-pay-gateway.apple.com/paymentservices/registerMerchant \
-H "Content-Type: application/json" \
-d '{
"merchantIdentifier": "merchant.com.example",
"domainNames": ["example.com"],
"partnerInternalMerchantIdentifier": "internal-id",
"partnerMerchantName": "Example Store"
}'
Check the verbose (-v) output for:
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
If an empty certificate message is returned, the certificate isn't being sent.
Please let me know if you have any further questions or are unable to resolve the 401 errors.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer