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 integer in cents",
  "details": {
    "requestId": "req_01HXX..."
  }
}
FieldTypeNotes
codestringMachine-readable. Stable across versions — safe to branch on.
messagestringHuman-readable. May change wording — never branch on this.
detailsobjectOptional context. Always includes requestId for log correlation.

Include the requestId when you contact support — we can pull the full request, response, and provider trace from a single ID.

Code reference

HTTPCodeWhen it fires
400invalid_argumentGeneric validation failure — payload shape, missing field, bad enum
400invalid_argumentinvalidAmount: amount is zero, negative, or has sub-cent precision
400invalid_argumentinvalidCurrency: currency is not in the supported list
400invalid_argumentmissingReturnUrl: HPP charge without a returnUrl
400invalid_argumentinvalidCardToken: token unknown, inactive, expired, or for another merchant
401unauthenticatedMissing, malformed, or revoked API credentials
401unauthenticatedWebhook signature failed HMAC verification
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 or isn't yours
409already_existsDuplicate creation attempt — externalId collision with a different payload
499abortedpaymentDeclined: provider rejected (insufficient funds, AVS/CVV)
499abortedpaymentFailed: provider-level failure that isn't a clean decline
503unavailableproviderUnreachable: provider returned 5xx or network call failed
500internalproviderNotConfigured: no active provider for this merchant
500internaldatabaseUnreachable: our database is down — we'll be paging

Why 499?

HTTP 499 is "Client Closed Request" in our framework's default mapping. We use it for clean payment-level failures (declined, failed) where the request was processed but the outcome wasn't success. Treat 499 as "the payment did not happen — read the body to know why."

What to log

For every error response, log at minimum:

  • error.code
  • error.message
  • error.details.requestId
  • The endpoint 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.