Skip to main content
Documentation menu

#Error reference

#SDK error classes

All errors extend BkashError and have a stable code.

Class Code Cause What to do
BkashApiError BKASH_API_<externalCode> bKash answered with an error code. externalCode, httpStatus and raw are available. Look the code up below. Show the message to the customer, not the code.
BkashRateLimitError BKASH_RATE_LIMIT The Grant/Refresh Token limit was hit (HTTP 429). Wait for retryAfterMs. Check that every process shares one token store.
BkashVerificationMismatchError BKASH_VERIFICATION_MISMATCH bKash's result differs from the amount, currency or invoice you expected. Do not fulfil. Investigate; this can indicate tampering or a bug.
BkashTimeoutError BKASH_TIMEOUT Execute timed out and Query Payment could not confirm the outcome. Outcome is unknown. Show "pending, do not pay again" and re-query later.
BkashDuplicateExecutionError BKASH_DUPLICATE_EXECUTION Another execute is in progress, or error 2062 without a Completed payment. Wait and query the payment.
BkashWebhookVerificationError BKASH_WEBHOOK_VERIFICATION An IPN message failed verification. Reject it. Do not act on its content.
BkashFeatureNotSupportedError BKASH_FEATURE_NOT_SUPPORTED The feature is not implemented, or not available for the configured apiVersion. See feature status.

#HTTP handler responses

Situation Status Body
Outcome unknown (timeout) 202 { success:false, status:"unknown", error }
Mismatch / duplicate 409 { success:false, status:"mismatch" | "duplicate" }
Rate limited 429 { success:false }
bKash error 400 { success:false, code, error }
Customer cancelled or failed 400 { success:false, status }
Webhook failed verification 401 { success:false }
Unexpected error 500 { success:false, error:"bKash request failed." } (no internals)

#bKash error codes

These are copied from the published bKash error tables (payment and refund). Meanings are bKash's wording. The mapping in KNOWN_BKASH_ERRORS is checked against this table by a test.

CodeMeaning (bKash)
503System is undergoing maintenance. Please try again later
2001Invalid App Key
2002Invalid Payment ID
2003Process failed
2004Invalid firstPaymentDate
2005Invalid frequency
2006Invalid amount
2007Invalid currency
2008Invalid intent
2009Invalid Wallet
2010Invalid OTP
2011Invalid PIN
2012Invalid Receiver MSISDN
2013Resend Limit Exceeded
2014Wrong PIN
2015Wrong PIN count exceeded
2016Wrong verification code
2017Wrong verification limit exceeded
2018OTP verification time expired
2019PIN verification time expired
2020Exception Occurred
2021Invalid Mandate ID
2022The mandate does not exist
2023Insufficient Balance
2024Exception occurred
2025Invalid request body
2026The reversal amount cannot be greater than the original transaction amount
2027The mandate corresponding to the payer reference number already exists and cannot be created again
2028Reverse failed because the transaction serial number does not exist
2029Duplicate for all transactions
2030Invalid mandate request type
2031Invalid merchant invoice number
2032Invalid transfer type
2033Transaction not found
2034The transaction cannot be reversed because the original transaction has been reversed
2035Reverse failed because the initiator has no permission to reverse the transaction
2036The direct debit mandate is not in Active state
2037The account of the debit party is in a state which prohibits execution of this transaction
2038Debit party identity tag prohibits execution of this transaction
2039The account of the credit party is in a state which prohibits execution of this transaction
2040Credit party identity tag prohibits execution of this transaction
2041Credit party identity is in a state which does not support the current service
2042Reverse failed because the initiator has no permission to reverse the transaction.
2043The security credential of the subscriber is incorrect.
2044Identity has not subscribed to a product that contains the expected service or the identity is not in Active status.
2045The MSISDN of the customer does not exist.
2046Identity has not subscribed to a product that contains requested service.
2047TLV Data Format Error
2048Invalid Payer Reference
2049Invalid Merchant Callback URL
2050Agreement already exists between payer and merchant
2051Invalid Agreement ID
2052Agreement is in incomplete state
2053Agreement has already been cancelled
2054Agreement execution pre-requisite hasn't been met
2055Invalid Agreement State
2056Invalid Payment State
2057Not a bKash Account
2058Not a Customer Wallet
2059Multiple OTP request for a single session denied
2060Payment execution pre-requisite hasn't been met
2061This action can only be performed by the agreement or payment initiator party
2062The payment has already been completed
2063Mode is not valid as per request data
2064This product mode currently unavailable
2065Mendatory field missing
2066Agreement is not shared with other merchant
2067Invalid permission
2068Transaction has already been completed
2069Transaction has already been cancelled
2071Refund after %s days not allowed
2072Refund amount not valid
2073Invalid SKU
2074The transaction cannot be reversed
2075SKU Character Limit Exceeded
2076Reason Character Limit Exceeded
2077Invalid TrxID
2078Invalid Reason
2079Invalid app Token
2080The identity is not permitted to initiate this transaction
2081The identity of the debit or credit party is in a state which prohibits the execution of this transaction
2082The merchant is not permitted to initiate this transaction
2116The agreement execution has already been completed
2117The payment execution has already been completed
2118The Platform value is invalid
2119The authorized payment has already been processed
2127Transaction not yet completed

Not every code is in a table (for example 9999 for invalid credentials appears in responses). Unknown codes keep bKash's own message.

Found a mistake? Edit this page on GitHub. Unofficial community project, not affiliated with bKash Limited.