# Rejected Handling

When a transaction is refused (REFUSED), an exception is created. Now a group will also be created, with status REFUSED.

{% hint style="info" %}
A transaction is refused when the incoming profile matches a profile in the database that is already involved in an exception
{% endhint %}

The refused exception group is now related to all exception groups responsible for the transaction refusal

When an exception group is handled, all refused exception groups that are linked to the handled exception group are analyzed. \
If all the exception groups that blocked the refused exception group are handled, the refused transaction will be sent again as a new transaction, according to the original operation (enroll or update)\
The new operation can generate its own exceptions, according to the flow of the chosen operation

This process is recorded in the operation log and the resend status and the new TGUID are stored in the originating refused exception group, being returned in `get/list exception groups` (status and new TGUID) and `get/list transaction` (only the new TGUID).

The process is executed in the LEADER API in a separate thread from regular handling.

### Prioritization

Regarding priority, when an exception or a group is prioritized/deprioritized, all related refused exception groups and dependent groups are as well.

A refused exception group will always wait for the exception groups that lock it, unless the REFUSED status is changed. The status can be changed to REMOVED which will cause it not to be resent automatically even if the blocking exception is handled. The status can be changed back so that it waits again for the handling of the exceptions.

The process is performed through the endpoint `Change refused status` .

<br>


---

# 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://docs.griaule.com/gbs/en/gbds-configuration/rejected-handling.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.
