Integrate Pay by Link: authenticate from your server, create a hosted payment link, and verify the payment status before fulfilling the customer’s order.
The Al-Saqi Payment Gateway RESTful API uses JSON requests and responses. This guide covers Pay by Link: your application directs the customer to the Al-Saqi hosted page to enter card details, while your server creates the link and verifies the result. Keep credentials and access tokens on your server, and do not use the browser redirect alone as proof of payment.
Sandbox Base URLUse https://pg-t2.alsaqi.net for development and testing, and send all requests over HTTPS. Review API Environments before moving to production.
Create Token ──▶ Generate Payment Link ──▶ Cardholder pays (hosted page) ──▶ Check Payment Status
(auth) (returns paymentLink) (success / fail URL) (final result)
Always confirm server-sideNever rely on the browser redirect alone. Treat an order as paid only after Check Payment Status returns linkStatus = 2 (Approved).
Development and testing run on the sandbox. When moving to production, only the base URL and credentials change; endpoint paths and request formats are the same in both environments.
Environment
Base URL
Use for
Sandbox
https://pg-t2.alsaqi.net
Development & testing with test cards.
Production
Provided after onboarding
Live transactions with real cards.
Test card
Card number
4032080000002567
Expiry
12/25
CVV
200
Currency
IQD
Test credentials and the test card work only in the sandbox. To get API credentials, contact Al-Saqi support: support@alsaqi.net or +964 781 054 7229.
Token-protected endpoints require a Bearer access token obtained from the Create Access Token endpoint. Send it in the Authorization header on every protected request:
The Pay By Link model generates a secure hosted payment link. The cardholder enters their card data on the Al-Saqi hosted page, keeping you out of PCI scope.
Generates a hosted payment link for the client. Requires a Bearer token; the {client_id} must match the clientId embedded in the token.
URL Parameters
Field
Required
Type
Description
client_id
Required
number
Client ID returned by the Create Access Token API.
Request Body
Field
Required
Type
Description
RequestId
Required
string
Unique request identifier.
InvoiceId
Optional
string
Reusable across attempts, unless the transaction reached Approved or Unknown — then reuse is prohibited.
amount
Required
decimal
Amount to be paid.
Currency
Required
string
Currency code (e.g., IQD).
successUrl
Required
string
The customer is sent to this URL after a successful payment, exactly as given, with no parameters added. The merchant can add its own order number to the URL.
failUrl
Required
string
The customer is sent to this URL after a failed payment, exactly as given, with no parameters added.
Download the collection with the button at the end of this section and import it into Postman. Enter userName and password in the Variables tab; copy the other values from the responses as shown in the table below.
Collection variables
Variable
Value
baseUrl
https://pg-t2.alsaqi.net
userName
Enter manually: your username
password
Enter manually: your password
accessToken
Copy access_token from the Generate Access Token response
clientId
Copy clientId from the Generate Access Token response
paymentId
Copy paymentId from the Generate Link response
requestId
Copy requestId from the Generate Link response (for Check Payment Status By RequestId)
Authentication is already set up in the collection; just put the access token in the accessToken variable. A new RequestId is created automatically with every Generate Link request.