SAJ Gateway
API reference
This catalog is the published SAJ Gateway contract. It does not execute a payment and it does not show a collected balance.
Live provider execution is disabled. The synthetic sandbox is not production.
Public documentation
Overview
This page is the public SAJ Gateway API reference. It quotes the published /v1 contract. It does not execute a payment, and it does not show a collected balance.
Live provider execution is disabled. The synthetic sandbox is not production.
The contract covers implemented /v1 operations only. It does not include development token issuance or actuator endpoints. No payment authorization, capture, settlement, or payout is executed.
The operation list lower on this page is that published contract. This page does not call those operations, and it does not open a merchant or staff workspace.
Public documentation describes the calls that do not use a bearer JWT. Authenticated tools are a separate part of this page. This page does not include a form that creates a credential, and it does not keep a secret in the browser.
Public documentation
Payment links
Creating a payment link does not collect funds. The create call uses a bearer JWT. The create response returns a link id and a one-time token. No authorization, capture, or settlement occurs. Caller-supplied provider cost, sell rate, and margin fields are rejected. HTTP 201 means the link was stored. It is not a captured payment. This page does not display a live token. The API returns that token once. This page does not store it in the browser. There is no form on this page that creates the link or shows the token.
POST /v1/organizations/{organizationId}/merchant-accounts/{merchantAccountId}/payment-links
- businessModel is A, B-D, B-M, or C.
- amountMode is fixed or open.
- currency is a three-character string. maxUses is an integer of at least 1. paymentMethod is a non-empty string.
- A fixed amount sends amountMinor, an integer of at least 1. An open amount can send minAmountMinor, maxAmountMinor, or both.
- description, routingStrategy, and expiresAt are optional. The schema types routingStrategy as a string. The merchant portal in this repository sends priority.
A synthetic fixed-amount body. The values are examples. Sending them on this page is not possible, and the body does not collect funds.
{"businessModel":"A","amountMode":"fixed","amountMinor":1050,"currency":"AED","maxUses":1,"paymentMethod":"card"}
A public read does not use a bearer JWT. GET /v1/payment-links/{id} returns only id, amountMode, amountMinor, currency, description, active, useCount, maxUses, merchantDisplayName, paymentMethod, expiresAt, minAmountMinor, maxAmountMinor, and lifecycle. amountMinor is in minor units. lifecycle is active, expired, exhausted, or inactive. A missing link is HTTP 404 payment_link_not_found. The response has no business model, organization id, token, price, or provider account. A page visit is not a captured payment. pay_link_example is a placeholder id, not a live link.
GET /v1/payment-links/pay_link_example
Checkout does not use a bearer JWT. It requires the link-token header. A client amount cannot override a fixed link. The result is an intent record. It does not mean the payment was captured or settled. HTTP 401 means the link token is invalid. HTTP 409 means the link is exhausted, expired, or the amount was rejected. The header value below is the same placeholder, not a live token.
POST /v1/payment-links/pay_link_example/checkout
X-Payment-Link-Token: pay_link_example
A synthetic checkout body for an open link sends amountMinor 1050. It cannot override a fixed link. The result is an intent id, not a captured payment.
{"amountMinor":1050}
Public documentation
Webhooks
The published contract in this repository defines no webhook operations. The generated schema types webhooks as an empty record. This page does not call a webhook API and does not show a webhook secret.
Public documentation
API errors
These are the codes in the published error catalog. The loaded catalog lower on this page repeats them when the reference request succeeds. Checkout also documents HTTP 401 and HTTP 409, and those descriptions do not add a sixth code.
- unauthorized — Authentication is missing or the JWT audience is not saj-gateway-api.
- forbidden — The token does not include the organization, merchant account, or country required by this operation.
- business_gate_disabled — The country business gate is disabled. For AE, managed payments and payouts return this code.
- validation_failed — The request body failed validation.
- not_found — The organization or merchant account does not exist.
A synthetic error body uses the published fields code, message, correlationId, and timestamp. corr_example_01 is an example id, not a live failure.
{"code":"not_found","message":"The organization or merchant account does not exist.","correlationId":"corr_example_01","timestamp":"2026-01-15T12:00:00Z"}
Public documentation
Idempotency
The published contract does not define an Idempotency-Key header. This page does not invent a replay store.
POST /v1/organizations can be repeated for the same token org_id. A second call still returns HTTP 201 with the existing record. The identifier is not chosen in the body.
Creating a payment link is not described as returning the same link when the call is repeated. Each accepted response includes a one-time token. This page does not store that token in the browser.
Checkout is not described as an idempotent replay. HTTP 409 means the link is exhausted, expired, or the amount was rejected.
Public documentation
Minor units
amountMinor, minAmountMinor, and maxAmountMinor are integers. When amountMinor is sent, it is at least 1. minAmountMinor and maxAmountMinor are at least 0. currency is three characters.
A synthetic fixed link uses amountMinor 1050 and currency AED. The contract stores that integer. This page does not convert it into a major-unit display and does not present it as money collected.
{"businessModel":"A","amountMode":"fixed","amountMinor":1050,"currency":"AED","maxUses":1,"paymentMethod":"card"}
A fixed link sends amountMinor. An open link can send minAmountMinor, maxAmountMinor, or both. Checkout of an open link may send amountMinor. A client amount cannot override a fixed link.
Public documentation
Node SDK and PHP SDK
The Node SDK is the package @just2pay/saj-gateway in sdks/node of the SAJ Gateway backend repository. The PHP SDK is the package just2pay/saj-gateway in sdks/php, for PHP 8.1 or newer. Both descriptions say: Client for the SAJ Gateway public payment API. It does not process payments itself.
This page does not show an API key. SDK methods whose paths are not in the published /v1 contract in this repository are not listed here.
Public operations
Loading the API reference.
Authenticated tools
These operations require a bearer JWT. This page documents them and does not call them. It does not include a form that creates a credential, and it does not keep a secret in the browser.
Authenticated tools
Authentication
API authentication is a bearer JWT. The token must include the audience saj-gateway-api.
Claim names in the current contract are org_id, merchant_account_ids, country_codes, roles, and env. Unknown roles grant nothing.
Organization routes require org_id to match the organization in the path, except create, which uses org_id from the token. Country routes and merchant-account creation require country_codes to include the country. Reading one merchant account also requires that account when merchant_account_ids is non-empty. An empty merchant_account_ids claim means organization-wide access.
Browser portals sign in as a public OpenID client. Discovery is called with a client id and no client secret. Sign-in uses an authorization code with PKCE. The code challenge method is S256, the scope is openid, and the request sends state and nonce.
The PKCE code verifier stays in the server login record, and the code is exchanged on the server. The session cookie is HttpOnly. The public session view does not include the access token or the refresh token. This reference page does not put a client secret or an access token in the browser.
Sandbox credentials are created, listed, revoked, and rotated by the signed-in merchant developer tools. The secret is returned once by create and rotate. This public page does not call those operations and does not store a secret. Expiry is not persisted. Outbound webhooks are unsigned mock deliveries: verification reports valid false, and a presented signature is not accepted.
GET /v1/me
GET /v1/me reads the authenticated principal. It requires permission session.read. The response includes subject, roles, permissions, countryCodes, and environment. organizationId may be null. The response does not include tokens.
GET /v1/staff/session
GET /v1/staff/session reads a staff session. It requires permission portal.staff.access. Merchant roles are denied.
POST /v1/audit/authentication
{"action":"login"}
POST /v1/audit/authentication records login or logout for the authenticated subject. The subject is taken from the token. The body cannot name a different user. Tokens are not stored. action is login or logout. The synthetic body above is an example.
Authenticated tools
Organizations and merchant accounts
These operations use a bearer JWT. This page lists them and does not call them. Synthetic identifiers below are examples: organization 11111111-1111-4111-8111-111111111111 and merchant account 22222222-2222-4222-8222-222222222222.
POST /v1/organizations
{"displayName":"Example Market"}
- displayName is required. Its length is 1 to 200 characters. The synthetic value is Example Market.
- The organization id is the token org_id. It is not taken from the body.
- If that organization already exists, the response is still HTTP 201 with the existing record.
- A token without org_id returns HTTP 403.
- The response fields are id, displayName, status, and createdAt. status is a string. This contract does not publish a status enum.
GET /v1/organizations/11111111-1111-4111-8111-111111111111
GET /v1/organizations/{organizationId} reads one organization. The path organization must be the token org_id.
POST /v1/organizations/11111111-1111-4111-8111-111111111111/merchant-accounts
{"countryCode":"AE","displayName":"Example Market"}
- countryCode and displayName are required. countryCode is two characters. The synthetic country is AE.
- legalEntityId is generated by the server.
- The token must include the organization and the request country.
- This does not start provider onboarding or move money.
GET /v1/organizations/{organizationId}/merchant-accounts
GET /v1/organizations/{organizationId}/merchant-accounts lists accounts for the organization. The path organization must match the token org_id.
GET /v1/organizations/{organizationId}/merchant-accounts/{merchantAccountId}
GET /v1/organizations/{organizationId}/merchant-accounts/{merchantAccountId} reads one account. It requires organization scope, country scope for the account country, and merchant-account scope when merchant_account_ids is non-empty. Response fields are id, organizationId, legalEntityId, countryCode, displayName, status, and createdAt.
Authenticated tools
Payments
Live provider execution is disabled. The synthetic sandbox is not production. These calls use a bearer JWT. This page documents them and does not call them.
POST /v1/countries/AE/managed/payment-intents
POST /v1/countries/{countryCode}/managed/payment-intents does not authorize, capture, or settle a payment. For AE, business.managed-model is disabled, so the response is HTTP 403 business_gate_disabled. No payment intent is stored. The country in the sample path is the synthetic value AE.
POST /v1/countries/{countryCode}/orchestration/session-intents
POST /v1/countries/{countryCode}/orchestration/session-intents requires business.orchestration, which is enabled for AE. The response status is accepted_placeholder. No payment authorization, capture, or settlement occurs.
GET /v1/organizations/{organizationId}/merchant-accounts/{merchantAccountId}/payment-intents/{intentId}/status
{"intentId":"33333333-3333-4333-8333-333333333333","status":"created","networkCall":false,"executionEnvironment":"synthetic"}
GET the stored payment status returns the intent already stored. A synthetic read uses intent 33333333-3333-4333-8333-333333333333, status created, networkCall false, and executionEnvironment synthetic. Stored status values are described under Payment status. A stored succeeded value is test-mode labeling. It is not a provider capture.
The published contract has no refund operation. This page does not list one.
Authenticated tools
Payment status
Stored status is a read, and it uses a bearer JWT. It returns the status already stored, plus the latest attempt status when one exists. No provider call is made. networkCall is false. executionEnvironment is synthetic, which labels a stored succeeded value as test-mode rather than a provider capture.
GET /v1/organizations/{organizationId}/merchant-accounts/{merchantAccountId}/payment-intents/{intentId}/status
Checkout stores created. A browser return does not change the stored status to captured or succeeded. Arriving back in the browser is not a captured payment. The return handler in this repository ignores the query string and stays pending.
accepted_placeholder is the status of an orchestration session intent. It is not a completed payment, and it is not a payment-link status. No payment authorization, capture, or settlement occurs.
POST /v1/countries/{countryCode}/orchestration/session-intents
- Stored status values are created, processing, requires_action, succeeded, failed, unknown, and expired.
- unknown and processing are returned as stored.
Authenticated tools
Country and currency limits
Live provider execution is disabled. The synthetic sandbox is not production. countryCode is two characters. currency is three characters. The contract does not publish a currency allow-list. AED and AE below are synthetic examples of those lengths, not a production approval.
Country routes and merchant-account creation require country_codes on the token to include the country. Reading gates uses a bearer JWT. This page does not call the operation.
GET /v1/countries/AE/gates
GET /v1/countries/{countryCode}/gates returns business.orchestration, business.managed-model, and business.payouts. For AE in this contract, orchestration is enabled, and managed payments and payouts are disabled.
{"business.orchestration":true,"business.managed-model":false,"business.payouts":false}
POST /v1/countries/AE/payouts
POST /v1/countries/{countryCode}/payouts does not create or send a payout. For AE, business.payouts is disabled, so the response is HTTP 403 business_gate_disabled. The same code is returned for a managed payment intent while that gate is off.