BayarGO

Error Codes

Understand BayarGO API error responses and codes.

View as Markdown

Failed requests return RFC 9457 problem details with the media type application/problem+json. The stable code identifies the error; detail is safe to show to the caller, and request_id is the correlation ID to include when contacting support.

{
  "type": "https://api.bayargo.id/problems/invalid_api_key",
  "title": "Unauthorized",
  "status": 401,
  "code": "invalid_api_key",
  "detail": "secret key is invalid or revoked",
  "request_id": "req_0123456789abcdef"
}

Public API

HTTPCodeDescription
400invalid_jsonBody is not valid JSON.
400invalid_amountAmount is invalid.
400invalid_bulk_sizeBulk item count is invalid.
400unsupported_payment_methodPayment method is not supported.
400payment_create_failedTransaction could not be created.
400payment_cancel_failedTransaction could not be cancelled.
400payment_refund_failedTransaction could not be refunded.
401invalid_api_keySecret key is missing, invalid, or revoked.
403merchant_not_approvedMerchant is not active.
403api_key_ip_not_allowedRequest IP is not in the API key allowlist.
404not_foundResource was not found.
429rate_limitedRate limit exceeded.
500server_errorRequest could not be processed.

Rate Limit

The API applies rate limits to keep the service stable. If a response includes Retry-After, wait at least that many seconds before retrying. Otherwise, pause before retrying and use exponential backoff for repeated failures. For a retried create- payment request, reuse its original Idempotency-Key.

Retry

ConditionRetry
TimeoutYes, use the same request.
500Yes, after a delay.
400, 401, 403, 404No. Fix the request or merchant status.
429Yes, after waiting for the next rate-limit window.

On this page