Before you start
- Obtain a Sandbox API key and access token using the Quickstart guide.
- Keep the deductor’s TAN and TRACES password ready.
- Confirm that TRACES has processed the relevant statement and made the certificates available for the requested period.
TY 2026-27, Q1. Replace the sample TAN, period, and placeholders with your own values.
Generate Form 131 certificates
Authenticate the deductor
Call Authenticate a TRACES deductor with your Sandbox access token in the
Save
Authorization header.Deductor authentication request
Deductor authentication request
data.access_token as your deductor access token and data.refresh_token as your deductor refresh token. Use the deductor access token in the Authorization header for certificate requests.Create the certificate job
Call Create a certificate job with a deductor token with
Save
131 in the path. The token identifies the TAN. Send only @entity, tax_year, and quarter in the body.Certificate job request
Certificate job request
data.job_id from the response. The job starts with data.status set to in_progress.Check the certificate job status
Call Get certificate job status with a deductor token with the returned
Continue polling while
job_id and the same certificate type.Certificate status request
Certificate status request
data.status is in_progress, including while TRACES prepares the certificate files. When data.status is failed, stop polling and read data.message for the reason. A failed job still returns HTTP 200.Generate Form 133 TCS certificates
Replace131 with 133 in both the create and status URLs. Use the same request body fields and deductor authentication flow.
Resume after token expiry
If a status request returns HTTP403 because the deductor access token expired, call Refresh a TRACES deductor session. Send the deductor refresh token in Authorization.
data.access_token and data.refresh_token. Retry the status request with the new access token and the same job_id.
If the refresh token has expired or is rejected, authenticate the same deductor again. Resume polling the existing job_id with the new deductor access token.