Errors

How errors are reported in the KOMOJU API

KOMOJU uses HTTP status codes to indicate the success or failure of a request. Below are the the following status codes you can expect to see.

CodeDescription
200 OKThe server successfully processed the request
202 AcceptedThe resource is successfully created but the process is not finished
204 No ContentThe server successfully processed the request, but is not returning any content.
401 Not AuthorizedAPI key provided was invalid or missing
403 ForbiddenAPI key provided doesn’t have permission to access specified resource
404 Not FoundResource not found
422 Unprocessible EntityMissing or invalid parameters
500 Internal Server ErrorSomething went wrong on our side
502 Bad GatewayUpstream payment processor returned an error
503 Service UnavailableServer maintenance

JSON Error Object

Errors are returned in JSON format. A code and message parameter are returned for each error message.

Attributes

ParameterTypeDescription
messagestringa string describing the error message
codestringerror code
paramstringparameter having the validation error
"error": {  
  "message": "A required parameter (amount) is missing",  
  "code": "missing_parameter",  
  "param": "amount"  
}

Error Codes

Here are the possible error codes that will show up in the above code field.

Error CodeHTTP StatusExample Message
bad_request400The server cannot or will not process the request due to something that is perceived to be a client error
unauthorized401User authorization failed
not_found404The requested resource could not be found but may be available again in the future
internal_server_error500Something went wrong on our side. We're automatically notified of these and try to fix them ASAP
forbidden403You are not authorized to perform that action
unprocessable_entity422The request was well-formed but was unable to be followed due to semantic errors
bad_gateway502We are unable to process your request due to an invalid response from the upstream server
gateway_timeout504When attempting to process your payment, we encountered a gateway timeout. Fear not, we have not processed the payment. Please try your payment again
service_unavailable503The server is down for maintenance. Please try again later.
request_failed402The request failed
invalid_payment_type422Payment method was invalid. "credit_card" is not one of "konbini", "paypay"
invalid_token422The token you requested is invalid
invalid_currency422The currency you requested is invalid
not_refundable422The payment you requested is not refundable
not_capturable422The payment you requested is not capturable
not_cancellable422This payment is noncancellable
fraudulent422This payment is fraudulent
invalid_parameter422The value of amount is invalid
missing_parameter422A required parameter (amount) is missing
insufficient_funds502Insufficient funds
used_number502Used number
card_declined502Card declined
invalid_password502Invalid password
bad_verification_value502Bad verification value
exceeds_limit502Exceeds limit
card_expired502Card expired
invalid_number502The number you requested is invalid
invalid_account502Invalid account
restricted_account502Restricted account
other_error502Other error
invalid_user_key502Invalid user key
other_invalid502Invalid card