AI resources
Create Apple Pay session

Creates a new Apple Pay payment session for processing payments through Apple Pay gateway. In case of success, the request will return a response with status 201.

POST

https://api.mercadopago.com/applepay/v1/session
Request parameters
Header
Authorization
string

REQUIRED

Access Token obtained through the developer panel. Must be sent in all requests.
X-Product-ID
string

REQUIRED

Product identifier.
X-Public-Key
string

REQUIRED

Public Key of your Mercado Pago application, used on the frontend. Use the test Public Key in the test environment and the production one in production. You can find it in Your integrations > Application details > Creden
Body
id
string

REQUIRED

Certificate ID of the merchant type certificate. This value is returned in the response to the /certificates/csr/generate request.
merchantIdentifier
string

REQUIRED

Merchant ID configured in the Apple Developer Portal.
domainName
string

REQUIRED

Domain name where the payment session will be used. Must match the domain verified in the Apple Developer Portal.
displayName
string

REQUIRED

Name of your store or business shown to the buyer in the Apple Pay payment flow.
Response parameters
epochTimestamp
integer
Date and time the session was created, as a Unix timestamp in milliseconds (milliseconds elapsed since January 1, 1970 UTC).
expiresAt
integer
Date and time the session expires, as a Unix timestamp in milliseconds (milliseconds elapsed since January 1, 1970 UTC).
merchantSessionIdentifier
string
Apple Pay session identifier. Send it to your frontend to complete the payment flow with Apple.
nonce
string
Random value used for security purposes.
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/applepay/v1/session'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer APP_USR-8*********88776-122*********fc20dede6*********a497d7225*********64' \
       -H 'X-Product-ID: YOUR_PRODUCT_ID' \
       -H 'X-Public-Key: APP_USR-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \
    -d '{
  "id": "CERTIFICATE_ID_MERCHANT",
  "merchantIdentifier": "merchant.your-identifier",
  "domainName": "your-domain.com",
  "displayName": "My store",
  "initiative": "web",
  "initiativeContext": "your-domain.com",
  "validationURL": "https://apple-pay-gateway.apple.com/paymentservices/startSession"
}'
Response
{
  "epochTimestamp": 1768253984908,
  "expiresAt": 1768257584908,
  "merchantSessionIdentifier": "SSH1920C0C97402...7B1B1A97F33C9C3",
  "nonce": "124074e7",
  "merchantIdentifier": "10DDB60D113BB4...CDF76292133",
  "domainName": "your-domain.com",
  "displayName": "My store",
  "signature": "308006092...2f5d0c8000000000000",
  "operationalAnalyticsIdentifier": "My store:10DDB60D113BB4...CDF76292133",
  "pspId": "psp-id-value",
  "retries": 0
}