Skip to navigation
Yoco APIError codes

Forbidden

This problem occurs when you aren’t authorised to perform an operation on the requested resource.

Troubleshooting

  • Have you checked that the authentication token you’re using has the required scope to operate on the resource?
  • Have you checked that you haven’t accidentally tried to operate on the wrong resource?
  • Has the business finished onboarding with Yoco? Requests for a business that hasn’t finished onboarding return 403 until the merchant completes onboarding in the Yoco app.
  • Does an entry in the response’s errors list say the user lacks a permission? Your token is valid, but the user who authorised your app doesn’t hold a permission the operation needs. Ask the merchant to grant that permission to the user, or to authorise your app as a user who holds it. The entry names the permission when the response identifies it.

Example errors

{
"type": "https://developer.yoco.com/docs/api/error-codes/forbidden",
"title": "Forbidden",
"detail": "You do not have permission to access this resource.",
"status": 403,
"code": "forbidden"
}

When the user who authorised your app lacks a permission the operation needs, an entry in errors says so, and names the permission when the response identifies it:

{
"type": "https://developer.yoco.com/docs/api/error-codes/forbidden",
"title": "Forbidden",
"detail": "You do not have permission to access this resource.",
"status": 403,
"code": "forbidden",
"errors": [
{
"detail": "The user who authorised this app does not have permission to apply discounts.",
"pointer": null,
"parameter": null,
"code": "forbidden"
}
]
}