Skip to main content

Payment API Reference

This reference documents the C2B (customer-to-business) payment initiation API.

Base URL

Use the base URL provided during onboarding for each environment (sandbox and production are separate hosts). Because the host is part of the signed canonical string, signatures are environment-specific by construction.

Authentication

Requests are authenticated with a detached Ed25519 signature over the v1 canonical string, sent via the X-Public-Key, X-Signature, X-Timestamp, and X-Request-ID headers. Your API key must carry the c2b permission. The C2B API additionally accepts an optional Idempotency-Key header for safe retries. See Authentication for the full scheme, signing helpers, and the replay/rate-limit rules that apply to every request.

Initiate Payment

Creates a payment session and returns a hosted checkout URL. Endpoint

Request Body

Validation failures are accumulated — the error message lists every failing field, not just the first one. All URLs must be https; http and other schemes are rejected.

Response

Redirect your customer to checkoutUrl. The token embedded in the URL is minted by GoPay and expires; do not cache checkout URLs.
When retrying after UPSTREAM_UNAVAILABLE (503) or UPSTREAM_TIMEOUT (504), generate a fresh X-Request-ID and signature (the old ID may already be consumed), and send the same Idempotency-Key so the payment is not created twice.

Payment Statuses

Settlement status is delivered via webhook (see C2B Callbacks):