Your server asks us for a payment. You open the checkout link we return in a WebView or browser. Your customer pays by bank card, ZainCash or installments. You learn the result from a signed webhook and can ask for it at any time.
You integrateOne signed REST API, one WebView, one webhook
MethodsBank card · ZainCash · Installments
CurrencyIraqi dinar (IQD), whole numbers
You receiveThe full amount you send us
Principles
You never handle card or wallet details. Card numbers, wallet PINs and OTP codes are entered on Ibtiaath's page or the provider's page. Your systems only see status, method and amounts.
Your amount is final. Apply your own discounts before sending the amount. You may send a record of them; we keep it but never deduct it.
Fees are added on top. The customer pays your amount, a service fee and the chosen method's fee. See Fees.
Every payment is a permanent record. Each attempt, result and notification is a row in the payment's ledger, which can only be added to. See The payment ledger.
The technical details we need to set up your merchant, once for staging and once for production.
You can change these yourself in the merchant portal (partners.ibtiaath.com): return URL prefixes, webhook URL, smallest and largest payment, link lifetime and server IPs are under Settings; API keys and the webhook secret under Developers. The portal also lists every payment link and what your customer did with it.
Item
Details
Webhook URL
HTTPS on a public address, answering within 10 seconds. One URL per environment.
REQUIRED
Return URL prefixes
Where the checkout sends the customer when done. Every return_url must start with one, e.g. https://app.example.com/pay/ or yourapp://pay/.
REQUIRED
Display name
Shown to your customers at the top of the checkout.
REQUIRED
Technical contact
Receives the keys and is contacted about incidents.
REQUIRED
Server IP addresses
Only these addresses may use your key. Empty allows any address; the signature still protects every call.
optional
Payment limits
Smallest and largest single payment.
optional
Checkout link lifetime
How long a link stays payable. Default 30 minutes.
optional
Checkout language
Arabic (default) or English; can also be set per payment.
optional
Getting started
What we send you
Your credentials, one set per environment.
Item
Used for
Keep it
Key ID · ibk_…
Identifies your key on every request (X-Ibt-Key).
Server config
API secret
Signs your requests. Shown once; we can only issue a new one.
Never put a secret in a mobile app or a web page. Anyone can extract it. Your app talks to your server; only your server talks to our API.
Key rotation
Keys rotate without downtime: we issue a second key, you switch to it, then we revoke the first. If a secret may have leaked, tell us at once and we revoke it.
Getting started
Environments
Staging for building and testing, production for your customers. Keys do not work across them.
Staging
Production
API base
https://api.staging.ibtiaath.com/api/v1/merchant
https://api.ibtiaath.com/api/v1/merchant
Checkout host
https://pay.staging.ibtiaath.com
https://pay.ibtiaath.com
ZainCash
Sandbox: test wallets only, no money moves
Live
Bank card
Live: real money
Live
Installments
Live: real money
Live
Only ZainCash is a sandbox on staging. Bank card and installment payments on staging are real and take real money. Test with ZainCash, or use the smallest amounts on the other methods.
Integration
How a payment runs
Your server talks to us twice and hears from us once. Your customer only ever sees the checkout and the provider's page.
Only step 7, our own check with the provider, marks a payment paid. The return to your app in step 9 is a hint for your screen, never proof of payment.
Integration
Signing requests
Every request carries three headers. There is no password or bearer token on the wire.
HEADERS
X-Ibt-Key: <key id>
X-Ibt-Timestamp: <unix time in seconds>
X-Ibt-Signature: <hex HMAC-SHA256 of string_to_sign, keyed with your API secret>
string_to_sign = timestamp + "." + METHOD + "." + path_with_query + "." + sha256_hex(raw_body)
Rules
METHOD in upper case. path_with_query exactly as sent, from /api/v1/merchant/…, including the query string.
raw_body is the exact bytes you send. With no body it is the empty string (SHA-256 e3b0c442…b855).
The timestamp must be within 5 minutes of real time. Keep your server clock synced.
Each signature is accepted once. To retry a request, sign it again.
The same order_id again, while its payment is pending or paid, returns that payment (200) with the same checkout_url while it can still be used. Safe to retry after a timeout.
The same order_id with a different amount is refused: 409 order_id_conflict.
After a payment expires or is cancelled, the same order_id creates a new payment.
Payments API
Retrieve a payment
The source of truth for a payment's status, with every attempt the customer made.
Each webhook try, with the status your server answered.
note.added
Ibtiaath staff add an explanation.
Each row carries the hash of the row before it. A row you read once always comes back with the same hash; store the hashes if you want to check that for yourself. Card numbers, PINs, OTP codes and Qi account numbers are never in the ledger.
Integration
Open the checkout
Open checkout_url exactly as received, in a WebView or the browser.
The part after # is a one-payment secret. It never reaches a server log, and the page removes it from the address bar as soon as it loads.
WebView requirements
JavaScript and cookies on.
Allow navigation to other hosts: the bank's 3-D Secure page and ZainCash's page open from the checkout and return to it.
Watch for navigation to your return_url, then close the WebView. It arrives as return_url?payment_id=PAY-…&order_id=…&status=…
The link stays payable until the payment is paid, cancelled or expired (30 minutes by default).
The status on the return URL is for your screen only. Before you deliver anything, confirm with the webhook or GET /payments/{id}.
The checkout follows Ibtiaath's app design, in Arabic or English. It shows your display name, the product, your amount, one fee line and the total for the chosen method.
Integration
Payment methods
Which methods appear is set per merchant by Ibtiaath and returned in methods.
Bank cardVisa / Mastercard through Areeba, with 3-D Secure.
ZainCashWallet number, PIN and OTP on ZainCash's page.
InstallmentsQi Card (Aqsati): account number, plan, OTP. From 10,000 IQD.
A method outside its own limits for the amount is left out of methods.
One payment can be in progress at a time: once a method has taken the money, the others are refused.
A failed attempt leaves the payment pending; the customer may try again with any method.
Integration
Webhooks
We POST to your webhook URL whenever a payment's status changes.
Retry with a new signature; order_id makes it safe.
Money
Fees
You receive your amount in full. The customer pays it plus two fees, both shown before they pay.
CALCULATION
service_fee = your service fee rate on amount (percent and/or fixed, optional minimum), rounded up
subtotal = amount + service_fee
method fee = the chosen method's fee on subtotal
total paid = subtotal + method fee
Example
Card
ZainCash
Installments
Your amount
250,000
250,000
250,000
Service fee (example 2%)
5,000
5,000
5,000
Method fee (example)
0
1,530
12,750
Customer pays
255,000
256,530
267,750
You receive
250,000
250,000
250,000
Rates here are illustrative. The fees for your merchant are returned in service_fee and methods on every payment. The service fee is fixed when the payment is created, so a later change of rates never reprices an open payment. For installments, the monthly figure shown to the customer includes the provider's own financing charge.
Launch
Testing
Build and test on staging. On staging, ZainCash runs on its sandbox; bank card and installments are live.
Bank card and installments on staging take real money. Use ZainCash for your tests, or the smallest amounts on the other methods.
ZainCash test wallets
On staging, choose ZainCash on the checkout and pay with any of these wallets. No money moves.
Wallet number
PIN
OTP
9647802999569
1111
111111
9647829744432
1111
111111
9647829744464
1111
111111
9647829744474
1111
111111
Cases to cover
Pay successfully; deliver only after the webhook or a status check.
Fail once (wrong OTP or cancel on ZainCash's page), then succeed on the same payment.
Let a link expire; create a new payment for the same order_id.
Cancel an unpaid payment.
Send the same create twice (same answer) and with a different amount (409).
Make your webhook return 500 once and check that the retry is handled once.
Reject a webhook with a wrong signature.
Close the WebView mid-payment, then read the payment from your server.
Launch
Go-live checklist
Every line must hold before we issue your production key.
Secrets are on your server only, never in an app or a page.
Every request is signed fresh; your server clock is synced.
order_id is unique per order and reused on retries.
Orders are delivered from the webhook or GET /payments/{id}, never from the return URL.
The webhook verifies signature and timestamp, answers within 10 seconds, and ignores repeated event ids.
The WebView allows JavaScript, cookies and navigation to other hosts, and closes on your return_url.
expired and cancelled are handled in your app and back office.
Production webhook URL and return URL prefixes are sent to us.
A first real payment on each method is checked on both sides.
Launch
Security
Card details are entered on the bank's page and wallet PINs on ZainCash's page. They never reach Ibtiaath or you.
All traffic is HTTPS. The checkout cannot be framed, sends no referrer, loads nothing from other sites and reaches only its own endpoints.
Your API and webhook secrets are encrypted at rest on our side and shown to you once.
Payment records cannot be edited or deleted; every change is a new ledger row, checked nightly.
If a secret may have leaked, tell us at once: we revoke it and issue a new one.
Launch
Support
Your Ibtiaath technical contact is your first contact for keys and incidents.
For a problem with a payment, always include the payment id (PAY-…), your order_id and the time. Never send a secret.