Skip to main content

forbidden

HTTP Status: 403 Forbidden

Example response

{
  "error": {
    "code": "forbidden",
    "message": "Demo key is restricted to GET /v1/validate and GET /v1/rates",
    "docs_url": "https://docs.avatcado.com/errors/forbidden"
  },
  "meta": {
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

What happened?

Your API key does not have permission to access the requested resource. This typically occurs when:
  • Using the demo key on an endpoint other than GET /v1/validate or GET /v1/rates
  • The demo key is restricted to read-only validation and rate lookups

How to fix

  1. Use a full API key. Sign up at avatcado.com and generate a avat_live_ key to access all endpoints.
  2. Check the endpoint. The demo key only works with GET /v1/validate and GET /v1/rates.

Catching this error with the SDKs

import Avatcado, { AuthenticationError } from '@avatcado/node';

const avatcado = new Avatcado('avat_live_your_api_key');
const { data, error } = await avatcado.vat.validate({ vatNumber: '...' });

if (error instanceof AuthenticationError) {
  console.log(error.message);
}