comecerodocs

Validate the Apple Pay merchant

POST
/carts/{cart_id}/user_agent_payment_request/{payment_method_type}/merchant_validate

Gets an Apple Pay merchant session for this checkout. Call it from the browser's onmerchantvalidation handler with the validation URL Apple gave, then pass data to event.complete(). Only apple_pay is supported. A closed cart is 422. Any token type may call it; a limited token only for a bound cart.

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

cart_id*string

The id of the cart.

payment_method_type*"apple_pay"

The payment method type. Only apple_pay is supported; another valid type is 404, an unknown one 400.

Value in"apple_pay"

Request Body

application/json
  1. body

The validation URL Apple Pay gave the browser.

validation_url*string

event.validationURL from the onmerchantvalidation handler. It must be an Apple host.

Formaturi

Response Body

The Apple Pay merchant session.

application/json
  1. response

Apple Pay's merchant session for this checkout.

data*|

The merchant session object from Apple, as Apple returned it. Pass it to event.complete() in the onmerchantvalidation handler.

Example Request
curl -X POST 'https://api.comecero.com/api/v1/carts/string/user_agent_payment_request/apple_pay/merchant_validate' \  -H 'Content-Type: application/json' \  -d '{  "validation_url": "https://apple-pay-gateway.apple.com/paymentservices/startSession"}'
Example Response
{  "data": {    "epochTimestamp": 1793990400000,    "expiresAt": 1793994000000,    "merchantSessionIdentifier": "SSH0000000000000000000000000000000000000000",    "nonce": "0a1b2c3d",    "merchantIdentifier": 0,    "domainName": "shop.example.com",    "displayName": "Example Shop",    "signature": "308006092a864886f70d0107"  }}