Sign inCreate account

Errors and troubleshooting

Every signed API response has request_id, fetched_at, state and data. Errors use state: error, a stable data.code and a readable data.message. Keep the request ID when diagnosing a failure; switch on codes rather than message text.

{
  "request_id": "req_000000000000000000000000",
  "fetched_at": "2026-09-17T12:00:00Z",
  "state": "error",
  "data": {
    "code": "validation_failed",
    "message": "Check the VAT return figures.",
    "errors": [{
      "code": "vat_box_3_mismatch",
      "path": "/return/total_vat_due_pence",
      "message": "Total VAT due must equal VAT due on sales plus acquisitions.",
      "expected_value": 12500,
      "actual_value": 12499,
      "auto_correctable": true
    }]
  }
}

data.errors identifies fields using JSON Pointer paths. auto_correctable means the expected value is mathematically determined; GoFile still never changes your figures silently. Optional data.next_action describes a recovery action when available.

Common problems

HTTP / codeWhat to check
401 unauthoriseddata.errors[0].code names the cause: missing_authentication_headers, invalid_key_format, invalid_timestamp (use seconds), timestamp_outside_window (server clock), invalid_nonce, invalid_signature_format, nonce_reused, or invalid_credentials (key, secret, path or body bytes did not verify). See signing.
403 scope_requiredEnable the operation's key permission in the portal. HMRC consent and API key permissions are separate.
403 method_not_enabledThe tax service (VAT or Income Tax) is not enabled for your integration. Its authorisation start, retrieval and preparation are all refused, before any HMRC consent. The integration owner can enable it under API keys > Tax services.
403 terms_acceptance_requiredThe integration owner must follow the returned continuation URL and accept the current Connect terms.
403 integration_suspendedContact the integration owner or GoFile support.
404 connection_not_found / not_foundUse the correct saved ID, integration, service and sandbox/live key. The message names the identifier that did not match. Other integrations' resources are never accessible. Removed routes also return 404.
404 tax_account_not_found / taxpayer_not_foundCheck the VAT number or NINO. HMRC holds no matching tax account; this is different from no open periods.
403 hmrc_authorisation_required / hmrc_authorisation_invalidRenew HMRC consent for the connection.
403 client_not_authorisedCheck the taxpayer and agent-client relationship at HMRC.
403 mfa_reauthentication_requiredObtain recent software-user MFA evidence; see live filing.
400 invalid_json / 413 payload_too_large / 405 method_not_allowedSend one JSON object, at most 1 MB, using POST, with each key at most once per object. No query parameters. An empty body is treated as {}.
422 validation_failedInspect data.errors for missing, unexpected or invalid fields; see validation issue codes. Identifiers belong in the JSON body.
409 idempotency_conflictReuse the original unchanged draft and retry key, or use a new key for a genuinely new intent.
VAT: 200 with the existing filingPreparing a VAT period that already has an open filing returns that filing (HTTP 200) when the draft is identical, even with a new Idempotency-Key; different figures return 409 idempotency_conflict. Resume the existing filing; nothing new is created.
409 quarterly_update_in_progressIncome Tax refuses a second preparation while another update for the business is open or unconfirmed. Retrieve and finish the existing one.
409 period_submission_in_progressFinal VAT submission found the same period being submitted at that moment. Retrieve the filing; do not submit again.
409 obligation_not_open / period_not_endedIncome Tax preparation for an obligation that is already fulfilled, or whose period has not ended. Use an open obligation with can_submit: true.
422 no_open_obligation / period_requiredVAT preparation without period: HMRC holds no open period, or several are open (the message lists them). Supply period from an open obligation.
409 period_already_submittedThe VAT period was already filed through GoFile. Retrieve the existing filing and its receipt instead of preparing it again.
409 external_filing_id_conflictThat external_filing_id already belongs to a different draft. Reuse the original draft or choose a new reference.
409 period_unavailable / no_matching_obligationRefresh information and use the exact returned open period or obligation ID.
402 billing_requiredEnable live billing in the developer portal; sandbox remains available.
429 rate_limitedHonour the returned retry guidance and Retry-After.
503 hmrc_unavailable / service_unavailableHMRC or GoFile is temporarily unavailable and nothing was changed. These responses carry Retry-After and data.retry.safe: true: retry the same request after the interval.
503 submissions_disabledSubmissions are paused. Check the returned message.

