FlowAlp

Merchant API errors

July 30, 2026

HTTP status codes of the FlowAlp Pay Merchant API, the JSON error response shape, and practical retry guidance with exponential backoff.

When a Merchant API call fails, the response combines an HTTP status code with a JSON body that explains the problem. This page lists the status semantics, the error shape, and how to retry safely.

Since API v1.15, failed requests return a status code specific to the failure instead of a generic response — see API versions and changelog.

HTTP status codes

StatusMeaningWhat to do
200 OKRequest processed; check the status field in the bodyContinue your flow
400 Bad RequestMalformed or invalid request (fields, types, encoding)Fix the payload; do not retry unchanged
401 UnauthorizedMissing or invalid credentialsCheck API secret and auth method; do not retry unchanged
403 ForbiddenAccess denied; also follows sustained overload at the platform edgeVerify permissions and instance; under high volume, back off and retry
404 Not FoundUnknown resource, ID or pathCheck Object, id and version segment
405 Method Not AllowedWrong HTTP verb; also an early rate-limit signal under loadCheck the verb mapping; under high volume, back off
429 Too Many RequestsStandard rate-limit statusBack off and retry later
5xxTemporary server-side problemRetry with exponential backoff

The documented rate limit surfaces as 405 followed by 403 while the limit stays exceeded; if you ever receive 429, treat it the same way. Details: Merchant API rate limits.

Error response shape

Failed calls return a JSON body with a status field and a human-readable explanation, typically in a message field:

Typical error bodyJSON
{
  "status": "error",
  "message": "Description of what went wrong"
}

Successful calls return "status": "success" plus a data array. Evaluate the HTTP status code first, then the body. Message texts are not part of the API contract — branch on status codes, never on message strings.

Retry guidance

Failure classRetry?How
400 / 401 / 404 — validation and auth errorsNoFix the request or credentials first
405 / 403 under high volume, 429YesExponential backoff with jitter
5xx and network timeoutsYesExponential backoff; cap the attempts

A proven starting point: initial delay 500 ms, doubling per attempt, random jitter of up to 300 ms, maximum delay 30 s, at most 5 attempts. Make retried operations idempotent in your own system, for example by deduplicating on referenceId.

PHP retry helper with backoffPHP
<?php
function callWithBackoff(callable $request, int $maxAttempts = 5)
{
    $delayMs = 500;

    for ($attempt = 1; $attempt <= $maxAttempts; $attempt++) {
        [$status, $body] = $request();

        if ($status < 400) {
            return $body;
        }

        $retriable = in_array($status, [403, 405, 429], true) || $status >= 500;
        if (!$retriable || $attempt === $maxAttempts) {
            throw new RuntimeException('FlowAlp Pay request failed: HTTP ' . $status);
        }

        usleep(($delayMs + random_int(0, 300)) * 1000);
        $delayMs = min($delayMs * 2, 30000);
    }
}
Inspect status code and body with curlbash
response=$(curl --silent --write-out "\n%{http_code}" \
  --url "https://api.pay.flowalp.com/v1.16/Transaction/<transaction-id>/?instance=<instance>" \
  --header "x-api-key: <api-secret>")

body=$(printf '%s' "$response" | head -n -1)
status=$(printf '%s' "$response" | tail -n 1)

echo "HTTP $status"
echo "$body"

Diagnose authentication failures

  • Run the SignatureCheck smoke test to separate credential problems from endpoint problems.
  • Verify that the instance name matches the subdomain of your payment page.
  • In signature mode, compare your query-string encoding with the reference implementation in Merchant API authentication.

Logging best practices

  • Log HTTP status, resource path and your correlation ID (for example referenceId) — never the API secret or ApiSignature.
  • Separate validation errors from authentication errors in your metrics.
  • Prefer webhooks over aggressive polling so transient errors have less impact.