Skip to main content

Response Format

All CashQ API responses are in JSON format and share a consistent envelope structure.

Response Envelope

Every API response includes these top-level attributes:
boolean
required
Indicates whether the request was successful. Value will be true or false.
string | object
Contains error information if the request failed. Empty string if successful.
object
Contains the response data for successful requests. Structure varies by endpoint.

Success Response

When a request succeeds, success will be true and the response will include relevant data.

Example Success Response

Success Response Structure

boolean
required
Always true for successful requests
string
Empty string for successful requests
object
Response data specific to the endpoint (e.g., payment_response, balance, status)

Error Response

When a request fails, success will be false and the response will include error details.

Example Error Response

Error Response Structure

string
required
Always "false" for error responses (note: string, not boolean)
object
required
Contains error details

Response Examples by Endpoint

Balance Response

KYC Verification Response

Verified User:
Unverified User:

Transfer Status Response

Check Transfer Response

Handling Responses

Checking Success

Always check the success field first to determine how to process the response:
Type InconsistencyNote that success is a boolean (true/false) for successful responses but a string ("false") for error responses. Always check for both types in your code.

Error Handling

Use the error code for programmatic error handling:

HTTP Status Codes

The CashQ API uses standard HTTP status codes:
Even when the HTTP status is 200, always check the success field in the response body to determine if the operation succeeded.

Best Practices

Always Check Success

Check the success field before processing response data

Handle Both Types

Account for success being both boolean and string

Use Error Codes

Use error codes for programmatic error handling

Log Responses

Log full responses for debugging and monitoring

Next Steps

Error Handling

Learn about specific error codes and how to handle them

API Reference

Explore detailed endpoint documentation