# End Points

**Xoxoday can support varying API designs with few restrictions.**

* Should be REST APIs.
* Content-type should be JSON.
* Should be HTTPS&#x20;

> **Use the above API Skeletons to design your APIs.**

## **Fetch Redemption Point Balance**

Xoxoday will use this API to fetch a user’s points from your point system.

{% tabs %}
{% tab title="Request" %}

```
{
"unique_id":"DB123",
"auth_token":"0fe121f67cb0b90ef39fd83380bf1e12310912c86f4d7d5bfed3f3198e531b4f8d8af179b68361da28d0bc0353ce45ac7c374aa9c51dfb54c6705571f5ab8fe8"
}
```

{% endtab %}

{% tab title="Response" %}

#### **`200: Success`**

```
{ 
   "status":"1",
   "points_info":{ 
      "points_received":"2000",
      "points_redeemed":"1300",
      "points_available":"700"
   }
}

```

{% endtab %}
{% endtabs %}

## **GetProfileAPI**

The GetProfileAPI is used to verify account information and prevent fraud at the time of checkout. This API provides a second layer of account verification before the reward is sent, ensuring a seamless and secure customer experience. The API has to be built by the client so Xoxoday can consume it.

{% tabs %}
{% tab title="Request" %}

```
{
    "api_key": "5c720ad8bae86480c01abc0b3734dcfc9sndbjasbdjhabsjdbae",
    "employee_id": "22816281"
}
```

{% endtab %}

{% tab title="Response" %}

```
{
    "status": 1,
    "message": "Successfully loaded employee's data",
    "employee_data": {
        "employee_id": "22816281",
        "company_email_id": "dwightschrute@dundlermifflin.com",*
            "first_name": "Dwight",*
            "last_name": "Schrute",*
            "primary_mobile_number": "",
        "designation_name": "Assistant Regional Manager",
        "department": "Sales",
        "group_company": "Dundler Mifflin"
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
“\***”** indicates the parameter is mandatory.
{% endhint %}

### Parameters

{% tabs %}
{% tab title="Request" %}
**`Body Parameters`**

| Property     | Description                                                                                                                                                                   |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| api\_key     | api\_key you’ll share with Xoxoday in <https://help.xoxoday.com/plum/developer-resources/storefront-integration/api-endpoints/sso-redirection#sso-token-from-company-session> |
| employee\_id | Employee ID or the UID of the end user                                                                                                                                        |
| {% endtab %} |                                                                                                                                                                               |

{% tab title="Response" %}
**`Body Parameters`**

| Property                               | Description                            |
| -------------------------------------- | -------------------------------------- |
| status                                 | 1 = successful 0 = failure             |
| employee\_data.employee\_id            | Employee ID or the UID of the end user |
| employee\_data.company\_email\_id      | Email address of the end user          |
| employee\_data.last\_name              | Last name of the end user              |
| employee\_data.primary\_mobile\_number | Mobile number of the end user          |
| employee\_data.designation\_name       | Designation of the end user            |
| employee\_data.department              | Department of the end user             |
| employee\_data.group\_company          | Name of the company                    |
| {% endtab %}                           |                                        |
| {% endtabs %}                          |                                        |

## **Update Redemption Transaction**

Xoxoday will use this API to update a user’s points in your point system.

{% tabs %}
{% tab title="Request" %}

```
{ 
"unique_id":"TTEO32S99ERCL",
"auth_token":"0fe121f67cb0b90ef39fd83380bf1e12310912c86f4d7d5bfed3f3198e531b4f8d8af179b68361da28d0bc0353ce45ac7c374aa9c51dfb54c6705571f5ab8fe8",
"total_points_redeemed":"129",
"total_points_added":null,
"order_id": "AB1890082790",
"comments": ""
}
```

{% endtab %}

{% tab title="Response" %}

#### **`200: Success`**

```
{ 
   "status":"1",
   "message":"Successfully updated"
}
```

{% hint style="info" %}
**`This is just a sample response, it can vary according to your API design.`**
{% endhint %}
{% endtab %}
{% endtabs %}

## Refund API

{% tabs %}
{% tab title="Request" %}
{

"unique\_id" : "TTE032S99ERCL",

"auth\_token" : "0fe121f67cb0b90ef39fd83380bf1e12310912c86f4d7d5bfed3f3198e531b4f8d8af179b68361da28d0bc0353ce45ac7c374aa9c51dfb54c6705571f5ab8fe8",

"transactionid" : "AB1890082790",

"redemption\_amount" : "200",

"comments" : "",\
}
{% endtab %}

{% tab title="Response" %}
{

"status":"1",

\
"message": "Successfully updated"\
"data" : {\
"transaction\_id" : "",\
"points" : ''"\
}\
}
{% endtab %}
{% endtabs %}

## **`Parameters`**

{% tabs %}
{% tab title="Request" %}

#### `Body Parameters`

| **`Parameters`**         | Type | Description                                                                                                                                                            |
| ------------------------ | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `unique_id*`             |      | `Unique identifier of a user`                                                                                                                                          |
| `auth_token*`            |      | `Some authorization value to successfully allow the request from xoxoday to your system. Authorization can be but not limited to hash, Basic auth, Bearer token, etc.` |
| `total_points_redeemed*` |      |                                                                                                                                                                        |
| `total_points_added*`    |      |                                                                                                                                                                        |

{% hint style="success" %}
**`Key name can be different, there’s no restriction.`**
{% endhint %}
{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}
