# Payments


## Deposit URL

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

Use this end point to get the deposit URL

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/payments/deposit-url?amount=7" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "Deposit URL",
    "data": {
        "deposit_url": "https:\/\/ppp-test.safecharge.com\/ppp\/purchase.do?email=admin@bettorfantasy.com&merchant_id=1075880000455231537&merchant_site_id=232258&total_amount=100&currency=USD&user_token_id=BF_User_Id_1_Time_1653556700_UUID_5e444072-546d-4d21-9a77-c7a58d9a8909&item_name_1=Deposit_Amount_100_USD_BF_User_Id_1_Time_1653556700_UUID_5e444072-546d-4d21-9a77-c7a58d9a8909_Time_2022-05-30.05:30:47&item_amount_1=100&item_quantity_1=1&time_stamp=2022-05-30.05:30:47&version=4.0.0&notify_url=http:\/\/35.154.99.45\/bettorfantasy\/dfs\/bettor_webapi\/public\/payments\/deposit-dmn&country=US&merchant_unique_id=c552d1d2-b403-4a1c-9a6c-bff85fbdbc95_2022-05-30.05:30:47&checksum=d6b8320dc83f5bb916ccdbe137ef1390d026dc65bff605f1542b65459b254539"
    }
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "amount": [
            "The amount field is required."
        ]
    }
}
```
> Example response (400, Age Restrictions Apply):

```json

{
      "message": "Validations",
      "error_box": {
          "heading": "Age Restrictions Apply",
          "message": "You must be 21 or older to enter cash contests in Massachusetts",
          "cta": "Return",
          "color": "Blue",
          "cta_type": "Return",
      }
  }
```
> Example response (400, Deposit Limit Reached):

```json
{
    "message": "Validations",
    "error_box": {
        "heading": "Deposit Limit Reached",
        "message": "You are unable to take this action because of self exclusion restrictions placed on this account.",
        "cta": "Return",
        "color": "Blue",
        "cta_type": "Return"
    }
}
```
<div id="execution-results-GETpayments-deposit-url" hidden>
    <blockquote>Received response<span id="execution-response-status-GETpayments-deposit-url"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETpayments-deposit-url"></code></pre>
</div>
<div id="execution-error-GETpayments-deposit-url" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETpayments-deposit-url"></code></pre>
</div>
<form id="form-GETpayments-deposit-url" data-method="GET" data-path="payments/deposit-url" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETpayments-deposit-url', 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-GETpayments-deposit-url" onclick="tryItOut('GETpayments-deposit-url');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETpayments-deposit-url" onclick="cancelTryOut('GETpayments-deposit-url');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETpayments-deposit-url" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>payments/deposit-url</code></b>
</p>
<p>
<label id="auth-GETpayments-deposit-url" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETpayments-deposit-url" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
<p>
<b><code>amount</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="amount" data-endpoint="GETpayments-deposit-url" data-component="query" required  hidden>
<br>
Deposit Amount. Ex: 100
</p>
</form>


## Withdrawal URL

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

Use this end point to get the withdrawal URL

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/payments/withdrawal-url?amount=6" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "Withdrawal URL",
    "data": {
        "withdrawal_url": "https:\/\/ppp-test.safecharge.com\/ppp\/withdrawal\/withdraw.do?merchant_id=1075880000455231537&merchant_site_id=232258&user_token=auto&wd_amount=100&wd_currency=USD&country=US&wd_open_amount=False&user_token_id=BF_User_Id_1_Time_1653556700_UUID_5e444072-546d-4d21-9a77-c7a58d9a8909&timeStamp=20220601062123&merchant_unique_id=2c4dc305-e6d8-4a1b-90fb-8b817c615f16_2022-06-01.06:21:23&version=4.0.0&successUrl=http:\/\/35.154.99.45\/bettorfantasy\/dfs\/bettor_webapi\/public\/payments\/withdrawal\/success&failUrl=http:\/\/35.154.99.45\/bettorfantasy\/dfs\/bettor_webapi\/public\/payments\/withdrawal\/error&backUrl=http:\/\/35.154.99.45\/bettorfantasy\/dfs\/bettor_webapi\/public\/payments\/withdrawal\/back&showCancelButton=0&checksum=26509287c7f1083cce9a6542e71b6cb870cd0c9bcc1757920ab3c1e04ac58ff2"
    }
}
```
> Example response (422):

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


## Summary

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

Use this end point to get the summary of transactions

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/payments/summary" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "Transactions Summary",
    "data": {
        "all_time_win_loss": "0.00",
        "year_wise": [
            {
                "year": 2022,
                "total_buy_ins": "0.00",
                "total_winnings": "0.00",
                "win_loss": "0.00"
            }
        ]
    }
}
```
<div id="execution-results-GETpayments-summary" hidden>
    <blockquote>Received response<span id="execution-response-status-GETpayments-summary"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETpayments-summary"></code></pre>
</div>
<div id="execution-error-GETpayments-summary" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETpayments-summary"></code></pre>
</div>
<form id="form-GETpayments-summary" data-method="GET" data-path="payments/summary" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETpayments-summary', 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-GETpayments-summary" onclick="tryItOut('GETpayments-summary');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETpayments-summary" onclick="cancelTryOut('GETpayments-summary');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETpayments-summary" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>payments/summary</code></b>
</p>
<p>
<label id="auth-GETpayments-summary" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETpayments-summary" data-component="header"></label>
</p>
</form>



