# Introduction

The purpose of this document is to provide a comprehensive guide to offer detailed insights into our API environments, and Authentication methods to be used at the time of integration.

<div class="w-full pt-2 md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent md:w-[calc(100%-.5rem)]" id="bkmrk-1.-environment%E2%80%8B-1.1."><div class="w-full pt-2 md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent md:w-[calc(100%-.5rem)]"><div class="w-full pt-2 md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent md:w-[calc(100%-.5rem)]"><form class="stretch mx-2 flex flex-row gap-3 last:mb-2 md:mx-4 md:last:mb-6 lg:mx-auto lg:max-w-2xl xl:max-w-3xl">### **1. Environment**[​](https://xprizo-doc.azurewebsites.net/docs/intro#environment "Direct link to heading")

#### **1.1. Testing (Sandbox)[​](https://xprizo-doc.azurewebsites.net/docs/intro#testing-sandbox "Direct link to heading")**

Before integrating with the live production system, you have the option to test features on our dedicated test server. Access sample data and simulated transactions to ensure a smooth and error-free integration process. Experiment with the functionalities in a controlled environment before deploying to the production system for a seamless experience.

**Base URL for Sandbox** [https://test.xprizo.com/api](https://test.xprizo.com/api)

#### **1.2 Production (Live)[​](https://xprizo-doc.azurewebsites.net/docs/intro#production-live "Direct link to heading")**

Once you have completed your testing phase, you can transition to the live environment by directing your system to the production server.

</form></div></div></div>**Base URL for Live** [https://wallet.xprizo.com/api](https://wallet.xprizo.com/api)

### **2. Authentication**

Xprizo employs JWT tokens and API keys as authentication methods for accessing API functions. You have the flexibility to choose either authentication method when interacting with the endpoints. You need to pass a JWT token or API key in the header of each request.

#### **2.1. JSON Web Tokens (JWT)[​](https://xprizo-doc.azurewebsites.net/docs/intro#json-wen-tokens-jwt "Direct link to heading")**

##### **2.1.1. Creating a Token[​](https://xprizo-doc.azurewebsites.net/docs/intro#creating-a-token "Direct link to heading")**

Creating a token is done by calling the GetToken endpoint with your username and password. If you are not a registered user you can register by going to the [Sandbox](https://test.xprizo.com) or [Live](https://wallet.xprizo.com/) server.**[​](https://xprizo-doc.azurewebsites.net/docs/api/security/#gettoken "Direct link to heading")**

Log in to the system using a username and password. You will receive back a JWT Bearer token that you will need to make secure API requests.

**Request:**

```bash
curl --location '{baseurl}/Security/GetToken' \
--header 'accept: text/plain; x-api-version=1.0' \
--header 'x-api-version: 1.0' \
--header 'Content-Type: application/json; x-api-version=1.0' \
--data-raw '{
  "userName": "use username, mobile number to email",
  "password": "your password"
}'
```

**Response:**

```JSON
{
  "id": <a unique Id>,
  "token": <use this token for furture calls>,
  "expires": <the time the token expires>
}

```

<div class="w-full pt-2 md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent md:w-[calc(100%-.5rem)]" id="bkmrk-"><div class="w-full pt-2 md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent md:w-[calc(100%-.5rem)]"><div class="w-full pt-2 md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent md:w-[calc(100%-.5rem)]"><div class="codeBlockContainer_Ckt0 theme-code-block" id="bkmrk--0"><div class="codeBlockContent_biex"><div class="buttonGroup__atx">  
</div></div></div></div></div></div>##### **2.1.2. Usages of Token**

Use this token in the header of all secure requests to other endpoint

```JSON
curl -X 'GET' \
  '{baseurl}/Wallet/Info?contact=1' \
  -H 'accept: text/plain' \
  -H 'Authorization: bearer <token>
```


#### **2.2. API Keys[​](https://xprizo-doc.azurewebsites.net/docs/intro#api-keys "Direct link to heading")**

##### **2.2.1. Creating an API Key**

To configure your API key, access your User Account, navigate to 'settings' by clicking the profile icon, and locate 'security' in the list. Within the security settings, you will find an option to set the API key. It's important to note that if the API key is removed, a new key must be issued and utilized for transactions.

![Screenshot 2024-01-22 213458.png](https://books.xprizo.com/uploads/images/gallery/2024-01/scaled-1680-/screenshot-2024-01-22-213458.png)

##### **2.2.2. Usages of API Key**

Use the API key in the header in the following way.

```text
curl --location --request GET '{baseurl}/Wallet/Info?contact={username/emailid/mobilenumber}&currencyCode={currencyCode}' \
--header 'Accept: text/plain; x-api-version=1.0' \
--header 'x-api-version: {apiversion}' \
--header 'x-api-key: {apikey}'
```

#### **2.3. Know your account ID**

To submit deposits for processing, you will need your accountId (wallet ID) from your account. You can find this by the following process, login to your account and open settings, find ‘wallet’ on the list and you will find an ID associated with the wallet of required currency. If a wallet doesn’t exist, you will be required to create one by clicking the ![Add.png](https://books.xprizo.com/uploads/images/gallery/2024-01/scaled-1680-/add.png) button.