Do not round or change a customer's figures without approval.

Validation issue codes

Each data.errors[] item has a code and a JSON Pointer path. The codes below are stable. Some endpoints use different names for the same kind of problem; they are kept unchanged so existing integrations keep working. New codes may be added, so handle an unknown code by its path and message.

CodeMeaningReturned by
invalid_fieldA missing or malformed routing value: connection_id, vat_number, national_insurance_number, tax_year, submission_id, authorisation_session_id, or software_user_id on authorisation; an unexpected retrieval field; the missing Idempotency-Key header (path /Idempotency-Key); or a malformed client_action.authentication field.All endpoints
requiredA live authorisation start without vat_number or national_insurance_number.Authorise
unsupported_fieldA field the authorisation body does not accept, including scopes.Authorise
invalid_stringA string is empty, too long or contains control characters: software_user_id, external_filing_id, external_update_id.Authorise, preparation
invalid_return_url, return_origin_not_allowed, reserved_query_parameterreturn_url is not an absolute HTTPS URL without a fragment, its origin is not registered, or it contains gofile_session.Authorise
invalid_idempotency_keyIdempotency-Key is longer than 120 characters.Authorise
required_stringsoftware_user_id or software_user_login is missing, empty, too long or contains control characters.Preparation
required_objectperiod, return or cumulative is not an object.Preparation
required_fieldA required VAT box or Income Tax total is missing.Preparation
unexpected_fieldA field the preparation body does not accept.Preparation
server_owned_fieldA field GoFile sets itself, such as period_key or finalised.VAT preparation
invalid_boolean, invalid_objectvalidate_only is not a JSON boolean, or client_action / client_action.authentication is not an object.Preparation
invalid_date, invalid_periodA period date is not a real YYYY-MM-DD date, or the end is not after the start.Preparation
integer_pence_required, whole_pounds_required, value_out_of_rangeA figure is not integer pence, boxes 6-9 are not whole pounds, or a figure is outside HMRC's range. Box 5 must be 0 to 9,999,999,999,999 pence.Preparation
vat_box_3_mismatch, vat_box_5_mismatchVAT arithmetic. expected_value gives the figure that would be correct.VAT preparation
consolidated_and_itemised_expensesAn Income Tax update sends both consolidated_expenses_pence and itemised expenses; choose one route.Income Tax preparation
invalid_business_id, invalid_obligation_id, unsupported_tax_year, unsupported_itsa_feature, unsupported_business_typeThe Income Tax draft names an invalid business, obligation or tax year, or an unsupported feature.Income Tax preparation
business_not_found, obligation_not_found, obligation_mismatchThe obligation does not resolve in the cached Income Tax information: refresh it and copy the returned obligation_id. A missing obligation_id is 422 validation_failed with required_field at /obligation_id. obligation_mismatch means an optional tax_year, business_id or period differs from the obligation.Income Tax preparation
unsupported_headerA Gov-* header was sent.All endpoints

Unit, range and arithmetic checks run together. A box that fails its unit or range check is left out of the arithmetic, and the other boxes are still checked in the same response.

Statuses and retries

The table describes top-level state. VAT filing states also appear when retrieving a submission ID; ledger status is a separate result.

