Skip to main content
Understanding the structure of Notch Pay API responses is essential for properly integrating with our API. This guide explains the standard response format, common fields, and how to interpret different types of responses.

Standard Response Format

All Notch Pay API responses follow a consistent JSON format:

Response Properties

Success Responses

Single Resource Response

When retrieving a single resource (like a payment or customer), the response typically looks like this:

Collection Response

When retrieving a collection of resources (like a list of payments), the response includes pagination information:

Pagination Properties

Creation Response

When creating a new resource, the response typically includes the created resource and a 201 status code:

Update Response

When updating a resource, the response typically includes the updated resource:

Deletion Response

When deleting a resource, the response typically confirms the deletion:

Error Responses

When an error occurs, the response includes information about what went wrong:
For more information about error responses, see the Error Handling guide.

Response Formats for Specific Endpoints

Payments API

Create Payment

Retrieve Payment

Transfers API

Create Transfer

Customers API

Create Customer

Response Fields

Common Fields

These fields appear in most resource objects:

Timestamps

All timestamps in Notch Pay API responses are in ISO 8601 format with UTC timezone:
Example: 2023-01-01T12:00:00Z

Handling Responses in Different Programming Languages

JavaScript

PHP

Python

Best Practices

  1. Check the Status Code: Always check the code field to determine if the request was successful.
  2. Handle Pagination: When working with collection endpoints, implement pagination to retrieve all results.
  1. Parse Timestamps: Convert timestamp strings to Date objects for easier manipulation.
  1. Handle Empty Collections: When retrieving collections, check if the items array is empty.
  1. Extract Relevant Data: Only extract the data you need from the response to simplify your code.

Next Steps