Skip to main content
The UQPAY Go SDK provides typed access to Account Center, Global Account, Global Acquiring, Card Issuance, and Supporting Services. It includes automatic Access Token management, automatic idempotency keys, request options, webhook verification, PGP authorization decisions, and sandbox transaction simulation.

GitHub

github.com/uqpay/uqpay-sdk-go/v2
The SDK requires Go 1.19 or later. v2.1.0 is the current stable release. Version v1.2.0 is its first release in the coordinated client release line.

Installation

Quick start

Before you begin, create a sandbox account and create API keys.

Configuration

Sandbox:
Production:

Authentication

The SDK manages UQPAY Access Tokens automatically:
  • Retrieves an Access Token using clientID and apiKey
  • Caches the Token until it nears expiry
  • Retrieves a new Token before the current one expires
  • Provides concurrency-safe Token management

Idempotency

Every API request automatically includes a unique idempotency key to ensure safe retries and prevent duplicate operations. You do not need to set this manually.

Error handling

The SDK returns detailed error information including HTTP status codes and API error details:
Example error format:

Authorization decision (PGP)

Authorization decisions let your endpoint approve or decline card transactions in real time. UQPAY sends a PGP-encrypted transaction to your endpoint; the SDK decrypts it, calls your decision function, and encrypts the response. Before implementing the handler, review the authorization decision workflow, enablement requirements, response codes, and timeout window. Generate an RSA-2048 key pair, exchange the public key with UQPAY, and keep the private key secure:
Configure the keys and register the HTTP handler:
The SDK preserves monetary values as strings, accepts amounts encoded as JSON strings or numbers, and aborts the HTTP response on processing errors so UQPAY can apply the configured timeout action.

API coverage

Stablecoin Account (Ramp) is not included in the current SDK product scope.

Resources

Use each product namespace.

Webhooks

Verify incoming webhook signatures.

Authorization decisions

Process PGP-encrypted card authorization requests.