> ## Documentation Index
> Fetch the complete documentation index at: https://docs.way.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> HTTP response codes and how to troubleshoot them

The Way API uses standard HTTP response codes.

<AccordionGroup>
  <Accordion title="Success Codes">
    * `200 OK` - Request successful.
    * `201 Created` - Resource (like a payment intent or booking) created successfully.
  </Accordion>

  <Accordion title="Validation Codes">
    * `422 Unprocessable Entity` - Correct content type and syntax, but instructions couldn't be processed.
    * `404 Not Found` - Requested resource does not exist.
  </Accordion>

  <Accordion title="Authorization Codes">
    * `401 Unauthorized` -  No valid API key provided.
    * `403 Forbidden` - API key lacks necessary permissions.
  </Accordion>

  <Accordion title="Rate Limiting">
    * `429 Too Many Requests` - Rate limit exceeded. Back off and retry after a delay.
  </Accordion>

  <Accordion title="Server Error Codes">
    * `500, 502, 503, 504` - Server errors on Way's end (rare occurrences).
  </Accordion>
</AccordionGroup>

## Troubleshooting

| Symptom                                  | Likely cause                                                                                                                                                                                                                                                       | Fix                                                                                                                                                                                                       |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `401` on every request                   | Wrong key, or key from the other environment (`way_sk_test_` vs `way_sk_live_`)                                                                                                                                                                                    | Check the base URL matches the environment your key belongs to ([Environments](/environments))                                                                                                            |
| `403` with valid credentials             | API access not enabled for the brand/org - or the key doesn't cover what you addressed: a brand key used against another brand's URL, an organization key scoped to a brand outside that organization, or a publishable key used from a domain that isn't approved | Ask your Way representative to enable API access; check the brand is in your organization ([list brands](/api-reference/organizations/get-organization-brands)); approve your domain for publishable keys |
| `422` on booking or payment-intent calls | Payload fails business validation                                                                                                                                                                                                                                  | Read the error body: common causes are a sold-out session, `resourceQuantity` not matching the number of participants, or a cart that was already used - retry with a fresh cart ID                       |
| `429`                                    | Rate limit (400 requests / 60 s)                                                                                                                                                                                                                                   | Back off and retry with exponential delay                                                                                                                                                                 |
