Start transaction

You can use this call to start an existing Apple Pay transaction using the CM.com Online Payments API. This step generates a valid payment session by interacting with Apple Pay servers.

Prerequisite

Get an access_token and use it as 'Bearer' token in your request. Find more details here.

Request

POST https://api.pay.cm.com/api/v1/paymentmethods/apple-pay/v1/transactions/{transactionId}/start
{
  "validationUrl": "https://apple-pay-gateway-cert.apple.com/paymentservices/startSession",
  "displayName": "My merchant commercial name",
  "domainName": "https://app-domain.tld"
}

Parameters

ParameterTypeDescriptionConstraints
validationUrlStringThe validation URL that is generated by the Apple device.
displayNameStringThe name to display on the the payment sheet. You get this information from the initialize transaction endpoint.
domainNameStringThe domain of the website on which the payment will occur. The value must match the domain from which the request is started. If there is a mismatch between this field and the domain that the Apple device determined, then the Apple Pay session will be terminated by the Apple device (with a generic error message or nothing happens).

Response

The response is an opaque merchant session object. You pass the merchant session object to your Apple Pay session’s completeMerchantValidation method (session.completeMerchantValidation(merchantSession);). You can use the merchant session object a single time. It expires five minutes after it is created.

{
 "..." : "...",
}

Response codes

HTTP statusDescription
201Apple Pay merchant session successfully retrieved.
4XXClient error response (See message for details). This response is given when the User input was incorrect or something illegal was attempted (eg. using a service without having that service configured for the user, or not being authorized).
5XXServer error response (See message for details).