Responses

When engaging with the Notch Pay APIs, it's crucial to comprehend the format of the responses you'll receive. This understanding will enable you to interpret the responses accurately and handle them effectively within your application.

Response Structure

Responses from the Notch Pay API are delivered in the JSON format and adhere to a consistent structure. Below is an example of a typical response:

Response
{
  "status": "OK",
  "code": "200",
  "message": "Payment retrieved",
  "object": {},
  "errors" : {}
}

In responses from the Notch Pay API, each segment provides specific information, including:

  • status: This segment represents the HTTP status of the response, indicating whether the request was successfully processed or if there were errors during processing.
  • code: This segment contains the HTTP status code, offering a precise indication of the result of the request.
  • message: This part contains a human-readable string describing the outcome of the operation. In successful API calls, it confirms the action taken, while in failed ones, it provides information about the encountered issue.
  • object: An object containing any returned data (payment,transfer, items, customer, etc) from the operation. Its structure varies based on the specific API endpoint and the information it aims to convey. For example, a payment-related API might provide payment details within this segment. If no data is returned, this segment remains an empty object ({}).
  • errors: This segment may appear, particularly when an operation fails. It comprises an array of error objects, each providing details about the encountered issues. These objects furnish information such as the error type, a detailed explanation, and sometimes recommendations or steps to address the issue.

Understanding this response format is crucial for effectively utilizing the Notch Pay APIs. It enables comprehensive handling of both successful operations and errors in a user-friendly manner. For detailed insights into the structure and content of the "data" segment for each endpoint, consult the specific API endpoint documentation.


Copyright © 2024 Notch Pay