Developers

Failures use real HTTP status codes and one envelope:

JSON
{
  "error": {
    "type": "validation",
    "code": "validation_failed",
    "message": "Please correct the highlighted fields.",
    "fields": { "recipient.iban": "Invalid IBAN for GB" },
    "request_id": "6f0c1e1a-…"
  }
}

Branch on code. message is for humans and may be reworded; code will not change meaning.

StatustypeTypical codes
400invalid_requestidempotency_key_required, malformed_json, missing_parameter, invalid_parameter, invalid_cursor, file_required, url_required, invalid_url, https_required, unknown_event_type, invalid_since
401authenticationauthentication_required, invalid_api_key
403permissioninsufficient_scope, ip_not_allowed, subscription_frozen, account_not_verified, forbidden
404not_foundpayment_not_found, batch_not_found, recipient_not_found, unsupported_country, unknown_template, webhook_endpoint_not_found, delivery_not_found, company_not_found, unknown_endpoint
409conflictidempotency_key_reused, invalid_state, validation_in_progress, price_changed, remittance_not_available, recipient_already_exists, endpoint_already_exists, endpoint_limit_reached, endpoint_disabled, already_delivered
422validationvalidation_failed, insufficient_balance, batch_has_errors, invalid_template, batch_too_large, wallet_not_found, country_blocked, route_unavailable, fee_bearer_not_offered, amount_too_low, pricing_unavailable
429rate_limitedrate_limited, daily_payment_limit_reached
500serverinternal_error
503serverprovider_unavailable — the payout provider could not be reached; retry with the same Idempotency-Key

Two that are worth knowing before you hit them:

  • 404 for another company's resource. A payment id that is not yours is reported as not found, never as forbidden — a 403 would confirm the id exists.
  • 403 subscription_frozen. A company whose ekash subscription is unpaid can still prepare payments but not release them. Top up the USD wallet and processing resumes automatically.

Pricing errors (422). A payment is priced when you quote it and when you create it. When it cannot be priced the answer is 422 with one of these codes (the sentence in message and the field under fields say what to change; a refused create creates nothing):

codeMeaningWhat to change
country_blockedekash does not send payments to that country. fields.recipient.country_codeanother destination
route_unavailableNo payout route exists for that country and payout currency yet. fields.recipient.country_codeanother payout currency (target_currency)
fee_bearer_not_offeredThat route does not offer the chosen fee_bearer. fields.feessender, receiver or shared, whichever the route offers
amount_too_lowAfter the fee taken off what the recipient receives, nothing would be left. fields.amountsend more, or pay the fee yourself (fee_bearer sender)
pricing_unavailableThe price or an exchange rate could not be determined right now. fields.feescheck the currencies; retry

409 price_changed. See Approve below: the price of the payment moved since it was created and nothing was approved.