GoDigital
Getting started

Authentication & security

Merchant-facing APIs do not use certificate signing. Each integration is protected by:

  • OAuth2 client credentials and short-lived JWT bearer tokens
  • IP whitelisting of your public IP addresses
  • Timestamps and nonces to prevent replay attacks
  • Idempotency keys for payment creation
  • Optional HMAC-SHA256 signatures, when enabled for your integration

Access tokens

Request a token with the client credentials grant:

Code
POST /oauth/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&client_id={clientId}&client_secret={clientSecret}

Send it on every payment request as Authorization: Bearer <access_token>. Tokens expire after expires_in seconds (normally 3600).

Keep your client secret on your server

Never put your client secret in a browser, mobile app or public repository.

Required headers for payment APIs

HeaderDescription
AuthorizationBearer <access_token>
X-Client-IdClient identifier issued during onboarding.
X-Request-IdUnique request identifier (UUID recommended).
X-Idempotency-KeyUnique idempotency key for the request. See Idempotency.
X-Timestamp10-digit Unix epoch time in seconds, e.g. 1782275551.
X-NonceUnique random value for every request.
X-Content-SHA256SHA-256 of the raw request body, Base64-encoded.
X-Signature (optional)Base64-encoded HMAC-SHA256 signature, only if enabled during onboarding.

The Balance enquiry endpoint also expects Accept: application/json and Content-Type: application/json. The Name check endpoint needs Accept, X-Client-Id and X-Request-Id.

Computing X-Content-SHA256

Python
import base64, hashlib def content_sha256(body: str) -> str: return base64.b64encode(hashlib.sha256(body.encode("utf-8")).digest()).decode() # Empty body (GET requests): content_sha256("") # 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
PHP
$contentSha256 = base64_encode(hash('sha256', $body, true));
JavaJava
String contentSha256 = Base64.getEncoder().encodeToString( MessageDigest.getInstance("SHA-256").digest(body.getBytes(StandardCharsets.UTF_8)));

IP whitelisting

All API clients are restricted to the public IP addresses approved during onboarding. Requests from other addresses are rejected:

JSONCode
{ "status": "FAILED", "code": "PGW-1009", "message": "IP address is not whitelisted" }

Testing from this site

The playground sends requests from your browser, so your current public IP must be whitelisted in the sandbox for live tests to succeed.

Keep your clock in sync

X-Timestamp is validated against server time. Keep your servers synchronized with NTP to avoid timestamp validation failures.

Last modified on