Ginger Payments
Apple Pay

Start an Apple Pay session

POST
/v1/apple-pay/sessions/

Validates your merchant session with Apple. Call it when Apple triggers the onvalidatemerchant event in the browser, and pass the sessionData from the response to session.completeMerchantValidation().

See Apple Pay in your own checkout.

Authorization

apiKey
headerAuthorizationBasic <token>

Use your project's API key as the username and leave the password empty. Only use the API key from your server: it gives full access to your project.

Request Body

application/json
  1. body
validationUrl*string

The event.validationURL from Apple Pay.

Formaturi
merchantIdentifier*string

Your project ID without hyphens.

displayName*string

The name of your shop, as shown to your customer. Use the trade name of your project.

initiativeContext*string

The domain of your payment page.

Response Body

The merchant session from Apple.

application/json
  1. response
sessionData?unknown

The merchant session. Pass it to session.completeMerchantValidation() in the browser.

curl -X POST 'https://api.dev.gingerpayments.com/v1/apple-pay/sessions/' \  -H 'Content-Type: application/json' \  -d '{  "validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/startSession",  "merchantIdentifier": "05ad138f52fa40dc97515fde949dcb57",  "displayName": "Example Shop",  "initiativeContext": "shop.example.com"}'
{  "sessionData": null}