# converting tokens to site credit


## Converting Tokens to Site Credit

<small class="badge badge-darkred">requires authentication</small>

Use this end point to converting tokens to site credit

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/redemption" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"tokens":3}'

```


> Example response (200):

```json
{
    "message": "Tokens to site credit converted successfully!",
    "data": {
        "fantasy_spin_contests": [
            {
                "fantasy_spin_contest_id": 29,
                "fantasy_spin_blueprint_id": 21,
                "name": "NBA 01\/25 Thu",
                "closes_at_utc": "2024-01-26 00:00:00",
                "spins": 10,
                "locks": 6,
                "my_entries": 1,
                "max_entries": 100,
                "currency_type": 20,
                "entry": 100,
                "prize_pool": 200,
                "first_pays": 200
            }
        ]
    }
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "tokens": [
            "The tokens field is invalid."
        ]
    }
}
```
<div id="execution-results-POSTredemption" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTredemption"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTredemption"></code></pre>
</div>
<div id="execution-error-POSTredemption" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTredemption"></code></pre>
</div>
<form id="form-POSTredemption" data-method="POST" data-path="redemption" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTredemption', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-POSTredemption" onclick="tryItOut('POSTredemption');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTredemption" onclick="cancelTryOut('POSTredemption');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTredemption" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>redemption</code></b>
</p>
<p>
<label id="auth-POSTredemption" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="POSTredemption" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>tokens</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="tokens" data-endpoint="POSTredemption" data-component="body" required  hidden>
<br>
tokens. Ex: 5000
</p>

</form>



