Skip to Content
Pymstr

Error Handling

Every refusal from the Pymstr API carries a status and a code.

Error Format

status repeats the HTTP status, and code is one of the values below.

{
  "status": 400,
  "code": "bad_request"
}

One refusal carries a third field. A 409 with conflict on POST /v1/payments or POST /v1/payouts means the externalId is already in use, and id is the payment or payout that holds it (see Lost Response).

{
  "status": 409,
  "code": "conflict",
  "id": "01234567-89ab-cdef-0123-456789abcdef"
}

Error Codes

Each status has one generic code, which the API answers unless a more specific code below applies.

StatusCode
400bad_request
401unauthorized
403forbidden
404not_found
408request_timeout
409conflict
411length_required
413payload_too_large
415unsupported_media_type
429too_many_requests
431headers_too_large
500server_error
502bad_gateway
503unavailable
504gateway_timeout

The specific codes an API key can receive:

StatusCodeEndpointMeaning
400recipient_refusedPOST /v1/payments, POST /v1/payoutsA seller or payee address cannot receive funds: Pymstr's fee wallet or a paymaster address, or an account that is suspended
400record_not_activeDELETE /v1/payments/:id, DELETE /v1/payouts/:idThe payment or payout is no longer ACTIVE

Failure Details

A payment or payout with status FAILED carries an error object: { code, message, details? }. Use code in your logic; message is free text.

CodeMeaning
TX_REVERTEDThe transaction reached the blockchain and reverted. Nothing was paid.
BUNDLER_DROPPEDThe transaction was submitted but never confirmed, and it has expired.
FOREIGN_IMPLEMENTATIONThe paying wallet was running code Pymstr does not support, and its transaction did not make the required transfers.

details is optional. On FOREIGN_IMPLEMENTATION it holds implementation, the contract the wallet ran.

Common Mistakes

Invalid amount format

The amount field is a string with 0, 1, or 2 decimal places. A JSON number such as 100.00 is rejected, and so is a third decimal place. Zero-decimal currencies (JPY, IDR, VND) reject fractional amounts.

RejectedAccepted
100.00 "100.123""100" "100.5" "100.00"

Sellers take too much

The sellers' cuts must leave you a cut. After the fee, your cut and each seller's cut must still meet the currency's Min split (see Currencies & Chains). Otherwise the API returns 400 with bad_request.