Create an Apple Pay Session

To create an Apple Pay Session, pass a validation_url while creating an apple_pay_sessions resource. Finix returns a merchantSession object which you can use to create a payment. For more information, see Apple Pay.

Copy
Copied
curl https://finix.sandbox-payments-api.com/apple_pay_sessions \
    -H "Content-Type: application/vnd.json+api" \
    -u  USwV2ayDfbTwjUmrftEBKhgk:9bf27419-0ef6-40f5-bce7-3b0eafb1ac88 \
    -d '
    {
        "display_name": "Finix Test Merchant",
        "domain": "www.finixtestmerchant.com",
        "merchant_identity": "IDmULj61C8ke6Y7qQiKENJ7",
        "validation_url": "https://apple-pay-gateway-cert.apple.com/paymentservices/paymentSession"
}'

Example Response

Copy
Copied
{
    "id": "APPLEPAYSESSION_xxx",
    "created_at" : "2021-11-22T23:58:19.50Z",
    "updated_at" : "2021-11-22T23:58:19.50Z",
    "session_details": "{\"epochTimestamp\":1640213041060,\"expiresAt\":1640216641060,\"merchantSessionIdentifier\":\"SSH1524BA9006A944B8B9B8FB60227D9990_916523AAED1343F5BC5815E12BEE9250AFFDC1A17C46B0DE5A943F0F94927C24\",\"nonce\":\"a5ee8554\",\"merchantIdentifier\":\"23D5E1F154400B277E14CC8361878AA0AAFD46B2DF74003C7587B256269102BD\",\"domainName\":\"tj.ngrok.io\",\"displayName\":\"Christmas Shopping\",\"signature\":\"...\",\"operationalAnalyticsIdentifier\":\"Christmas Shopping:23D5E1F154400B277E14CC8361878AA0AAFD46B2DF74003C7587B256269102BD\",\"retries\":0}",
    "_links": {
        "self": {
            "href": "https://finix.sandbox-payments-api.com/apple_pay_sessions/APPLEPAYSESSION_xxx"
        }
    }
}

HTTP Request

POST https://finix.sandbox-payments-api.com/apple_pay_sessions

Request Arguments

Field Type Description
display_name string, required This will be the merchant name shown to users when making a purchase via Apple Pay.
domain string, required The domain where the buyer is initiating the payment.
merchant_identity string, required The merchant_identity_id used when registering the business with Apple Pay through our registration API.
validation_url string, required A validation URL that will be provided by the Apple SDK front-end for every payment.