Endpoint / operationPossible statesWhat to do next
/authorise/vat, /authorise/itsapending, authorising, exchangingOpen the returned URL once; check the saved attempt through the same endpoint.
Authorisation resultcompleted; failed, expiredSave data.connection_id on completion. Otherwise start a new attempt.
/vat, /itsa account information; preparation awaiting account readinessready, syncing, action_requiredUse the data; wait as instructed; or repair HMRC authorisation.
/vat/prepare, /itsa/prepare with validate_onlyvalid, invalidCheck data.valid and fix validation errors. No submission exists.
VAT preparation / filing resultrequires_client_context, awaiting_hmrc_auth, validating, awaiting_approval, requires_review, auth_expiredOpen data.continue_url when supplied; the hosted journey performs capture, authorisation checks and review.
Income Tax preparation / update resultawaiting_approvalOpen data.continue_url for the user's confirmation.
Either submission resultsubmittedSave the receipt.
Either submission resultsubmission_unconfirmedRetrieve the existing submission; never resend while the outcome is unknown.
Either submission resultfailed, expired; VAT also rejected, reconciliation_blockedInspect the returned error/reconciliation details and apply the recovery rules below.
Any endpointerrorInspect data.code and any field/retry guidance.

All endpoint paths above have the /api/v1 prefix. history.state and other nested ledger fields describe that portion of the cached data, not the authorisation or submission journey.

ready means information is available. HTTP 202 with state: syncing means the account's first sync has not completed yet: honour Retry-After (normally a few seconds). A read of stale information queues a refresh in the background but never waits for it. action_required is normally HTTP 200; follow data.authorisation.continue_url when supplied. A valid empty obligations list does not mean an error.

For failures, retry automatically only when data.retry.safe is true. Use the Retry-After header first, then data.retry.after_seconds, with jitter. Missing guidance means no automatic retry. Reads are replay-safe despite using POST. Each retry needs a new timestamp, nonce and signature.

Preparation is retry-safe with a saved Idempotency-Key and unchanged draft. Both VAT and Income Tax require that header when preparing a submission. HTTP 201 means a submission was prepared, not filed.

validate_only: true runs preparation's field, unit, range and arithmetic checks, and checks the shape of any client_action.authentication, without creating anything or needing an Idempotency-Key. HTTP 200 means the draft was checked: read data.valid and data.errors. Checks that depend on the moment of filing are left to preparation:

Checkvalidate_onlyPreparation
Fields, units, ranges and arithmeticYesYes
MFA evidence shape (mfa_type, mfa_at, factor_reference)YesYes
VAT period is open and not already filed (no_open_obligation, period_required, period_already_submitted)No, so figures can be checked before a period endsYes
Income Tax obligation resolves in cached informationYesYes
Income Tax obligation is open and its period has endedReported in data.warnings (obligation_not_open, period_not_ended); the draft stays validRefused with 409
Income Tax figures above the £90,000 consolidated-expenses limit, or lower than the last cumulative submissiondata.warnings (consolidated_expenses_limit, cumulative_lower_than_previous); never blockingShown to the person approving; never blocking
Live MFA recency, billing, daily limits and idempotencyNoYes

Errors in the request around the draft are returned before validation runs, as HTTP 422 validation_failed with no data.valid: identifiers and routing fields, a validate_only that is not a JSON boolean (a quoted "true" is refused), and a malformed client_action. Errors in the draft itself return HTTP 200 with state: invalid.

An unused Income Tax approval link expires after five minutes. Retrieval or an identical preparation retry returns state: expired. To continue, prepare a new update with a new Idempotency-Key, a new external_update_id if you supply one and current MFA evidence where required. The expired record stays available; its old link cannot submit. No housekeeping wait is required.

Hosted confirmation makes one HMRC attempt, never an automatic resend. If state is submission_unconfirmed, the write may have reached HMRC: never resubmit or create a replacement to bypass the lock. Retrieve the existing filing/update for read-only recovery. A definite rejection or proven non-delivery requires a fresh human decision before another attempt.

Browser redirects and timeouts

After HMRC consent the hosted page spends up to three seconds fetching the client's information, then redirects to your return_url or shows the completion page. An HTTP redirect finishes your PHP request. It does not return control to that script after HMRC consent. Save the temporary authorisation session on your backend, then check it from another request. The complete VAT and Income Tax browser examples do this without a long PHP polling loop.

