Mintcash
Concepts

Errors

Every error MintCash can return, what it means, and the HTTP status code it carries. The full taxonomy in one place.

When something goes wrong, MintCash responds with a consistent envelope and a machine-readable code you can branch on. No string-matching, no parsing English.

Error envelope

{
  "code": "invalid_argument",
  "message": "Amount must be a positive number with at most two decimal places",
  "details": {
    "requestId": "req_01HXX..."
  }
}
FieldTypeNotes
codestringMachine-readable. Stable across versions — safe to branch on.
messagestringHuman-readable. May change wording — never branch on this.
detailsobject | nullOptional extra context.

When you contact support, include the endpoint, your externalId, and the full error envelope — that's enough for us to pull the request and provider trace on our side.

Code reference

HTTPCodeWhen it fires
400invalid_argumentGeneric validation failure — payload shape, missing field, bad enum
400invalid_argumentAmount is zero, negative, or has sub-cent precision
400invalid_argumentinvalidCurrency: currency is not in the supported list
400invalid_argumentCard token unknown, inactive, or expired
400invalid_argumentRefund amount exceeds the refundable balance
400failed_preconditionPayment not refundable in its current state
400failed_preconditionA previous refund on this payment is still processing
401unauthenticatedMissing, malformed, or revoked API credentials
403permission_deniedRequest IP is not on the key's allow list
403permission_deniedMerchant account is deactivated
404not_foundThe resource (payment, subscription, refund) doesn't exist
409already_existsA uniquely-identified resource already exists
409abortedPayment or refund processing failed at the provider — including provider-side errors. The request was valid but the outcome wasn't success
503unavailableThe provider couldn't be reached at all (network failure) — safe to retry with the same externalId
500internalNo active payment provider configured, or an unexpected server error

Codes are coarse — the message disambiguates

The code values are the framework's standard error codes, so one code can cover several situations (everything under invalid_argument, for example). Use the message to disambiguate in logs and support tickets, but design your flow so the code alone is sufficient to branch on.

What 409 aborted means

aborted is the "clean failure" outcome: the request was processed but the charge or refund did not go through at the provider. Treat it as "the payment did not happen — read the message to know why", not as a bug in your request.

What to log

For every error response, log at minimum:

  • error.code
  • error.message
  • The endpoint, your externalId, and the request payload (redact card tokens)

That's enough for us to find the failure on our side and for you to correlate against your application logs.