# Update Decision

**Endpoint:** <mark style="color:purple;">`PUT /v1/risk/{transaction_id}`</mark>

**Headers**

```
Content-Type: application/json
x-api-key: <YOUR_API_KEY>
```

{% tabs %}
{% tab title="Attributes of the request" %}
This request is used when a transaction is pending for a review, and the customer need to update the information to approve the transaction, it has the following attributes

**transaction\_info** *{object}*

> Required: true
>
> Represents the information details of the request in a JSON object. The object has the following attributes:
>
> * **type**: string\
>   Type value represent the type of request that is sent.
>
>   Example: “authorization”
>
>   *Required*: true

**action\_info** *{object}*

> Required: true\
> Represents the action information object, that has the attributes:
>
> * **decision\_id**: string
>
>   Example: “8475986574758978745”
>
>   Required: true
>
>   The unique identifier of the decision.
> * **decision**: string
>
>   Example: “Accept”
>
>   Required: true
>
>   The decision value that will be updated.
> * **comments**: string
>
>   Example: 01/27
>
>   Required: false
>
>   An additional comment if need it.**number:** *int*\
>   Represents a Luhm compliant credit card value.\
>   Example: "4242424242424242"\
>   \&#xNAN;*Required: true*
>   {% endtab %}

{% tab title="Attributes of the response" %}

* **status**: string\
  The status is a string result that only has three possible values. "Success", "Fail" or “error”.
* **message**: string\
  The message value represents a short description about the status received.
* **data**: {object}\
  The data variable represents the information expected from the request made. This contains the payment information and the decision of the transaction
  {% endtab %}
  {% endtabs %}

### **Request**

#### **Path Parameters**

<table><thead><tr><th width="167.47265625">Parameter</th><th width="108.40625">Type</th><th width="91.02734375">Required</th><th width="333.19921875">Description</th></tr></thead><tbody><tr><td><code>transaction_id</code></td><td>string</td><td>Yes</td><td>Transaction ID obtained from the create_decision endpoint</td></tr></tbody></table>

#### Request Body

```json
{
    "transaction_info": {
        "type": "update_decision",
        "reference_code": "123456789"
    },
    "action_info": {
        "decision_id": "0001751371880962364299",
        "decision": "ACCEPT",
        "comments": "This is a test comment"
    }
}
```

#### Parameters

<table><thead><tr><th width="308.984375">Field</th><th width="83.55078125">Type</th><th width="90.515625">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>transaction_info.type</code></td><td>string</td><td>Yes</td><td>Must be "update_decision"</td></tr><tr><td><code>transaction_info.reference_code</code></td><td>string</td><td>Yes</td><td>Original transaction reference code</td></tr><tr><td><code>action_info.decision_id</code></td><td>string</td><td>Yes</td><td>Decision ID to update</td></tr><tr><td><code>action_info.decision</code></td><td>string</td><td>Yes</td><td>New decision: "ACCEPT" or "REJECT"</td></tr><tr><td><code>action_info.comments</code></td><td>string</td><td>Optional</td><td>Comments about the decision</td></tr></tbody></table>

### Response

```json
{
    "status": "success",
    "message": "Action requested successfully",
    "data": {
        "transaction_info": {
            "type": "update_decision_response",
            "reference_code": "123456789",
            "transaction_id": "0001751371985314254833",
            "request_id": "7513718812276466904806",
            "status": "Accepted",
            "created_at": "2025-07-01T12:13:06.104277455Z"
        }
    }
}
```

### Usage Examples

cURL - Update Decision

```json
curl --location --request PUT 'https://api.firstoken.co/v1/risk/0001751371880962364299' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <YOUR_API_KEY>' \
--data '{
    "transaction_info": {
        "type": "update_decision",
        "reference_code": "123456789"
    },
    "action_info": {
        "decision_id": "0001751371880962364299",
        "decision": "ACCEPT",
        "comments": "Transaction approved after manual review"
    }
}'
```