If decoding returns null, inspect the raw HTTP response, status and curl error. HTML from a proxy or a wrong URL is not a JSON API response. A Cloudflare 502 identifies a failure between Cloudflare and the named host; use that host's server logs and request time to locate it. Do not output debug text before sending a PHP Location header.

Ledger freshness

LedgerWhen it refreshes
VAT informationDuring the authorisation journey; when a read finds it older than five minutes; 30 minutes after a return filed through GoFile; otherwise weekly.
Income Tax informationDuring the authorisation journey; when a read finds it older than five minutes; 30 minutes after an update submitted through GoFile; otherwise weekly.

These are scheduling rules, not maximum-age guarantees. A new account is due at once and is normally synced while the user is still on the hosted page; the continuous worker picks up anything left within moments, followed by HMRC response time. Worker downtime, backlog, rate limits and HMRC failures can make data older. Historical VAT obligations and balances can still be syncing after current obligations are ready.

fetched_at tells you when GoFile produced this response. data.data_as_of tells you when the ledger last successfully reconciled. ready means usable cached information exists; it does not promise that information is recent. Use its age in your UI. A stale read queues one background refresh (at most every five minutes per account); polling faster does not accelerate it. An accepted submission is recorded locally immediately; HMRC ledger confirmation may follow later.

Operational limits

ItemLimit / handling
Signature timestampUnix seconds, within 300 seconds (five minutes) of GoFile's server time in either direction. Synchronise your server clock.
Signature nonce16–64 letters, digits, _ or -; fresh for every request, including retries.
Authorisation attempt20 minutes from creation; use returned expires_at. Start again after expiry.
VAT approval URLFive minutes; use continue_url_expires_at. Retrieve the existing open filing with vat:prepare permission for a fresh link. Live MFA must still qualify.
Income Tax approval URLFive minutes; unused expired updates require a new preparation and retry key, as described above.
JSON request bodyAt most 1,048,576 bytes (1 MiB).
Idempotency-Key1–120 characters; required for preparation except validate_only. A missing key returns 422 validation_failed with code invalid_field and path /Idempotency-Key (a header, not a body field). Save it with the unchanged draft.
Request rateIntegration/key limits apply; honour HTTP 429 and Retry-After. Successful responses carry no rate-limit headers. There is no universal requests-per-second promise.

An approval URL's lifetime is separate from retention of its submission record and receipt. Never infer a reusable approval capability from a saved submission ID.

Diagnosing hosted submission checks

The hosted page loads browser capture automatically. A rejected capture does not call HMRC or consume the approval action. Its browser protocol is separate from the signed API and returns error, detail, safe_to_retry and request_id. A submission that did not complete also returns user (outcome, title, message): plain-English wording for the person on the page, such as HMRC's reason for a rejection and what to do next. GoFile.actions.execute passes it on as error.user. Retry only as instructed; share the request ID with GoFile support, never the private approval URL or captured values.

Unavailable JavaScript user-agent data is recorded and omitted; it does not by itself block approval. Other missing browser or network facts can block the submission. Developers supply the current software_user_id, software_user_login and live MFA evidence; GoFile supplies the browser and network capture.

For GoFile operators: capture logs list failed-check names without the private values. vendor_public_ip, client_public_ip and vendor_forwarded require checking the real receiving/proxy path; never substitute a proxy socket for the user's address or port. Behind Cloudflare the browser source port arrives only in the zone's X-Client-Port Transform Rule header and is omitted when that header is absent, so client_public_port appears only for a malformed value. client_public_ip_timestamp indicates stale or invalid capture time; user_reference indicates missing software identity; capture_storage indicates database/capture persistence. Verify deployment facts with HMRC's fraud-prevention Test API; local sandbox tests cannot prove the production network path.

Read this page as Markdown