Quickstart
Request access
Create your developer account. After you sign up, complete your profile (company name and intended use) — the CGI ALL PAYMENT SYSTEMS products become visible in the catalogue once your profile is complete and approved.
Sign upGet your credentials
Every request needs two credentials:
Subscription key — subscribe to a CGI ALL PAYMENT SYSTEMS product from the API catalogue, then find your key under Profile → Subscriptions. Send it in the Ocp-Apim-Subscription-Key header.
OAuth2 client — register an application to obtain a client_id and client_secret for requesting tokens. If your organisation doesn't yet have a registered client, contact support and we'll set one up for you.
Get an OAuth2 token
Request an access token from the token endpoint using the client credentials flow. Tokens expire — request a new one when you receive 401 Unauthorized.
curl -X POST "https://login.microsoftonline.com/<YOUR-TENANT-ID>/oauth2/v2.0/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=<your-client-id>" \
-d "client_secret=<your-client-secret>" \
-d "scope=api://<YOUR-API-APP-ID>/.default"
The response contains an access_token — send it as a bearer token in the Authorization header.
Make your first call
Every API call follows the same pattern, whichever API you are using. Find the operation you need in the API catalogue — its reference page gives you the full request URL, the HTTP method, and the expected request body — then send the request with both headers on every call: your subscription key and your bearer token, plus a Content-Type header matching the body format the operation expects.
curl -X POST "<request-url-from-the-operation-page>" \
-H "Ocp-Apim-Subscription-Key: <your-subscription-key>" \
-H "Authorization: Bearer <access-token>" \
-H "Content-Type: <content-type-the-operation-expects>" \
--data-binary "@request-body.txt"using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", subscriptionKey);
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken);
var body = await File.ReadAllTextAsync("request-body.txt");
using var content = new StringContent(body, Encoding.UTF8, contentType);
var response = await client.PostAsync(requestUrl, content);
Console.WriteLine((int)response.StatusCode);import requests
with open("request-body.txt", "rb") as f:
body = f.read()
response = requests.post(
request_url,
headers={
"Ocp-Apim-Subscription-Key": subscription_key,
"Authorization": f"Bearer {access_token}",
"Content-Type": content_type,
},
data=body,
)
print(response.status_code)Check the operation's reference page for the success code to expect: some operations return 200 OK with a response body, while others process asynchronously and return 202 Accepted with an empty body — meaning the request was validated and queued, not completed. Anything else, see Errors & exceptions below.
Both headers, every time. The subscription key identifies your application to the gateway; the bearer token proves its identity. A request with only one of the two will be rejected.
Explore the APIs
Browse the full catalogue to see every operation, schema, and example — and try requests directly from your browser.
Tip — Try It Out. Every operation in the catalogue has a Try It console that sends real requests from your browser. It runs against a connected test environment (sandbox), isolated from production — no live payments are ever created, so experiment freely.
Errors & Exceptions
The CGI ALL PAYMENT SYSTEMS APIs use standard HTTP status codes. Every error response also carries a structured body you can act on programmatically.
HTTP status codes
| Code | Meaning | What to do |
|---|---|---|
| 202 Accepted | The payload passed validation and has been queued for asynchronous processing. The response body is empty. | Record any identifiers you supplied in the request — they are your reference for the submission from here on. |
| 401 Unauthorized | The bearer JWT is missing, malformed, or expired. | Request a new token (Quickstart step 3) and retry. Confirm the scope matches the API, and that the Ocp-Apim-Subscription-Key header is also present. |
| 403 Forbidden | The JWT is valid but your client lacks the required OAuth2 right for this operation. | Verify your subscription covers this product and your client was granted the required role. If access was recently granted, allow a few minutes and retry — then contact support. |
| 404 Not Found | The requested resource or endpoint does not exist. | Check the URL against the operation's reference page — copy it exactly, including any version segments in the path. |
| 408 Request Timeout | The server timed out waiting for the request to complete — commonly a slow or interrupted connection, or a large payload that took too long to transmit. | Retry the request with backoff. If it recurs, check your network/proxy configuration and ensure the request body is sent promptly after the connection opens. Caution: a timeout does not confirm the request wasn't received — before resubmitting anything non-idempotent, verify whether the original was processed. |
| 500 Internal Server Error | An unhandled runtime error occurred while processing the request. | Retry with backoff. If it persists, contact support and quote the code from the error body together with the time of the request. |
Error response structure
Errors raised by the payment service return an XML RestExtApiError envelope (Content-Type: application/xml):
<RestExtApiError>
<status>500</status>
<message>Internal Server Error</message>
<statusMessages>
<RestApiStatusMessage>
<code>EXWRMPII500</code>
<message>An unexpected error occurred. Please contact support.</message>
</RestApiStatusMessage>
</statusMessages>
<path>/paymentTransaction/initiate/v1</path>
</RestExtApiError>
| Field | Description |
|---|---|
status | The HTTP status code, repeated in the body. |
message | A short, human-readable summary of the error class. |
statusMessages / RestApiStatusMessage / code | A stable, machine-readable error code (e.g. EXWRMPII500). Use this in your error handling — it won't change between releases, unlike the message text. Quote it when contacting support. |
statusMessages / RestApiStatusMessage / message | A human-readable explanation of what went wrong. One error response can carry several RestApiStatusMessage entries. |
path | The request path the error relates to. |
Authentication errors look different. A 401 or 403 can be rejected at the gateway before it reaches the payment service, in which case the body is the gateway's own error format rather than the RestExtApiError envelope. Always branch your error handling on the HTTP status code first, and treat the body shape as informational.
Troubleshooting checklist
Before raising a ticket, confirm: both headers are present on the request (Ocp-Apim-Subscription-Key and Authorization: Bearer …), the token was issued less than an hour ago, your subscription is active under Profile → Subscriptions, the request body matches the schema on the operation's reference page, and the Content-Type header matches the body format the operation expects.
Glossary
- Subscription key
- A key issued when you subscribe to a product. Identifies your application to the gateway; sent in the
Ocp-Apim-Subscription-Keyheader on every request. - Product
- A packaged group of APIs you subscribe to as a unit. Your subscription key is scoped to a product, not to individual APIs.
- OAuth2 bearer token
- A short-lived access token proving your application's identity, obtained from the token endpoint and sent in the
Authorization: Bearerheader. Used together with — not instead of — the subscription key. - Client credentials flow
- The OAuth2 flow used by these APIs: your application authenticates directly with its
client_idandclient_secret, with no end-user sign-in involved. - Sandbox (connected test environment)
- The test environment behind the Try It Out console and your test credentials. Fully isolated from production — no live payments are created.
- Try It Out
- The interactive console on every operation page in the catalogue. Fills in your subscription key automatically and sends real requests to the sandbox.
- CGI ALL PAYMENT SYSTEMS
- The CGI payments platform these APIs expose.
- Client ID / client secret
- The credentials issued for your application registration. The
client_ididentifies your application; theclient_secretauthenticates it. Treat the secret like a password — never embed it in client-side code or commit it to source control. - Scope
- Declares which API a requested token is valid for. Passed as the
scopeparameter on the token request; a token issued for one scope will be rejected by APIs expecting another. - API gateway
- The single entry point all API requests pass through. It validates your subscription key and bearer token, applies rate and access policies, and routes the request to the backing service.
- Asynchronous processing
- Some operations return
202 Acceptedinstead of200 OK: the request was validated and queued, and processing completes after the response is returned. Each operation's reference page states which success code to expect.
How to read the spec
Every API in the catalogue is described by an OpenAPI (Swagger) specification — a machine-readable contract that the reference pages, the Try It Out console, and the downloadable definitions are all generated from. Once you can read one CGI ALL PAYMENT SYSTEMS spec, you can read them all.
The parts that matter
| Section | What it tells you |
|---|---|
| Paths & operations | The endpoints (e.g. POST /paymentTransaction/initiate/v1) and what each one does. The operation page in the portal maps one-to-one to these. |
| Parameters | Path, query, and header inputs. Required parameters are marked — a missing one is a common cause of a rejected request. |
| Request body schema | The exact shape of the payload you send — field names, types, formats, and which parts are required. The operation page renders this schema and usually provides ready-made request samples. |
| Responses | Every status code an operation can return, each with its own schema — including the error envelope described above. |
| Security | The auth schemes an operation requires. For CGI ALL PAYMENT SYSTEMS APIs this is the subscription key plus the OAuth2 bearer token. |
Download the definition
To generate a client, import into Postman, or diff versions, download the raw definition from any API's page in the catalogue — open the API and use the API definition download (available as OpenAPI YAML or JSON). The download always reflects the currently published version, so prefer it over locally saved copies.
The Try It Out console is the fastest way to see a spec in action: it builds a valid request from the schema for you, so you can compare a working call against your own code side by side.
Need help?
Stuck on a step, or seeing an error you can't resolve? Send us the error code from the response body together with the time of the request, and we'll investigate.