# Error Types

## API Errors

(Stated in headers): [In API Guide](https://github.com/CoverGenius/gitbook/blob/master/cg-xcover-offers/api/README.md), global environment based\
\
Basic approach:\
“Does the API respond with a 20X response?”\
\
Useful for:\
\- General API function\
\- Confirmation of actions\
\- Basic operation validation

Example of use:\
\- Was a Create Offer request received?\
\- Was a Confirm Offer request received?\
\- Was there any full failures

## Logic Errors

Logic errors are present in API response body, are case by case, and policy based.\
They are often the indicator of a problem with the Offer creation or confirmation, and may represent a partial booking failure. Always look for the `errors` array.\
\
Basic approach:\
“Does the request contain any content concerns, or logical failures?”\
\
Useful for:\
\- Calculation issues\
\- Confirmation over various state actions\
(does a booking match an Offer expectation)\
\- In depth rule validation\
\
Example of use:\
\- Was a create offer request valid?\
\- Was a confirm offer request complete, were there any partial failures?

\
Logic error management:

1. All products in a create Offer or Confirm Offer request should be confirmed individually (not just package, or package status).\
   An erroneous Offer will return a "null" response for the object.\
   \
   Example:\
   Create Offer request

   <figure><img src="/files/t2yLHfqTDhUm5PaAn8Pq" alt=""><figcaption><p>a create offer request and components of the response</p></figcaption></figure>

   **Ensure there is no error field in response (flag if there is, may be a miss-offer or partial offer)**\
   **Other Offer stage errors include "no policy available for these parameters" etc.**<br>
2. Confirm offer request items should be confirmed similarly\
   Example, basic elements present, first quote id sent also present

   <figure><img src="/files/xSaS98pVDiXjX9xUXMKz" alt=""><figcaption><p>A confirm offer request and part of the response</p></figcaption></figure>
3. Confirm Offer request shouldn't have errors, mismatched values, or null quote responses

In the below example, the Offer confirmation failed due to a validation error.

<figure><img src="/files/3ttVVOkNftFsQF7X29jS" alt=""><figcaption><p>A Confirm Offer response showing a validation error</p></figcaption></figure>

Understanding and monitoring for these response variations and errors will greatly reduce misaligned bookings and improve customer satisfaction.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://partner-docs.covergenius.com/offers/api/responses/error-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
