Payments List API INVALID_REQUEST_ERROR on undocumented fields

I have multiple API endpoints working, but this is the first one I hit a challenge with. Otherwise, things are working in the API Explorer and Postman. The other endpoints are working for both sandbox and production.

When I use the API explorer, the request works, but not when testing with Postman.

Here is the response body.

{
“errors”: [
{
“code”: “VALUE_EMPTY”,
“detail”: “Field must not be blank”,
“field”: “source_id”,
“category”: “INVALID_REQUEST_ERROR”
},
{
“code”: “VALUE_EMPTY”,
“detail”: “Field must not be blank”,
“field”: “idempotency_key”,
“category”: “INVALID_REQUEST_ERROR”
}
]
}

Here is the API Experience link.
GET /v2/payments - Square API Explorer (squareup.com)

Here is the API Docs.
GET /v2/payments - Square API Reference (squareup.com)

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Make your First API Call
Square Sandbox
Square Developer Tools

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

It’s possible that the issue you’re experiencing with Postman could be due to incorrect setup or missing parameters. Here are a few things you could check:

  1. Ensure you’re using the correct base URL for the environment you’re testing (Sandbox or Production).
  2. Check that you’re using the correct HTTP method (GET, POST, PUT, etc.) for the endpoint you’re trying to hit.
  3. Make sure you’re including all required headers, such as the ‘Authorization’ header with your access token.
  4. If the endpoint requires a request body or query parameters, ensure you’re including those in the correct format.
  5. If you’re trying to replicate a request from the API Explorer in Postman, make sure all the parameters and headers match exactly.

Remember, the API Explorer automatically fills in many of these details for you, so it’s possible something got missed when setting up the request in Postman.

This answer was reviewed by @Bryan-Square.

The ListPayments endpoint is a GET request. If your getting an error for idempotency_key that probably means that your making a POST instead of a GET request. :slightly_smiling_face: