PaydayAPI
Principles

Errors

One error shape, stable codes, what to retry.

Every error has the same shape. code is stable and safe to branch on; message is for people and may change.

JSON
{ "error": { "code": "rate_limited", "message": "Limit is 600 requests a minute for this key." } }
StatusCodeMeaningRetry?
400bad_status, bad_sort, bad_cursor, bad_since, bad_mints, bad_mint, bad_json, bad_chain, basket_typeA parameter is not one the endpoint takes. The message says what is allowed.Fix the request
400key_in_urlA key was put in the URL.Send it in a header, and revoke it
400bad_wallet, bad_name, bad_symbol, bad_image, bad_dev_buy, handle_required, sol_or_stock, split_unsigned, not_our_txLaunches: a field is missing or wrong, or a signed transaction is missing or was changed.Fix the request
400basket_size, basket_weights, basket_asset_not_allowed, basket_payback_not_allowedLaunches: the basket was refused. error.rejected gives one reason per asset.Fix the basket
401missing_key, invalid_keyNo key, or the key is wrong or revoked.No
403signin_required, launch_not_allowed, opted_outA launch key was asked for without a sign-in, the key cannot launch, or the account in fees_to opted out.No
404not_foundNo such coin, account, launch or endpoint.No
409conflict, in_flightLaunches: already submitted. The error carries the mint.No
410expiredLaunches: signed too late.Create the launch again
413, 415too_large, json_requiredThe body is too large, or a key request without a sign-in was not JSON.Fix the request
429rate_limited, daily_quota, too_many_bad_keys, too_many_new_keys, launch_rate_limitedOver a limit.After Retry-After seconds
503unavailableStarting up, or a part that is switched off here.Yes, with backoff
504unconfirmedLaunches: sent, not confirmed yet. Never create it again: submit the same launch again or read GET /launches/{id}.Yes, the same launch
504, 410not_landedLaunches: the network ruled the launch out, so no coin was made.Create the launch again
500internalOur side.Yes, with backoff

A sensible retry

Retry 429, 500, 503 and 504 unconfirmed with exponential backoff starting at one second, and always honour Retry-After. Never retry a 4xx other than 429 without changing the request.