HomeGuidesAPI Reference
API Reference

Embedded Apple Pay

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

The Apple Pay S2S (Server-to-Server) Sale API facilitates secure processing of Apple Pay transactions. It enables merchants to transmit the Apple Pay payment token directly from their frontend to EdfaPay for authorization and capture.

Apple pay S2S payment flow is shown below

This integration method is particularly well-suited for merchants who:

  • Maintain control over their checkout workflow.
  • Have implemented the Apple Pay JS API within their website or application.
  • Possess an Apple Developer Account and manage their own Apple Pay certificate and domain verification.

Important: Unlike the Checkout Integration, EdfaPay does not host the Apple Pay domain for S2S merchants. Consequently, merchants are solely responsible for independently configuring their Apple Pay environment.


Endpoint

POST https://app-api.edfapay.com/api/v1/payment-gateway/s2s/apple-pay

Content-Type: application/json

❗️

Security Note

All API requests must be sent over HTTPS to ensure data integrity and confidentiality.


Authentication

All requests to this endpoint must include a valid X-API-KEY in the request header for authentication.

The X-API-KEY must be sent from the server side and must not be exposed on the client side.

How to generate API key


Request Parameters


FieldTypeRequiredDescription
orderIdStringYesUnique identifier for the order
amountNumberYesTransaction amount
currencyStringYesTransaction currency in ISO format (e.g., SAR).
customerObjectYesCustomer details object
cardObjectYesCard details object
successUrlStringYesRedirect URL after successful 3DS authentication
failureUrlStringYesRedirect URL after failed 3DS authentication

Customer Object

FieldTypeRequiredDescription
nameStringYesCustomer full name
emailStringYesCustomer email address
phoneStringYesCustomer phone number

Card Object

FieldTypeRequiredDescription
tokenStringYesApple Pay payment token object from Apple Pay JS API
🚧

For orderId

Must be unique per transaction. Duplicate orderId may result in rejected payments.

Request Example

curl --location 'https://app-api.edfapay.com/api/v1/payment-gateway/s2s/apple-pay' \
--header 'X-API-KEY: <Your API Key>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "orderId": "12345",
  "amount": 1.00,
  "currency": "SAR",
  "customer": {
    "name": "John",
    "email": "[email protected]",
    "phone": "+12345678"
  },
  "successUrl": "https://success.com",
  "failureUrl": "https://failure.com",
  "card": {
    "token": "{\"paymentData\":{\"data\":\"xxxxxxxxxxxxxx\",\"signature\":\"xxxxxxxxxx\",\"header\":{\"publicKeyHash\":\"xxxxxxxxx\",\"ephemeralPublicKey\":\"xxxxxxxxxxx\",\"transactionId\":\"xxxxxxxxxxxxxxx\"},\"version\":\"EC_v1\"},\"paymentMethod\":{\"displayName\":\"xxxx xxxx\",\"network\":\"xxxx\",\"type\":\"xxxx\"},\"transactionIdentifier\":\"xxxxxxx\"}"
  }
}'

Response Example

{
    "action": "SALE",
    "result": "SUCCESS",
    "status": "SETTLED",
    "order_id": "12345",
    "trans_id": "XXXXXXXXXXXXX",
    "trans_date": "29-03-2026 18:07:06",
    "descriptor": null,
    "decline_reason": null,
    "rrn": "XXXXXXXXXXXXX",
    "processor_mid": "XXXXXXXXXX"
}
💡

Notes for Merchants:

  • It is crucial to validate the result field; "SUCCESS" indicates a successful payment.
  • Retain the trans_id and rrn for purposes of refunds and comprehensive transaction tracking.
Response

Language
URL
LoadingLoading…
Response
Choose an example:
text/plain