Apple Pay Direct Integration

Overview

Apple Pay Direct Integration allows you to process Apple Pay payments by decrypting the Apple Pay token on your side.
After decrypting the token, you extract the card details provided by Apple Pay and send them to MyFatoorah to process the payment.

How It Works

The payment is processed immediately without redirecting the customer for authentication.
The payment result is returned directly in the same response.

Endpoint: POST /v3/payments(Create Payment)

{
    "PaymentMethod": "APPLE_PAY",
    "Order": {
        "Amount": 20
    },
    "SourceOfFund": {
        "Card": {
            "Number": "5204240498885735",
            "ExpiryMonth": "06",
            "ExpiryYear": "26",
            "Cryptogram": "ALJJjhJSf8kZAmsy+VVBAoABFA==",
        }
    },
    "IntegrationUrls": {
        "Redirection": "https://your-website.com/payment-callback"
    }
}
{
    "IsSuccess": true,
    "Message": "",
    "ValidationErrors": null,
    "Data": {
        "InvoiceId": "6389687",
        "PaymentId": "07076389687322474674",
        "PaymentURL": "https://your-website.com/payment-callback?paymentId=07076389687322474674&Id=07076389687322474674",
        "PaymentCompleted": true,
        "TransactionDetails": {
            "Invoice": {
                "Id": "6389687",
                "Status": "PENDING",
                "Reference": "2025001620",
                "CreationDate": "2025-12-24T16:37:19.8046448Z",
                "ExpirationDate": "2026-05-23T16:37:19.8046448Z",
                "ExternalIdentifier": null,
                "UserDefinedField": "",
                "MetaData": null
            },
            "Transaction": {
                "Id": "07076389687322474674",
                "Status": "FAILED",
                "PaymentMethod": "Apple Pay",
                "PaymentId": "07076389687322474674",
                "ReferenceId": "07076389687322474674",
                "TrackId": "24-12-2025_3224746",
                "AuthorizationId": "07076389687322474674",
                "TransactionDate": "2025-12-24T16:37:19.8671123Z",
                "ECI": "",
                "IP": {
                    "Address": "",
                    "Country": ""
                },
                "Error": {
                    "Code": "MF002",
                    "Message": "DECLINED : Restricted card"
                },
                "Card": {
                    "NameOnCard": "",
                    "Number": "520424xxxxxx5735",
                    "Token": "",
                    "PanHash": "98899f423ac13b6dbdc3ef62b275ece6e37d60f73b0c6894379b9c48d847c2ff",
                    "ExpiryMonth": "06",
                    "ExpiryYear": "26",
                    "Brand": "",
                    "Issuer": "",
                    "IssuerCountry": "",
                    "FundingMethod": ""
                }
            },
            "Customer": {
                "Reference": "",
                "Name": "Anonymous",
                "Mobile": "+965",
                "Email": ""
            },
            "Amount": {
                "BaseCurrency": "KWD",
                "ValueInBaseCurrency": "20",
                "ServiceCharge": "0.022",
                "ServiceChargeVAT": "0.003",
                "ReceivableAmount": "19.975",
                "DisplayCurrency": "KWD",
                "ValueInDisplayCurrency": "20",
                "PayCurrency": "KWD",
                "ValueInPayCurrency": "20"
            },
            "Suppliers": []
        }
    }
}
📘

Apple Pay Direct - Kuwait

If you are using Apple Pay in Kuwait with KWD currency, you must send the Apple Pay token, EciIndicator, and DeviceManufacturerIdentifier.

For the Apple Pay token, you only need to send:

  • The paymentMethod object
  • The transactionIdentifier

There is no need to send the full Apple Pay token object.

For the EciIndicator, if the decrypted token contains this value, you should include it in the request. If it is not, you do not need to send it.

{
    "PaymentMethod": "APPLE_PAY",
    "SourceOfFund": {
        "Token": "{\"paymentMethod\":{\"displayName\":\"MasterCard 8604\",\"network\":\"MasterCard\",\"type\":\"debit\"},\"transactionIdentifier\":\"2b240a7e58d61ba04fe7988fbc0939e91d2e5d9a869a33814f1bbd0c93398642\"}",
        "Card": {
            "Number": "5168771399996332",
            "ExpiryDay": "29",
            "ExpiryMonth": "07",
            "ExpiryYear": "31",
            "Cryptogram": "ALyquj0ROb1nAA1rGubZAoABFA==",
            //   "EciIndicator": "string",
            "DeviceManufacturerIdentifier": "050110030273"
        }
    },
    "Order": {
        "Amount": 2
    }
}
{
    "IsSuccess": true,
    "Message": "",
    "ValidationErrors": null,
    "Data": {
        "InvoiceId": "7104756",
        "PaymentId": "07077104756376086173",
        "PaymentURL": "https://demo.MyFatoorah.com/En/KWT/PayInvoice/Result?paymentId=07077104756376086173",
        "PaymentCompleted": true,
        "TransactionDetails": {
            "Invoice": {
                "Id": "7104756",
                "Status": "PENDING",
                "Reference": "2026007791",
                "CreationDate": "2026-08-25T10:15:05.6072934Z",
                "ExpirationDate": "2027-01-22T10:15:05.6072934Z",
                "ExternalIdentifier": null,
                "UserDefinedField": "",
                "MetaData": null
            },
            "Transaction": {
                "Id": "07077104756376086173",
                "Status": "FAILED",
                "PaymentMethod": "Apple Pay (Knet)",
                "PaymentId": "07077104756376086173",
                "ReferenceId": "07077104756376086173",
                "TrackId": "25-08-2026_3760861",
                "AuthorizationId": "07077104756376086173",
                "TransactionDate": "2026-08-25T10:15:05.6385734Z",
                "ECI": "",
                "IP": {
                    "Address": "",
                    "Country": ""
                },
                "Error": {
                    "Code": "MF002",
                    "Message": "Transaction not Captured!"
                },
                "Card": {
                    "NameOnCard": "",
                    "Number": "516877xxxxxx6332",
                    "Token": "",
                    "PanHash": "f4daf4593248411048159b547d58a20be178020082bfffcfd87ff3b82dffd29a",
                    "ExpiryMonth": "07",
                    "ExpiryYear": "31",
                    "Brand": "knet",
                    "Issuer": "National Bank Of Kuwait (S.A.K.)",
                    "IssuerCountry": "KWT",
                    "FundingMethod": "debit"
                }
            },
            "Customer": {
                "Name": "Anonymous",
                "Mobile": "+965",
                "Email": ""
            },
            "Amount": {
                "BaseCurrency": "KWD",
                "ValueInBaseCurrency": "2",
                "ServiceCharge": "0.02",
                "ServiceChargeVAT": "0.003",
                "ReceivableAmount": "1.977",
                "DisplayCurrency": "KWD",
                "ValueInDisplayCurrency": "2",
                "PayCurrency": "KWD",
                "ValueInPayCurrency": "2"
            },
            "Suppliers": []
        },
        "Card": null
    }
}

Did this page help you?