Skip to content

Errors

Every error uses the same envelope as a successful response. Read code to tell them apart: it is "ok" on success and a stable, machine-readable value on every error.

Errors carry a message instead of data:

{
"success": false,
"statusCode": 403,
"code": "invalid_api_key",
"message": "API key is invalid or missing to access to the requested resource"
}
FieldTypeDescription
successbooleanfalse for invalid_api_key, quota_exceeded, and on partner account and travel group errors. true on every other error: don’t rely on it.
statusCodeintegerMirrors the HTTP status code. Errors on the country, currency and advisory endpoints come back with 200.
codestring"ok" on success, an error code otherwise. Stable: safe to switch on.
messagestringHuman-readable explanation, for logs. Wording may change.
fieldsstring arrayOnly with invalid_fields: the invalid or missing fields.

Branch on code. Neither success nor the HTTP status flags every error: plan_restricted comes back with success: true, and a malformed parameter on /advisory/{code} comes back with HTTP 200.

const body = await res.json();
if (body.code !== 'ok') {
// body.code is stable; body.message is for humans and logs
throw new Error(`${body.code}: ${body.message}`);
}

Never parse message. Treat an unknown code like a generic failure and log it.

Checked before the endpoint runs, in this order.

StatuscodesuccessMeaningWhat to do
403invalid_api_keyfalseToken missing or invalid, or the path isn’t a public endpoint (a typo in the URL ends up here too).Check the Authorization: Bearer header and the path. See Authentication.
403plan_restrictedtrueYour key only covers some destinations (a trial key covers India) and this request targets another one. The message lists the destinations your key covers. Not counted towards your quota.Stay within the listed destinations, or ask for a wider key.
429quota_exceededfalseMonthly quota used up.Wait for the reset in RateLimit-Reset. See Rate limits.
500internal_server_errortrue or falseUnexpected failure on our side.Retry later with backoff. If it persists, contact us with the request URL and time.

The deprecated alias GET /partner/{partner_name}/requirements returns the same codes.

StatuscodeMeaning
400invalid_parametersnationality or destination missing, or not a 2 or 3-letter code.
403user_is_unauthorizedLegacy path only: partner_name doesn’t match your partner account.
403countries_restrictionsNo destination is enabled on your account. Contact us.
403country_restrictionThis destination isn’t enabled on your account.
404user_not_foundThe token isn’t linked to a partner account. Contact us.
404country_not_foundnationality or destination doesn’t match any country.
404no_requirements_foundNo requirement on record for this nationality and destination.

These errors come back with HTTP 200.

EndpointcodeMeaning
GET /country/{code}invalid_idNo code in the path.
GET /country/{code}invalid_parameter_formatcode is neither a numeric ID nor a 2 or 3-letter country code.
GET /country/{code}no_country_foundNo country matches code.
GET /currency/{code}invalid_parameterNo code in the path.
GET /currency/{code}invalid_parameter_formatcode is neither a numeric ID nor a 3-letter ISO 4217 code.
GET /currency/{code}no_currency_foundNo currency matches code.
GET /advisory/{code}invalid_parametersMalformed code, source or min_level.
GET /advisory/{code}no_country_foundNo country matches code.

GET /countries and GET /currencies have no endpoint-specific errors.

These errors come back with HTTP 400.

EndpointcodeMeaning
GET /vaccinesinvalid_parameterscountry_code missing, or not a 2 or 3-letter code.
GET /vaccinesno_country_foundNo country matches country_code.
GET /customsinvalid_parameterscountry_code missing, or not a 2 or 3-letter code.
GET /customsno_country_foundNo country matches country_code.
GET /representationsinvalid_parametersNeither host_country_code nor represented_country_code given, a malformed country code, or an unknown type. The message says which.
GET /representationsno_country_foundThe host or represented country doesn’t match any country.

Partner accounts: POST /partners and POST /partners/link

Section titled “Partner accounts: POST /partners and POST /partners/link”

For approved integrators. Errors use real HTTP statuses, and success is false on all of them.

StatuscodeRouteMeaning
400invalid_fieldsBothThe fields array lists the invalid or missing fields.
400invalid_json/partnersThe body isn’t a JSON object.
400invalid_code/partners/linkThe connection key is unknown, already used or for another platform.
400code_expired/partners/linkThe connection key expired. Ask the agency for a new one.
403integrator_not_allowedBothThe platform’s access isn’t active. Contact us.
409email_already_registered/partnersadmin.email already has a Visamundi account.
409external_agency_id_takenBothThis identifier can’t be used. Pick another one.
409key_not_recoverable/partnersThe account exists but its API key can’t be issued again. Contact us.
409already_connected/partners/linkThis agency is already connected to your platform.
429rate_limited/partnersOver 30 accounts created in the last hour.
502provisioning_failed/partnersThe account couldn’t be created. Retry.
502link_failed/partners/linkThe agency couldn’t be connected. Retry.
503service_unavailableBothTemporarily unavailable. Retry later.

For approved integrators. success is true on all of these errors.

StatuscodeRouteMeaning
200missing_query_parameters/visasdestination is missing.
200invalid_query_parameter_format/visasA parameter has the wrong format.
200no_country_found/visasdestination or nationality doesn’t match any country.
404no_visas_found/visasNo visa matches.
200invalid_id_format/visa/{id}id isn’t a number.
200no_visa_found/visa/{id}No published visa has this id.

Travel groups: POST /partner/{slug}/transaction

Section titled “Travel groups: POST /partner/{slug}/transaction”

For approved integrators. success is false, except on invalid_mode.

StatuscodeMeaning
400invalid_fieldsThe fields array lists the invalid or missing fields.
400invalid_modemode must be travel_group with an integrator key.
403integrator_not_allowedThe platform’s access isn’t active. Contact us.
404agency_not_foundNo agency has this external_agency_id on your platform.
409partner_not_linkedThis agency key isn’t linked to a partner account. Contact us.
409partner_has_no_accountThe agency has no active account. Contact us.
502travel_groups_failedThe groups couldn’t be created. Retry.
503service_unavailableTemporarily unavailable. Retry later.
{
"success": true,
"statusCode": 200,
"code": "no_currency_found",
"message": "No currency found"
}

The status is 200 and success is true, but code isn’t "ok": this response is an error.

Request API access

Full access is free in most cases: it's for travel professionals who also offer Visamundi's visa assistance to their customers. Tell us about your business and we'll get back to you within one business day.

Just want to try it? Get a trial key now (India, 100 requests/month).

Get a trial key

No sales call: we're engineers, we'd rather you judge the data on a real request. Confirm your email and your key is ready.

  • India as a destination
  • 100 requests / month
  • No card needed
Lost your key?

What's included · Travel pro? Full access is free in most cases: request it