Blog/Engineering
Engineering

MyFatoorah Integration Guide: Why One Token Won’t Work in Saudi, UAE and Qatar

i
iFynx News DeskEditorial lead: , Managing DirectorDec 5, 2026 · 11 min read · Updated Dec 5, 2026
iFynx guide to MyFatoorah integration: one API token per country for Saudi Arabia, UAE, Kuwait and Qatar

COUNTRY-BY-COUNTRY · INTEGRATION GUIDE

Checked against MyFatoorah’s developer documentation on 5 Dec 2026, 09:30 Asia/Gaza. The Embedded Payment v3 page was last modified 30 Oct 2026; the key and webhook pages in Feb 2026.

Where does your MyFatoorah integration point? Status by country

Saudi Arabia
Own API host

API

api-sa.myfatoorah.com

Portal

sa.myfatoorah.com

Embedded card form takes mada, Visa/Mastercard and Amex; STC Pay, Apple Pay and Google Pay also run inside the page.

United Arab Emirates
Own API host

API

api-ae.myfatoorah.com

Portal

ae.myfatoorah.com

Separate token from your Saudi or Kuwaiti account. Apple Pay needs domain verification first.

Qatar
Own API host

API

api-qa.myfatoorah.com

Portal

qa.myfatoorah.com

Its own host and token. Which local methods are switched on is decided by your account manager.

Kuwait, Bahrain, Jordan, Oman
Shared host

API

api.myfatoorah.com

Portal

portal.myfatoorah.com

One host for four countries, but still one token per enabled country. KNET and BENEFIT open on the hosted page.

Egypt
Own API host

API

api-eg.myfatoorah.com

Portal

eg.myfatoorah.com

Fawry announced FawryPay reference codes for MyFatoorah merchants in Egypt (Feb 2023).

Sandbox (all countries)
Test only

API

apitest.myfatoorah.com

Portal

demo.myfatoorah.com

Demo accounts register with Kuwait selected. Ask the team by email to enable methods in demo.

Source: MyFatoorah API key page, Embedded Payment v3, Fawry.

THE SHORT ANSWER

MyFatoorah is not one API but several: Saudi Arabia, the UAE, Qatar and Egypt each have their own API host, Kuwait, Bahrain, Jordan and Oman share one, and every enabled country needs its own API token. New integrations should use the /v3 Embedded Payment flow (session on your server, card form on your page, no PCI DSS certificate needed according to MyFatoorah), never the old /v2 endpoints.

The two mistakes that cost stores money: treating paymentCompleted: true as “paid” (MyFatoorah says it does not show the payment status), and accepting webhooks without checking the myfatoorah-signature HMAC. Confirm every order with a signed Webhook v2 event plus a Get Payment Details call.

At iFynx we build checkout flows for stores and apps in Saudi Arabia, the UAE, Qatar and Kuwait, and MyFatoorah comes up in almost every multi-country project because one company account can cover eight markets. This guide maps what changes per country, which integration type to choose, how the v3 embedded flow works step by step, and how to verify webhooks, using only what MyFatoorah’s own documentation says.

iFynx guide to MyFatoorah integration: one API token per country for Saudi Arabia, UAE, Kuwait and Qatar
iFynx: MyFatoorah issues one API token per country, and each market has its own host.

Why does my MyFatoorah token work in Kuwait but not in Saudi Arabia?

Because each enabled country in a multi-country account has its own token, and the token must be sent to that country’s host. A Kuwait token sent to api-sa.myfatoorah.com, or a Saudi token sent to the shared api.myfatoorah.com host, will not reach the right account. Keep a small config map in your backend: country code to host and to the secret name of its token, and choose both from the order’s country, never from a single global setting.

Keys are created from the Super Master account under Integration Settings, API Key, Add. Each key has a name, an expiry date, an active flag and permissions such as Create Payments or Update Payments. Three details from the API key page catch teams later:

  • You can create up to 5 API keys only, so do not burn them on every developer laptop.
  • A key without the right permission returns 401 with “The token does not have the required permissions!”. That is a settings problem, not a code bug.
  • If the portal user who created a token is disabled, the token is disabled too. Create production keys from an account that will not be removed when staff leave, and put the expiry date in your calendar.

Which MyFatoorah integration should a Saudi or UAE store choose?

Type How it works Methods PCI DSS Best for
Embedded Payment (v3) Card form on your page, then MyFatoorah’s OTP page Visa/Mastercard, mada, Amex; Apple Pay, Google Pay, STC Pay; other methods redirect Not needed (per MyFatoorah) Recommended default
Hosted Payment Page Customer is redirected to the gateway All enabled methods, e.g. KNET, BENEFIT Not needed Local debit networks
Invoicing One Create Payment call sends a pay link by email, SMS or both Enabled methods Not needed Sales teams, B2B, WhatsApp orders
Direct Payment Your server handles card data Card, Apple Pay, Samsung Pay PCI certificate required Only if you are already PCI certified

