Create Card Token API

The merchant can use this service to store the customer cards information in a secured PCI environment, then use the returned token in the charge request, you can save multiple cards for the same user using the following request

Production Environment:

URL: https://www.atfawry.com/ECommerceWeb/Fawry/cards/cardToken

SandBox Environment:

URL: https://atfawry.fawrystaging.com//ECommerceWeb/Fawry/cards/cardToken
Create Card Token Request
HTTP method: POST

{ "merchantCode":"is0N+YQzlE4=", "customerProfileId":"7uyA76gf2", "customerMobile":"010000000000", "customerEmail":"asd@asd.com", "cardNumber":"4005550000000001", "expiryYear":"21", "expiryMonth":"05", "cvv":"123" }

Element description:
merchantCode The merchant code provided during account setup
customerProfileId The unique customer profile ID in your system
customerMobile Customer mobile
customerEmail Customer email
cardNumber Card number
expiryYearexpiryMonth The two digit format for the card expiry year for example 21
expiryMonth The two digit format for the card expiry month for example 05
cvv The card CVV
The response will contains the following:
{ "type":"CardTokenResponse", "card":{ "token":"c44f3f20d92e5fb1239e515e7a3736a2a94117151896d3c314de931b5d0fc80a", "creationDate":1514744801948, "lastFourDigits":"0001", "brand":"Visa Card" }, "statusCode":200, "statusDescription":"Operation done successfully" }
Element description:
token The card token value which will be used in charge request
lastFourDigits The card last four digits
brand The card brand for example Visa Card, Master Card
statusCode The response status code
200 >> Success
9901 >> merchant code is blank or invalid
9919 >> invalid card date
9910 >> mobile number is blank
9946 >> blank or invalid signature

List Customer Tokens API

You can retrieve the customer saved tokens using the following request


Http Method : GET https://www.FawryPay.com/ECommerceWeb/Fawry/cards/cardToken?merchantCode= is0N+YQzlE4=&customerProfileId=aaaaabxbz11z&signature=95326b53cbfd075ff25035484b00ae67bccd3fc8ab4318da708bb5c93f612473
merchantCode The merchant code provided during the account setup
customerProfileId The unique customer profile ID on your system
signature The SHA-256 digested for the following concatenated string merchantCode + customerProfileId + secureKey
The response will contains list of card for this customer

{ "type": "CustomerTokensResponse", "cards":[{ "token": "175ad7e434474c6aa31f6e026b30fcfafbc8a27f754f64d237f48ee9f217317e", "creationDate": 1514747422308,"lastFourDigits": "0001","brand": "Visa Card" }], “statusCode": 200,"statusDescription": "Operation done successfully" }

Delete Token API

You can delete customer token using the following request

Production Environment:

URL: https://www.FawryPay.com/ECommerceWeb/Fawry/cards/cardToken?merchantCode=is0N+YQzlE4=& customerProfileId=9990064204&signature=5AF15BAC04068552BC341D1A539BAA24 &cardToken=897fa8e81be26df25db592e81c31cc6a2b04e6dd994

SandBox Environment:

URL: https://FawryPay.fawrystaging.com/ECommerceWeb/Fawry/cards/cardToken?merchantCode=is0N+YQzlE4=& customerProfileId=9990064204&signature=5AF15BAC04068552BC341D1A539BAA24 &cardToken=897fa8e81be26df25db592e81c31cc6a2b04e6dd994
Delete Token Request
HTTP method: Delete
merchantCode The merchant code provided during account setup
customerProfileId The unique customer profile ID in your system
signature The SHA-256 digested for the following concatenated string merchantCode + customerProfileId + cardToken + secureKey
The response will contain status code and message

{ "type": "CardTokenResponse", "statusCode": 200, "statusDescription": "Operation done successfully", }

200 Success
9901 merchant code is blank or invalid
9944 Customer profile or card token is empty
9946 blank or invalid signature