List the providers your key can read
const url = 'https://api.flychain.us/external/v1/providers';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.flychain.us/external/v1/providers \ --header 'Authorization: Bearer <token>'Every provider in your partner relationship, ordered by legal_name.
Reports are addressed per business entity, so GET /business_entities is the
endpoint an integration normally polls. This one is here for the
provider-level list on its own.
A provider that leaves the relationship stops appearing here. See
guides/data-semantics on telling “gone” apart from “never existed”.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The providers in your partner relationship.
object
A provider: the business as a client of Flychain. Reports are addressed per business entity, not per provider.
object
Stable for the life of the account. Used in the report paths.
Registered legal name.
Trading name, where it differs from the legal name.
Any additional names this business is known by. Often empty.
Provider-level tax identifier, unformatted digits.
For matching a provider against your own records. Note that books — and
therefore every report — are kept per legal entity, so the entity-level ein
is usually the field to reconcile on.
Examples
Two providers in one partner relationship
{ "providers": [ { "provider_id": "9c1e7a42-0b3d-4e58-9f21-6a8b5c4d3e2f", "legal_name": "Riverbend Pediatric Therapy LLC", "dba": "Riverbend Therapy — Northside", "other_names": [], "tax_id": "123456789" }, { "provider_id": "7b2d4f60-5a18-4c37-90ab-1e6f8d0c5a24", "legal_name": "Northstar Care Group LLC", "dba": null, "other_names": [ "Northstar Care" ], "tax_id": "987654321" } ]}Missing, invalid, expired or revoked API key. One message covers every case on purpose — a caller cannot tell a revoked key from an unknown one.
The failure shape for every error raised inside a documented operation — validation, authorization, ours — so a client needs a single error path.
Match on code, not on message: the code set below is the contract and is
stable, while wording may be clarified. New codes may be added within v1 (see
guides/versioning), so treat an unrecognised code as “the HTTP status is
authoritative”.
One exception, and it is the one you are most likely to meet while
integrating. A request that does not reach a documented operation at all — an
unrouted path (404) or a method this API does not serve (405) — is rejected
before this layer, and its body may be a different shape or not JSON at all.
Treat the HTTP status as authoritative there, and check the URL: the operations
below are the whole surface.
object
object
Machine-readable cause.
INVALID_REQUEST(400) — malformed dates, a non-UUID path id, an inverted range, or a range with no reportable books behind it.INVALID_API_KEY(401) — missing, invalid, expired or revoked key.PARTNER_API_NOT_ENABLED(403) — your key is valid, but your organization is not enrolled in the API programme. Contact us; do not rotate the key.PROVIDER_NOT_IN_PARTNER_SCOPE(403) — the provider exists but is not in your relationship, including one that has left it.BUSINESS_ENTITY_NOT_IN_PARTNER_SCOPE(403) — the entity exists but does not belong to theprovider_idin the path.PROVIDER_NOT_FOUND(404) — no provider with that id.BUSINESS_ENTITY_NOT_FOUND(404) — no business entity with that id.BOOKS_NOT_AVAILABLE(409) — the entity has no reportable books.INTERNAL_ERROR(500) — ours; retry with backoff.AUTH_SERVICE_UNAVAILABLE(503) — we could not verify your key; retry with backoff, and do not treat it as an authentication failure.
Human-readable detail. Do not match on it.
Examples
{ "error": { "code": "INVALID_API_KEY", "message": "Missing, invalid, expired or revoked API key." }}Your key is valid, but your organization is not enrolled in the API programme.
Deliberately not a 401: the credential is fine and rotating it will not help.
Contact us to be enrolled.
The failure shape for every error raised inside a documented operation — validation, authorization, ours — so a client needs a single error path.
Match on code, not on message: the code set below is the contract and is
stable, while wording may be clarified. New codes may be added within v1 (see
guides/versioning), so treat an unrecognised code as “the HTTP status is
authoritative”.
One exception, and it is the one you are most likely to meet while
integrating. A request that does not reach a documented operation at all — an
unrouted path (404) or a method this API does not serve (405) — is rejected
before this layer, and its body may be a different shape or not JSON at all.
Treat the HTTP status as authoritative there, and check the URL: the operations
below are the whole surface.
object
object
Machine-readable cause.
INVALID_REQUEST(400) — malformed dates, a non-UUID path id, an inverted range, or a range with no reportable books behind it.INVALID_API_KEY(401) — missing, invalid, expired or revoked key.PARTNER_API_NOT_ENABLED(403) — your key is valid, but your organization is not enrolled in the API programme. Contact us; do not rotate the key.PROVIDER_NOT_IN_PARTNER_SCOPE(403) — the provider exists but is not in your relationship, including one that has left it.BUSINESS_ENTITY_NOT_IN_PARTNER_SCOPE(403) — the entity exists but does not belong to theprovider_idin the path.PROVIDER_NOT_FOUND(404) — no provider with that id.BUSINESS_ENTITY_NOT_FOUND(404) — no business entity with that id.BOOKS_NOT_AVAILABLE(409) — the entity has no reportable books.INTERNAL_ERROR(500) — ours; retry with backoff.AUTH_SERVICE_UNAVAILABLE(503) — we could not verify your key; retry with backoff, and do not treat it as an authentication failure.
Human-readable detail. Do not match on it.
Examples
{ "error": { "code": "PARTNER_API_NOT_ENABLED", "message": "This partner is not enrolled in the Flychain external API programme. Contact Flychain to request access." }}Our side. Safe to retry with backoff.
The failure shape for every error raised inside a documented operation — validation, authorization, ours — so a client needs a single error path.
Match on code, not on message: the code set below is the contract and is
stable, while wording may be clarified. New codes may be added within v1 (see
guides/versioning), so treat an unrecognised code as “the HTTP status is
authoritative”.
One exception, and it is the one you are most likely to meet while
integrating. A request that does not reach a documented operation at all — an
unrouted path (404) or a method this API does not serve (405) — is rejected
before this layer, and its body may be a different shape or not JSON at all.
Treat the HTTP status as authoritative there, and check the URL: the operations
below are the whole surface.
object
object
Machine-readable cause.
INVALID_REQUEST(400) — malformed dates, a non-UUID path id, an inverted range, or a range with no reportable books behind it.INVALID_API_KEY(401) — missing, invalid, expired or revoked key.PARTNER_API_NOT_ENABLED(403) — your key is valid, but your organization is not enrolled in the API programme. Contact us; do not rotate the key.PROVIDER_NOT_IN_PARTNER_SCOPE(403) — the provider exists but is not in your relationship, including one that has left it.BUSINESS_ENTITY_NOT_IN_PARTNER_SCOPE(403) — the entity exists but does not belong to theprovider_idin the path.PROVIDER_NOT_FOUND(404) — no provider with that id.BUSINESS_ENTITY_NOT_FOUND(404) — no business entity with that id.BOOKS_NOT_AVAILABLE(409) — the entity has no reportable books.INTERNAL_ERROR(500) — ours; retry with backoff.AUTH_SERVICE_UNAVAILABLE(503) — we could not verify your key; retry with backoff, and do not treat it as an authentication failure.
Human-readable detail. Do not match on it.
Examples
{ "error": { "code": "INTERNAL_ERROR", "message": "An unexpected error occurred. Retry with backoff." }}We could not verify your API key right now — our identity provider was
unreachable or rate-limited. This is not an authentication failure: the key
may well be valid. Retry with backoff rather than treating it as a 401.
The failure shape for every error raised inside a documented operation — validation, authorization, ours — so a client needs a single error path.
Match on code, not on message: the code set below is the contract and is
stable, while wording may be clarified. New codes may be added within v1 (see
guides/versioning), so treat an unrecognised code as “the HTTP status is
authoritative”.
One exception, and it is the one you are most likely to meet while
integrating. A request that does not reach a documented operation at all — an
unrouted path (404) or a method this API does not serve (405) — is rejected
before this layer, and its body may be a different shape or not JSON at all.
Treat the HTTP status as authoritative there, and check the URL: the operations
below are the whole surface.
object
object
Machine-readable cause.
INVALID_REQUEST(400) — malformed dates, a non-UUID path id, an inverted range, or a range with no reportable books behind it.INVALID_API_KEY(401) — missing, invalid, expired or revoked key.PARTNER_API_NOT_ENABLED(403) — your key is valid, but your organization is not enrolled in the API programme. Contact us; do not rotate the key.PROVIDER_NOT_IN_PARTNER_SCOPE(403) — the provider exists but is not in your relationship, including one that has left it.BUSINESS_ENTITY_NOT_IN_PARTNER_SCOPE(403) — the entity exists but does not belong to theprovider_idin the path.PROVIDER_NOT_FOUND(404) — no provider with that id.BUSINESS_ENTITY_NOT_FOUND(404) — no business entity with that id.BOOKS_NOT_AVAILABLE(409) — the entity has no reportable books.INTERNAL_ERROR(500) — ours; retry with backoff.AUTH_SERVICE_UNAVAILABLE(503) — we could not verify your key; retry with backoff, and do not treat it as an authentication failure.
Human-readable detail. Do not match on it.
Examples
{ "error": { "code": "AUTH_SERVICE_UNAVAILABLE", "message": "Unable to verify the API key right now. Retry with backoff." }}