HASH PAY Docs
API reference

Errors

Every error is a non-2xx status with the same small JSON shape. Read the code programmatically; show the message to yourself, not your buyer.

The error envelope

errorjson
{
  "error": {
    "code": "volume_cap_reached",
    "message": "the seller has reached their plan's monthly volume"
  }
}

The code is a stable, machine-readable string — switch on it. The message is a human-readable hint that may change; don't parse it.

Checkout & payment errors

What you'll see from the publishable-key and secret-key endpoints:

CodeHTTPMeaning
missing_key401No publishableKey in the body.
publishable_key_required401A secret key was sent where a publishable one belongs.
invalid_key401Key is unknown or revoked.
unauthorized401Missing/invalid secret key on a server endpoint.
origin_required400No usable Origin/Referer on a live request.
origin_not_allowed403Origin is a rejected (blacklisted) domain on the store.
account_disabled403Account is suspended or banned.
email_unverified403Live key used before the email was verified.
rate_limited429Over 120 checkout creates/min from this IP.
volume_cap_reached402The account's monthly received-volume ceiling is reached; upgrade to continue.
no_wallet422No receiving wallet configured for the chosen network.
price_not_found404Unknown priceId/paymentLinkId for this account.
session_not_found404Unknown sessionId.
session_closed409Session is past its expiry.
bad_amount400Session amountCents was not a positive integer.
bad_request400Malformed body or an unparseable network/token.

Payment-status errors

CodeHTTPMeaning
payment_not_found404No payment with that id.
not_test_mode400Tried to simulate a live payment.
not_open409Tried to simulate a payment that's already settled or closed.

Dashboard operations (wallets, stores, keys, products…) return the same { error: { code, message } } shape with codes like account_not_found, store_not_found, duplicate_address, duplicate_domain, product_not_found and key_not_found. You meet these through the dashboard UI or when driving the same endpoints with your sk_ key.

Handling errors well

  • Branch on code, not HTTP status alone — several codes share a status (e.g. the 403s).
  • Don't surface raw errors to buyers. A capped account (volume_cap_reached) or a setup gap (no_wallet) is yours to fix; show the buyer a calm "can't accept payments right now" if it ever reaches them. The embed already does this.
  • Retry only the retryable. 429 and any 5xx are worth a backoff; 4xx validation errors won't change until you fix the request.