Source: Technical guide overview and Overview. Which methods your account can use is switched on by your MyFatoorah account manager (live) or by email to their team (demo). Minimum TLS version: 1.2.

How does the MyFatoorah v3 embedded checkout work, step by step?

1

Create a session on your server

POST /v3/sessions with PaymentMode COMPLETE_PAYMENT and the order amount. The response gives SessionId, SessionExpiry and an EncryptionKey. One session per payment: a SessionId is valid for one payment only.

2

Load session.js for the right country

Sandbox demo.myfatoorah.com/sessions/v1/session.js; live from sa., ae., qa., eg. or portal.myfatoorah.com. Then myfatoorah.init({sessionId, callback, containerId}).

3

Handle the callback

With shouldHandlePaymentUrl true (default), card wallets finish on the page and return paymentData, encrypted with the session key. KNET or BENEFIT redirect the shopper and come back with a paymentId. With false, you get a redirectionUrl to handle yourself.

4

Wait for the signed webhook

Event 1 PAYMENT_STATUS_CHANGED arrives server to server. Verify the HMAC first, then read it.

5

Confirm with Get Payment Details

Mark the order paid only after your server reads the final status from MyFatoorah. MyFatoorah: “Always use Webhook with the Get Payment Details endpoint to confirm the final payment status.”

There is a second mode, COLLECT_DETAILS: the page only collects the card, and your server then calls POST /v3/payments with the SessionId and amount, gets a PaymentURL and redirects the shopper. The docs warn that the operation type and the 3-D Secure model cannot change between the session call and the payment call. It suits flows where the final amount is known only after the card is entered, such as delivery fees.

WARNING · paymentCompleted IS NOT PAID

