code Response Code

Fatora uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted, a value is less than min value, etc.). Codes 500 range indicate an error with Fatora's servers (these are rare).

Status Code Description
200 - OK The request has succeeded
201 - Createt The request has succeeded and has led to the creation of a resource. e.g:
create invoice, create client, create item.
204 - No Content The request has succeeded and the delete of object has done successfully. e.g:
delete invoice, delete client, delete item.
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized Merchant API key isn't valid.
403 - Forbidden The server understood the request but refuses to authorize it. e.g:
Merchant API key is inactive.
422 - Unprocessable Entity the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions. e.g:
Deactivate card token already hase deactivated before.
404 - Not Found The specified resource does not exist. e.g:
The requested payment doesn`t found.
406 - Not Acceptable The server cannot use the client-request media type to return the response payload. e.g:
This error occurs if the client sends an Accept: application/xml request header but the API can generate only an application/json response.
409 - Conflict Adding new client with same data of existing client
415 - Unsupported Media Type The server refuses to accept the request because the payload format is in an unsupported format. e.g:
The API can not process the media type of the request payload, this error occurs if the client sends a Content-Type: application/xml request header but the API can only accept application/json request payloads.
429 - Too Many Requests Too many requests hit the API too quickly.
500 - Internal Server Error Something went wrong on Fatora's end. (These are rare).

error-code Error

If the request is failed, Fatora API returns a JSON response contains the reason for the failure.

Bad Request

Fatora API returns a response with 400 status code(Bad request), if the request is not well-formed, syntactically incorrect, or violates schema, Possible issues are.

Erro Code Description
INVALID_PARAMETER_SYNTAX
  • Client email must have valid email address format.
  • Currency code should be a three-character ISO-4217 currency code.
MISSING_REQUIRED_PARAMETER
  • Client details are missing.
  • Client email must have valid email address format.
  • Amount value is missing, please provide valid amount.
  • card_token value is missing.
  • Client email and client phone are null, you must provide a valid value for one of them.
  • Order_id value is missing.
  • Transaction_id value is missing.
  • Client email must have valid email address format.
NOT_SUPPORTED
    Currency code is not supported.
ID_INVALID
  • ID must be bigger than 1.
LANGUAGE_CODE_INVALID language code must be "en" or "ar".
NOTE_INVALID
PAGE_INVALID Specified page parameter must be between 1 and 1000.
PAGE_SIZE_INVALID Specified page_size parameter must be between 20 and 100.
CANNOT_PROCESS_REFUNDS Cannot refund a failed Payment.
INVALID_INTEGER_VALUE Amount value must be greater or equal to 1.
BLOCK_CLIENT Client is blocked.
NOT_WELL_FORMED Failure URL is not well-formed. Success URL is not well-formed.
RFFUNDED_ALREADY Payment is already refunded.
NOT_SUPPORTED Merchant account doesn't support tokenization for QAR. Merchant account is not gateway merchant, please contact support.

Fatora API returns a response with 400 status code (FORBIDDEN), when the server refused the request to one of the following issues:

Erro Code Description
NOT_SUPPORTED
  • Merchant account doesn't support tokenization for QAR.
  • Merchant account is not gateway merchant, please contact support.
  • Currency code is not supported.
API_KEY_EXPIRED Merchant account is inactive, please contact support to activate your account.
BLOCK_CLIENT Client is blocked.
ACCOUNT_LIMIT You have exceed monthly limit. You have exceed payment limit.
AGENT_GATEWAY_STOPPED Agent gateway is stopped.

Fatora API returns a response with 404 status code, when resource does not exist. error_code in json object is equal to RESOURCE_NOT_FOUND

Fatora API returns a response with 429 status code, when you have exceed request limit in the same session. error_code in json object is equal to RATE_LIMIT

Fatora API returns a response with 422 status code (UNPROCESSABLE_ENTITY), when the requested ction could not be performed, semantically incorrect, or failed business validation. Possible issues are

Erro Code Description
RFFUNDED_ALREADY Payment is already refunded.
CANNOT_PROCESS_REFUND Cannot refund a failed Payment.
BALANCE_INSYFFICIENT There is not enough balance in your account to refund payment.
CARD_TOKEN_DEACTIVATED_ALREADY Card token is already decativated.
technical-support

🛠️ Technical Support