Skip to content

Last updated: February 8, 2023

Start accepting payments using Fawry, the dominant payment method in Egypt.

Tip

Shoppers can now make Fawry payments via the myFawry app (App Store and Google Play), rather than having to take their payment reference to a shop or ATM, meaning a better payment experience for both you and your customers.

Information

To start accepting Fawry payments, please contact your Customer Success Manager.

Model

Collecting

Payment flow

Redirect

Payment method type

Voucher

One-step payment

check

Authorization

error

Capture

error

Refund

check

Partial refund

check

Chargeback

check

Recurring payment

error

Request a payment

Use the details below to set up your request.


Endpoints

You can find the full list, as well as complete request and response examples, in our API reference.

post

https://api.checkout.com/payments

Request example

1
{
2
"amount": 1000,
3
"currency": "EGP",
4
"source": {
5
"type": "fawry",
6
"description": "Fawry Demo Payment",
7
"customer_mobile": "01058375055",
8
"customer_email": "john.smith@example.com",
9
"products": [
10
{
11
"product_id": "0123456789",
12
"quantity": 1,
13
"price": 1000,
14
"description": "Fawry Demo Product"
15
}
16
]
17
}
18
}

Response example

If you receive a 202 Success response containing a status field set to Pending, your request was successful.

In addition, you will receive payment_pending and payment_capture_pending webhook notifications. And, when the customer completes the Fawry payment in a timely manner at a point of sale, you will get a payment_captured webhook notification to confirm that the payment has completed.

1
{
2
"id": "pay_xksrrfuzksge5gyyqubpgbn7gy",
3
"status": "Pending",
4
"customer": {
5
"id": "cus_v65kd7q5tojehd23eftbaiktru"
6
},
7
"_links": {
8
"self": {
9
"href": "https://api.sandbox.checkout.com/payments/pay_xksrrfuzksge5gyyqubpgbn7gy"
10
}
11
}
12
}

Payment capture, expiration and cancellation

The payment will remain pending for the duration that you agreed when you onboarded your business with Fawry, or until the date and time you set for expires_on. If the customer fails to complete the transaction at a point of sale by then, the payment will expire and you will receive a payment_expired webhook notification. If, for any reason, the payment gets canceled before being captured or expiring, you will receive the payment_canceled webhook notification instead. Make sure that your products and/or services are not shipped and/or provided before receiving confirmation of the capture.

Get details about a payment

You can retrieve details about an existing Fawry payment with the following endpoint.


Endpoints

get

https://api.checkout.com/payments/{id}

Response example

1
{
2
"id": "pay_xksrrfuzksge5gyyqubpgbn7gy",
3
"requested_on": "2019-05-27T14:10:32Z",
4
"source": {
5
"type": "fawry",
6
"description": "Fawry Demo Payment",
7
"reference_number": "1019734277"
8
},
9
"amount": 1000,
10
"currency": "EGP",
11
"payment_type": "Regular",
12
"status": "Pending",
13
"risk": {
14
"flagged": false
15
},
16
"customer": {
17
"id": "cus_v65kd7q5tojehd23eftbaiktru"
18
},
19
"_links": {
20
"self": {
21
"href": "https://api.sandbox.checkout.com/payments/pay_xksrrfuzksge5gyyqubpgbn7gy"
22
}
23
}
24
}

Refund a payment

Fawry supports both partial (see note below for details) and full refunds. You can refund a payment through the Dashboard or by using the refund API.

Note

Multiple partial refund actions may be taken on a Fawry payment if there is some amount left. In addition, Fawry refunds are always rounded down to the nearest whole number. For example, attempting to refund a payment amount of 10999 (EGP 109.99) will only refund 10900 (EGP 109.00).

Webhooks

When using Fawry, you may receive the following webhooks.

WebhookDescription

payment_pending

Sent when a payment request has successfully initiated.

payment_expired

Sent when the payment has expired. (Fawry payments expire after two hours.)

payment_declined

Sent when a payment request has been rejected.

payment_capture_pending

Sent when the customer has approved the payment by paying it with a voucher or by cash.

payment_captured

Sent when the payment has been successfully captured.

payment_canceled

Sent when the customer has aborted the payment or the payment has failed.

payment_refund_accepted

Sent when the refund of the payment has been (fully or partially) accepted for refund.

payment_refunded

Sent when the payment has been (fully or partially) refunded.

payment_refund_declined

Sent when a refund has been declined.

Testing Fawry

Information

To start testing, you'll need to contact your Customer Success Manager or Integrations engineer to activate Fawry payments.

Note

The following endpoints are for testing purposes only. They will not work in the live environment.

You can use the two following endpoints to test capturing and canceling a payment in our sandbox environment.


Get payment details

First, you will need to get the details of payment (as above) and make a note of the reference_number in the response.

Capture a payment

Use the reference_number from the above response to test capturing a payment.

Endpoint

put

https://api.sandbox.checkout.com/apms/fawry/payments/{reference_number}/approval

Header and path parameters

HeaderValue

Authorization

required

secret key

Content-Type

required

application/json

PathValue

reference_number

required

The reference number you received in the response to the 'get payment details' request.

If successful, you will receive a payment_captured webhook notification.

Cancel a payment

Use the reference_number from the response to your get payment details request to test canceling a payment.

Endpoint

put

https://api.sandbox.checkout.com/apms/fawry/payments/{reference_number}/cancellation

Header and path parameters

HeaderValue

Authorization

required

secret key

Content-Type

required

application/json

PathValue

reference_number

required

The reference number you received in the response to the 'get payment details' request.

If successful, you will receive a payment_canceled webhook notification.

Fawry on mobile

You can offer the myFawry app for making payments. The app applies the same rules for both cash and credit card orders as kiosk and myFawry do not differ.

Refunds are made following the same steps as for cash orders:

  1. When Fawry receives a refund request it sends a notification informing you that the proper action has been taken.
  2. The customer receives an SMS with the reference code containing the OTP. The SMS is sent to the mobile number used in placing the order.
  3. If the customer has payed with a credit card, the refund amount is sent to their credit card.
  4. If the customer has payed with cash and request refund using the myFawry app, they receive a reference number they should use at a kiosk to obtain the refund.