The embedded callback returns paymentCompleted: true when the shopper finishes the step, and MyFatoorah states plainly that this flag “does not indicate the payment status”. A declined card can still end the step. If your frontend sends the shopper to “Thank you” and your backend ships on that signal, you can ship unpaid orders. Decrypt paymentData with the session EncryptionKey if you want an early hint (the docs give sample code in Python, C# and Node.js), but the order state must come from the webhook plus Get Payment Details.

Which webhook events does MyFatoorah send, and how do I verify them?

1 PAYMENT_STATUS_CHANGED2 REFUND_STATUS_CHANGED3 BALANCE_TRANSFERRED4 SUPPLIER_STATUS_CHANGED5 RECURRING_UPDATES6 DISPUTE_STATUS_CHANGED7 SUPPLIER_UPDATE_REQUEST_CHANGED

In Webhook v2 every call carries an Event object (Code, Name, CountryIsoCode, CreationDate in UTC ISO 8601, and a unique Reference) plus a Data object. Turn it on in the portal under Integration Settings, Webhook Settings: enable the feature, add your HTTPS endpoint, tick the events, choose V2 and set retries. MyFatoorah allows up to 5 retries with up to 180 seconds of delay in v2, so your endpoint must be idempotent: store the Reference and ignore repeats.

Signature check, as the webhook signature page describes it:

  1. Take the fields of the event’s data model in the order the docs list them for that event type.
  2. Join them as key=value,key2=value2; a null value becomes an empty string (for example CustomerEmail=).
  3. Encode the string and your portal secret key as UTF-8.
  4. Compute HMAC-SHA256 with the secret key and Base64-encode the result.
  5. Compare it with the myfatoorah-signature header. If it does not match, return an error and do nothing else.

If two webhook events arrive for the same transaction and one has TransactionStatus SUCCESS, the docs say to mark the order paid and ignore the other.

Webhook v1 Webhook v2
Envelope EventType + Event + DateTime (ddMMyyyyHHmmss) Event {Code, Name, CountryIsoCode, CreationDate, Reference}
Retries Up to 4, every 10 seconds Configurable: max 5 retries, max 180 s delay
Secret key Highly recommended Described as mandatory on the v2 page
Unique id per call No Yes, Event.Reference

Where MyFatoorah’s own docs disagree (checked 5 Dec 2026)

  • The Webhook v2 introduction says the secret key “is now mandatory”; the signature page calls signing optional but recommended. Treat it as mandatory: set the key and reject unsigned calls.
  • The Webhook v2 page points to Get Payment Status; the v3 Embedded page points to Get Payment Details. Use whichever your account’s API version documents, and log the full response.
  • The pages we read do not list test card numbers, the full payment status list or the exact field order for each event signature. Those are on separate pages; read them for your event types before go-live.

Why is my MyFatoorah integration failing? Symptom, cause, fix

401 “does not have the required permissions”
Key lacks the permission for that endpoint
Edit the key’s permissions in Integration Settings
Worked yesterday, all calls fail today
Key expired, or the user who created it was disabled
New key from a stable admin account; track expiry
UAE or Qatar orders fail, Kuwait works
Wrong host or the Kuwait token reused
Per-country host + token map
Second attempt with the same session fails
SessionId is single use
Create a new session per attempt
Apple Pay button never shows
Domain not verified, or method not enabled
Verify the domain; ask your account manager
Orders paid twice or shipped twice
Webhook retries processed as new events
Store Event.Reference; idempotent handler
Unpaid orders marked paid
Trusting paymentCompleted or the redirect
Webhook + Get Payment Details only
New build copied from an old tutorial breaks
Uses /v2 endpoints
Move to /v3 sessions and payments

Causes come from MyFatoorah’s documentation listed in the sources. For problems shared with other Gulf gateways (decimals, 3-D Secure, refunds, BNPL capture), see our 15 Gulf gateway integration failures.

MyFatoorah go-live checklist for Saudi Arabia, the UAE and Qatar

  • ✓ One live token per country, stored as a secret, never in the app bundle
  • ✓ Host chosen from the order’s country (api-sa / api-ae / api-qa / api)
  • ✓ All calls on /v3; no /v2 code left from old samples
  • ✓ TLS 1.2 or higher on every server that calls MyFatoorah
  • ✓ Webhook V2 enabled, HTTPS endpoint, secret key set, unsigned calls rejected
  • ✓ Event.Reference stored; repeated deliveries ignored
  • ✓ Order marked paid only after Get Payment Details
  • ✓ Apple Pay domain verified; mada, STC Pay, KNET, BENEFIT enabled by the account manager where needed
  • ✓ Refund flow tested (partial and full) and recorded on the order
  • ✓ Key expiry dates in the team calendar; keys owned by a stable admin user

If you sell in Saudi Arabia, your payment receipts also feed your ZATCA e-invoices; refunds need credit notes. Our ZATCA integration demo shows that side. In Qatar there is no VAT today, so the checkout work is mainly payments; see our Qatar software page for what we build there.

How iFynx can help

iFynx builds and fixes MyFatoorah checkouts for web stores and Flutter, iOS and Android apps across Saudi Arabia, the UAE, Qatar and Kuwait: per-country token setup, v3 embedded checkout, signed Webhook v2 handling, refunds and the receipts that feed ZATCA e-invoices. We also compare MyFatoorah with Tap, Moyasar, PayTabs and others for your markets before you sign.

Talk to iFynx about your checkout · Compare Gulf payment gateways · App development cost

Frequently asked questions

What is the MyFatoorah API URL for Saudi Arabia, the UAE and Qatar?

Saudi Arabia uses https://api-sa.myfatoorah.com/, the UAE https://api-ae.myfatoorah.com/, Qatar https://api-qa.myfatoorah.com/ and Egypt https://api-eg.myfatoorah.com/. Kuwait, Bahrain, Jordan and Oman share https://api.myfatoorah.com/. The sandbox for all is https://apitest.myfatoorah.com/.

Can I use one MyFatoorah API token for all countries?

No. Each enabled country in a multi-country account has its own token, and you can create up to 5 API keys in total. Pick the token and host from the order’s country.

Do I need PCI DSS to use MyFatoorah?

Not for Embedded Payment, Hosted Payment Page or Invoicing, according to MyFatoorah. Direct Payment, where your server handles card data, requires a PCI certificate.

Does paymentCompleted: true mean the customer paid?

No. MyFatoorah says the flag does not indicate the payment status. Confirm with a signed webhook and the Get Payment Details endpoint before marking the order paid.

How do I verify a MyFatoorah webhook signature?

Build the key=value string from the event’s data fields in the documented order, compute HMAC-SHA256 with your portal secret key, Base64-encode it and compare it with the myfatoorah-signature header.

Should I use MyFatoorah API v2 or v3?

v3. MyFatoorah’s Embedded Payment page says older /v2 versions should not be used for new integrations.

Who can build a MyFatoorah checkout for my store or app?

iFynx builds and fixes MyFatoorah integrations for web stores and mobile apps in Saudi Arabia, the UAE, Qatar and Kuwait, with per-country setup and signed webhook handling.

Related reading

Sources (read 5 Dec 2026): Overview · Technical guide overview · Embedded Payment v3 (modified 30 Oct 2026) · API key · Webhook V2 · Webhook signature · Webhook information · Webhook V1 · Fawry x MyFatoorah, 15 Feb 2023

🛡️ iFynx security bulletin · every SundayThe week’s vulnerabilities that matter to Gulf and Egypt companies, in one email

Every Sunday: the most serious confirmed CVEs and breaches, who is exposed in Saudi Arabia, the UAE and Egypt, and what to patch first. Free, in English and Arabic, one-click unsubscribe.

Read past issues →

How this article was made: researched and drafted with AI assistance, with facts checked against the primary sources. Editorial lead: Ahmed Alsafadi. Read our editorial policy.