AI resources
Generate certificate CSR

Generates a new Certificate Signing Request (CSR) for Apple Pay integration. Use it to generate both the Merchant Identity Certificate (type 'merchant') and the Payment Processing Certificate (type 'payment'). In case of success, the request will return a response with status 200. After signing the CSR in the Apple Developer Portal, send the certificate to /certificates/certificate/upload.

POST

https://api.mercadopago.com/certificates/csr/generate
Request parameters
Header
Authorization
string

REQUIRED

Access Token obtained through the developer panel. Must be sent in all requests.
Body
type
string

REQUIRED

Certificate type to generate. Save the certificate_id returned in the response: you will need it to create the Apple Pay session and to upload the signed certificate.
merchant: Generates the CSR for the Merchant Identity Certificate, which validates the Apple Pay session with Apple.
payment: Generates the CSR for the Payment Processing Certificate, which allows decrypting the Apple Pay payment token.
flow
string

REQUIRED

Fixed value 'apple_pay'.
merchantIdentifier
string

REQUIRED

Merchant ID configured in the Apple Developer Portal.
organization
string

REQUIRED

Legal or trade name of your business, used as the organization name in the certificate signing request.
Response parameters
certificate_id
string
Unique identifier for the certificate. Save it to use in subsequent steps.
certificate
string
Certificate content in PEM format. Save it as a .pem file to upload to the Apple Developer Portal, then send the signed certificate to
Errors

400Request error.

invalid_request

The request body is malformed or a required field is missing. Check the JSON structure and the required parameters.

invalid_parameter

One of the parameters has an invalid value or format. Check the accepted values for each field.

401Authentication error.

unauthorized

The credentials sent are invalid or absent. Check that you are sending valid credentials for the environment you are using.

500Server error.

internal_server_error

An internal server error occurred. Wait a moment and try again. If the problem persists, contact Support with the x-request-id.

Request
curl -X POST \
    'https://api.mercadopago.com/certificates/csr/generate'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer APP_USR-1*********685765-12*********1b4332e5c*********e077d7679*********664' \
    -d '{
  "type": "merchant",
  "flow": "apple_pay",
  "merchantIdentifier": "merchant.com.example",
  "organization": "Example Corp",
  "country": "AR",
  "locality": "Buenos Aires",
  "province": "CABA"
}'
Response
{
  "certificate_id": "cert_123456789",
  "certificate": "-----BEGIN CERTIFICATE-----"
}