Apple Pay
Accept Apple Pay on S2S with type APPLE_PAY — pass the device wallet token in data.token, no card_details required.
Apple Pay
Version: 3.0.0
Generate API Key for S2S channel. Navigate to Developers → API Keys → Add new API key → Select S2S in the Channel Dropdown. IP whitelist applies.
Apple Pay lets customers pay with cards stored in their Apple Wallet. On S2S, your mobile app or website collects the Apple Pay token on the client; your server sends that token to PayOrc with type: "APPLE_PAY" — you never handle raw card number or CVV.
When to use
- Native iOS checkout with Apple Pay button
- Web checkout using Apple Pay on the Web (Safari / supported browsers)
- You want wallet payments without PCI scope for card data on your server
How it works
- Customer authorizes payment in Apple Pay on the device.
- Your client receives the Apple Pay payment object.
- Your server calls
POST /s2s/v1/paymentwithclass: "ECOM",type: "APPLE_PAY", and the token indata.token(plus standard order fields). - PayOrc routes to Telr or Paymob (based on MID / routing).
- Payment completes synchronously — no customer redirect. Result is returned in the API response and via webhook if
urls.webhook_urlis set.
Use data.token for the Apple Pay object. Do not use card_details or top-level payment_token.
Supported PSPs
| PSP | S2S support |
|---|---|
| Telr | Yes |
| Paymob | Yes |
PSP is selected from merchant routing / MID configuration for the order currency.
Endpoint
| Method | URL |
|---|---|
| POST | https://api.payorc.com/s2s/v1/payment |
Please use the test credentials for sandbox testing.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
merchant-key | String | Yes | Your merchant API key |
merchant-secret | String | Yes | Your merchant API secret |
Content-Type | String | Yes | Must be application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
data.action | String | Yes | SALE or AUTH |
data.class | String | Yes | Must be ECOM |
data.capture_method | String | Yes when AUTH | AUTOMATIC or MANUAL |
data.type | String | Yes | Must be APPLE_PAY |
data.token | Object | Yes | Apple Pay token from the device — see Token object |
data.customer_details | Object | Yes | Same as S2S Payment |
data.order_details | Object | Yes | m_order_id, amount, currency, return_url, etc. |
data.items | Array | Yes | Line items |
data.billing_details | Object | Yes | Billing address |
data.shipping_details | Object | Yes | Shipping address |
data.urls | Object | No | Redirect and webhook URLs — see S2S Payment URLs |
Do not send card_details with APPLE_PAY. Only data.token is used for the wallet payload.
Token object
data.token must match the Apple Pay payment object:
| Field | Required | Description |
|---|---|---|
paymentData.data | Yes | Encrypted payment data |
paymentData.signature | Yes | Apple Pay signature |
paymentData.header.publicKeyHash | Yes | Public key hash |
paymentData.header.ephemeralPublicKey | Yes | Ephemeral public key |
paymentData.header.transactionId | Yes | Transaction ID in header |
paymentData.version | Yes | Token version |
paymentMethod.displayName | Yes | Card display name |
paymentMethod.network | Yes | Card network (e.g. Visa) |
paymentMethod.type | Yes | credit or debit |
transactionIdentifier | Yes | Apple transaction identifier |
Example request
{
"data": {
"action": "SALE",
"class": "ECOM",
"capture_method": "AUTOMATIC",
"type": "APPLE_PAY",
"customer_details": {
"m_customer_id": "1234",
"name": "John Doe",
"email": "[email protected]",
"mobile": "9876543210",
"code": "971"
},
"order_details": {
"m_order_id": "ORD-APPLE-001",
"amount": "100",
"currency": "AED",
"convenience_fee": "0",
"description": "Apple Pay order",
"return_url": "https://merchant.example.com/return"
},
"items": [
{
"title": "Product",
"quantity": 1,
"unit_price": "100.00",
"discount_amount": "0.00",
"is_refundable": true
}
],
"billing_details": {
"address_line1": "Po Box 12322",
"address_line2": "",
"city": "Dubai",
"province": "Dubai",
"country": "AE",
"pin": "54044"
},
"shipping_details": {
"shipping_name": "John Doe",
"shipping_email": "[email protected]",
"shipping_code": "971",
"shipping_mobile": "9876543210",
"address_line1": "Po Box 12322",
"address_line2": "",
"city": "Dubai",
"province": "Dubai",
"country": "AE",
"pin": "54044",
"shipping_currency": "AED",
"shipping_amount": "0"
},
"token": {
"paymentData": {
"data": "BASE64_ENCRYPTED_DATA",
"signature": "BASE64_SIGNATURE",
"header": {
"publicKeyHash": "HASH",
"ephemeralPublicKey": "BASE64_KEY",
"transactionId": "TXN_ID"
},
"version": "EC_v1"
},
"paymentMethod": {
"displayName": "Visa 1234",
"network": "Visa",
"type": "credit"
},
"transactionIdentifier": "APPLE_TXN_ID"
},
"urls": {
"success": "",
"cancel": "",
"failure": "",
"webhook_url": "https://merchant.example.com/webhook"
}
}
}Success response
Apple Pay completes synchronously (no customer redirect). The API returns the standard S2S envelope with a webhook-shaped data object (same fields as Webhook notifications).
For action: "SALE" on success, order_status is typically CAPTURED and data.action is CAPTURE. For action: "AUTH", expect order_status: "AUTHORISED" and data.action: "AUTH".
{
"status": "success",
"code": "00",
"message": "Payment completed successfully.",
"data": {
"action": "CAPTURE",
"status": "SUCCESS",
"status_code": "00",
"order_status": "CAPTURED",
"m_order_id": "ORD-APPLE-001",
"p_order_id": "1000015109",
"p_request_id": "1000015200",
"psp_ref_id": "8902217",
"transaction_id": "1000021941",
"is_live": false,
"currency": "AED",
"amount": "100.00",
"payment_method": "APPLE_PAY",
"apm_name": "APPLE_PAY",
"apm_identifier": "apple_pay",
"customer_details": {
"name": "John Doe",
"email": "[email protected]",
"code": "971",
"mobile": "9876543210",
"m_customer_id": "1234"
},
"payment_method_data": {
"scheme": "VISA",
"mask_card_number": "Visa 1234"
}
}
}data also includes billing_address, shipping_address, channel, remark, parameters, custom_data, and other fields documented in Webhook notifications. Omitted here for brevity.
Response fields (key)
| Field | Description |
|---|---|
status | API envelope: success or failed |
code | Response code (e.g. 00 on success) |
message | Human-readable message |
data.status | Transaction execution status: SUCCESS or FAILED |
data.order_status | Order state: CAPTURED, AUTHORISED, or FAILED |
data.action | Event action: CAPTURE, AUTH, etc. |
data.transaction_id | PayOrc transaction ID (string) — use for capture/void/refund |
data.apm_name | APPLE_PAY |
data.redirect_url | Not returned for Apple Pay (no redirect flow) |
Common errors
| Message | Cause |
|---|---|
token is missing or not a valid object for APPLE_PAY | Missing or invalid data.token |
card_details is not required for APPLE_PAY | Sent card_details with wallet type |
webhook_url must be passed inside urls | webhook_url sent under order_details |