Permissions for searching orders

I’m very new to Square API, I’m writing an app for my own restaurant. I created an app and am trying to access the API POST/v2/orders/search
curl https://connect.squareup.com/v2/orders/search
-X POST
-H ‘Square-Version: 2025-03-19’
-H ‘Authorization: Bearer XXXXXXXX’
-H ‘Content-Type: application/json’
-d ‘{
“location_ids”: [
“AAAAA”
]
}’

And I get the error

{
“errors”: [
{
“code”: “FORBIDDEN”,
“detail”: “You have insufficient permissions to perform that action.”,
“category”: “AUTHENTICATION_ERROR”
}
]
}

:waving_hand: 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

Get Developer Credentials
Using the REST API
Configure the Order-Ahead Sample Application

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.

I know I need the Permissions ORDERS_READ, but I don’t know how to give them to my app. Other API calls I make do work so I am quite sure the issue is with permissions to this specific API.

What’s the location_id that your trying to get orders from? :slight_smile: