Authentication error in Sandbox when trying to add payment

I am trying to add some orders and payments for them into the square dashboard for testing. I am getting this error

I am getting the error when using this api call

payments->create(
    new CreatePaymentRequest

“category”: “AUTHENTICATION_ERROR”,

      "code": "INSUFFICIENT_SCOPES",


      "detail": "The merchant has not given your application sufficient permissions to do that. The merchant must authorize your application for the following scopes: PAYMENTS_WRITE"

:reverse_button:

I have the following scoped set when I obtain the oath token ‘PAYMENTS_READ’, ‘PAYMENTS_WRITE’, ‘ORDERS_WRITE’, ‘ORDERS_READ’, ‘INVENTORY_READ’,
‘INVENTORY_WRITE’

And when I look in the sandbox test account I see that my app is connected and this

View your payments history

Includes all incoming payments and refunds.

is one of the permissions.

Any help is appreciated.

Thanks

Don

: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

Technical Scenarios
Technical Scenarios
OAuth API

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.

When you call RetrieveTokenStatus are all the relevant permissions returned? :slight_smile: