# Requests

Initiating a WebSocket stream with cashout amounts (identical to those for our other feeds)

{% content-ref url="/pages/CDyqERePHyDhrua9zyke" %}
[Cashout API](/odds88-client-api/odds88-api-endpoints/cashout-api.md)
{% endcontent-ref %}

Subscribe/unsubscribe requests:

```javascript
{
    betIds: ["id1","id2"]
}
```

Success response: code 200, no body<br>

Cashout request:

```javascript
{
    betId: "id1",
    priceChange: 1,
    amount: {
          localAmount: 40000,
          precision: 4,
          currency: "USD",
    }
}
```

When sending a cashout request make sure the currency you send is the same as the one you used to place a bet.

**PriceChange** field affects whether the odds changes that happened (odds change will affect the cashout amount) will be ignored, or block the cashout request. If you leave it as 1, it means any cashout amount changes will be a blocker and request will be rejected (if changes are above a threshold of 2%). For these changes to be detected we require you to send us the last cashout amount you received from us (the one you show to the user), which we compare with the latest cashout amount on our side. If you set **PriceChange** to 2, it will ignore any odds changes and won't reject cashout requests even if the amount was changed drastically in a short period of time.\
**Example:** Current odds are 2.0 and the player placed a bet of 100$. Now, for example, he is allowed to cashout 90$.\
You get this value from the feed and send a cashout request with it to us. By the time your request reaches us, the odds change not in the favour of the player (or vice versa) and the cashout amount is now 85$. \
We calculate the difference between 85 and 90 and check if it is under a certain threshold. If you sent us PriceChange 2 then we ignore any difference and odds and proceed with cashing out 85, as it was the actual latest value on our side. If PriceChange: 1 and the difference exceeds 2% then we reject the request.<br>

Success response:

```javascript
{
    success: true,
    reason: null,
    payload: {
        localAmount: 40000,
        betId: "id1",
    }
}
```

Rejection response:

```javascript
{
    Success: false,
    Reason: "Reason why cashout can not be made"
    Payload: {
        LocalAmount: 40000,
        BetId: "id1",
    }
}
```

<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.odds88.io/integration-process/recommended-integration-flow/optional-features/cashout-integration/requests.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.
