client_id and client_secret for an access token, and sends the token as a Bearer credential.
See the Quickstart for the concrete commands.
What a credential reads
Every response returns the data of the organization the credential was issued for. Requests never name an organization, and responses never identify one. To read several organizations, hold one credential for each.Tokens
- Get an access token from Get a token with
grant_typeclient_credentials, yourclient_idandclient_secret, andaudiencehttps://api.taxrock.com(the same in both environments). - Cache the access token and reuse it until it expires.
expires_ingives its lifetime in seconds. Request a new token when the cached one expires, not once per call. - There is no refresh token. When a token expires, request a new one the same way.
- Keep the
client_secreton your backend. Never send it to a browser or a mobile app.
Errors
-
401: the access token is missing, invalid or expired. Get a new token. -
403witherrorforbidden: the credential is not set up for direct access. A new token will not fix it. Contact TaxRock. -
404witherrornot_found: the taxpayer or transcript does not exist, or it is outside the credential’s organization. -
400witherrorinvalid_request: a malformedid,pageorpageSize.

