Need help?

Request and Response

Sample Apple token variables

paymentData:: version:EC_v1, data:3O…w=, signature:MI…YX
header:: ephemeralPublicKey:MF…A==, publicKeyHash:TM…8=, transactionId:c5…3f
paymentMethod:: displayName:Visa 0492, network:Visa, type:debit, transactionIdentifier:C5..93F

These token variables must be sent to Telr on their URL https://secure.telr.com/gateway/remote.json.

Please ensure the POST content type is set to application/x-www-form-urlencoded and perform a URL encode for the Apple Pay data.

  • applepay_enc_paydata
  • applepay_enc_paysig
  • applepay_enc_pubkey

Request parameter

FieldValueDescription
ivp_methodapplepaySet value as 'applepay'
ivp_store15164Your store ID
ivp_authkeycxkwshbs68ejbhV2 Authentication Key
ivp_amount10Transaction amount
ivp_currencyAEDTransaction currency
ivp_test0Test mode indicator
ivp_descDescriptionPurchase description
return_authreturn url for authorised transactionReturn URL for authorised transactions
return_declreturn url upon declinedReturn URL for declined transactions
return_canreturn url upon cancelledReturn URL for cancelled transactions
bill_fnameFirstNameThe customer’s forename plus any other middle names or initials they may have.
bill_snameLastnameCustomer surname (also known as family name)
bill_addr1AddressCustomer address
bill_citycityCity
bill_regionRegionRegion
bill_countryCountryCountry
bill_zip123456Zip code
bill_email[email protected]Email address
ivp_langenPayment language Page inreface
ivp_cartCartIDYour reference for the transaction. For example this could be a cart ID or order ID generated by your shopping system. This must be unique for each request. Maximum length is 63 characters.
ivp_trantypeSale/Auth/Capture/VerifyPurchase, Authorize, Capture, or Verify. Set as per the terminal configuration.
ivp_tranclassecomSet 'ecom'
delv_addr1Bill addressBill address
delv_addr2Address 2Additional address details
delv_addr3Address 3Additional address details
delv_cityCityCity
delv_regionRegionRegion
delv_countryCountryCountry
applepay_enc_versionversionFrom Apple pay token get "version"
applepay_enc_paydatadataFrom Apple pay token get "data"
applepay_enc_paysigsignatureFrom ApplePay token get "signature"
applepay_enc_pubkeyephemeralPublicKeyFrom Apple Pay token get "ephemeralPublicKey"
applepay_enc_keyhashpublicKeyHashFrom Apple Pay token get "publicKeyHash"
applepay_tran_idtransactionIdFrom Apple Pay token get "transactionId"
applepay_card_desctypeFrom ApplePay token get "type"
applepay_card_schemedisplayNameFrom ApplePay token get "displayName"
applepay_card_typenetworkFrom Applepay token get "network"
applepay_tran_id2transactionIdentifierFrom Apple Pay token get "transactionIdentifier"

Request format

{
    "store": "{{store_id}}",
    "authkey": "{{remote_api_key}}",
    "tran": {
        "id": "1236100014",
        "class": "ecom",
        "type": "sale",
        "description": "ApplePay transaction",
        "amount": "5.1",
        "test": "0",
        "currency": "AED",
        "method": "applepay"
    },
    "applepay": {
        "token": {
            "paymentData": {
                "header": {
                    "transactionId": "xxxxxxxx",
                    "ephemeralPublicKey": "xxxxxxxx",
                    "publicKeyHash": ""
                },
                "data": "",
                "signature": ""
            },
            "transactionIdentifier": "",
            "paymentMethod": {
                "network": "MasterCard 1234",
                "type": "MasterCard",
                "displayName": 2
            }
        }
    },
    "customer": {
        "name": {
            "forenames": "Test User",
            "surname": ""
        },
        "email": "[email protected]",
        "address": {
            "line1": "Address",
            "country": "AE",
            "city": "Dubai"
        },
        "phone": "0123456789"
    }
}

Response format

{
  "trace": "4001/5151/%ea6bba9",
  "transaction": {
    "ref": "040024871559",
    "type": "sale",
    "class": "ECom",
    "status": "D",
    "code": "31",
    "message": "Not authorised"
  },
  "customer": {
    "email": "[email protected]",
    "name": {
      "forenames": "A bcd",
      "surname": "sff"
    },
    "address": {
      "line1": "No address",
      "city": "Unknown",
      "country": "AE"
    }
  }
}

The Status field can have the following values, which are used to notify the user on the Apple Pay screen about the transaction status:

  • A: Authorised
  • D: Declined
  • C: Cancelled

Using a pre-decrypted Applepay token

This feature supports merchants in making a payment using a decrypted Apple Pay network token.

Use the same request parameters as above, but replace the parameters starting with 'applepay_' with the following additional parameters:

Additional Request Parameters

FieldValueDescription
applepay_net_schemeCard schemeCard Scheme
applepay_net_dpanCard numberRetrieve from Apple Pay network token's "PrimaryAccountNumber"
applepay_net_exmCard expiry monthRetrieve from Apple Pay network token's "applicationExpirationDate". If in YYMMDD format, use MM value
applepay_net_exyCard expiry yearRetrieve from Apple Pay network token's "applicationExpirationDate". If in YYMMDD format, use YYYY value, e.g., 2024
applepay_net_eciECI ValueRetrieve from Apple Pay network token's "eciIndicator"
applepay_net_iavCryptogramRetrieve from Apple Pay network token's "onlinePaymentCryptogram"

Sample JSON request

{
    "store": "{{store_id}}",
    "authkey": "{{remote_api_key}}",
    "tran": {
        "id": "4216109714",
        "class": "ecom",
        "type": "sale",
        "description": "ApplePay transaction",
        "amount": "5.1",
        "test": "0",
        "currency": "AED",
        "method": "applepay"
    },
    "applepay": {
        "networkToken": {
        "card": {
            "scheme":"visa",
            "number":"4**************6",
                "expiry":{
                     " month":"02",
                    "year":"2**8"
									}
        },
        "cryptogram":"A*******************A="
        }
		},
    "customer": {
        "name": {
            "forenames": "Test User",
            "surname": ""
        },
        "email": "[email protected]",
        "address": {
            "line1": "Digital Park - Dubai - United Arab Emirates",
            "country": "AE",
            "city": "Dubai"
        },
        "phone": "0123456789"
    }
}