OneKhusa API endpoints supports RFC7807 standard for handling errors using a single, predictable JSON structure. This section outlines the error response payload structure as follows:
{
  "type": "https://httpstatuses.com/400",
  "title": "Bad Request",
  "status": 400,
  "detail": "Validation failed",
  "instance": "https://api.onekhusa.com/sandbox/v1/api/collections/getTransaction",
  "errors": [
    "Merchant Account Number should be 8 numbers only.",
    "Merchant Account Number is incorrect format",
    "Transaction Reference Number should be exact 12 characters."
  ]
}
FieldDescription
typeStable URI that identifies the error category.
titleShort summary of the error.
statusHTTP status code.
detailHuman-readable explanation.
instancePath or resource that triggered the issue.
errorsField-level validation details (when available).

HTTP Responses

StatusNameDescription
200OKThe request succeeded and the response contains the expected payload.
201CreatedOneKhusa created the requested resource, such as a transaction or payout.
202AcceptedOneKhusa accepted the request and queued it for further processing. Notification will be sent through email and/or webhook when process is complete.
204No ContentThe request succeeded and no response body is returned (for example, querying/retrieving a transaction which does not exist)
400Bad RequestThe request payload malformed due to business validation rules implemented in OneKhusa.
401UnauthorizedThe supplied OneKhusa credentials were missing, expired, or invalid.
402Request FailedThe request was well-formed but OneKhusa could not complete it due to business rule validation.
403ForbiddenThe authenticated principal lacks permission to call this OneKhusa endpoint.
404Not FoundThe referenced OneKhusa resource could not be located.
409ConflictThe request conflicts with the current state of the resource (for example, duplicate idempotency key).
424External Dependency FailedOneKhusa could not complete the request because a downstream provider returned an error.
429Too Many RequestsThe rate limit for this API key or tenant was exceeded; retry with exponential backoff.
500, 502, 503, 504Server ErrorsOneKhusa encountered an unexpected error; retries usually succeed once the service stabilizes.
For more information on Transaction Responses Click here .