# Welcome!

## Welcome to OzuraPay API

Welcome to our API documentation! Here you'll find all the documentation you need to create and manage crypto payments using our managed platform.

## Want to jump right in?

Feeling like an eager beaver? Jump in to the quick start docs and get making your first request:

{% content-ref url="/pages/T8NSLnpNVVz1kieSOIWj" %}
[Quick Start](/quick-start)
{% endcontent-ref %}

## Want to deep dive?

Dive a little deeper and start exploring our API reference to get an idea of everything that's possible with the API:

{% content-ref url="/pages/Jc3FtiX9AOVzRfsKKpap" %}
[API Reference](/reference/api-reference)
{% endcontent-ref %}


# Quick Start

{% hint style="info" %}
**Good to know:** A quick start guide can be good to help folks get up and running with your API in a few steps. Some people prefer diving in with the basics rather than meticulously reading every page of documentation!
{% endhint %}

## Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can generate an API key from your Dashboard at any time, at dashboard.ozurapay.com


# API Reference

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Auth

Get keys to begin exploring the api.

{% content-ref url="/pages/cZF43fvM5UJb6AkQ86EC" %}
[Get Bearer Token](/reference/api-reference/get-bearer-token)
{% endcontent-ref %}

## Users

Everything related to users:

{% content-ref url="/pages/cZF43fvM5UJb6AkQ86EC" %}
[Get Bearer Token](/reference/api-reference/get-bearer-token)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Using the 'Page Link' block lets you link directly to a page. If this page's name, URL or parent location changes, the reference will be kept up to date. You can also mention a page – like [Get Bearer Token](/reference/api-reference/get-bearer-token) – if you don't want a block-level link.
{% endhint %}


# Get Bearer Token

## Creating a bearer token

## Create login request.

<mark style="color:green;">`POST`</mark> `https://api.ozurapay.com/users/login`

Creates a new login request and sends back bearer token.

#### Request Body

| Name                                    | Type   | Description                     |
| --------------------------------------- | ------ | ------------------------------- |
| email<mark style="color:red;">\*</mark> | string | Email of registered merchant    |
| password                                | string | Password of registered merchant |

{% tabs %}
{% tab title="200 Login successfully created" %}

```javascript
{
    "data": {
        "id": "65bfff25068dk9f931f207a3",
        "name": "Joe Doe",
        "email": "jdoe@ozurapay.com",
        "role": "merchant",
        "depositAddress": "0x1L003ec923869bcEA550226A2a110b2337bEe0c2",
        "token": "eyJmaFciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1YmZmZjI1MDY4ZGQzZjkzMWYyMDdhMyIsIm5hbWUiOiJZdWdlbiBDaG9rc2hpIiwiZW1haWwiOiJ5dWdlbkBvenVyYXBheS5jb20iLCJyb2xlIjoibWVyY2hhbnQiLCJkZXBvc2l0QWRkcmVzcyI6IjB4MUY4MDNlYzkyMzg2OWJjRUE1NTAyMjZBMmExMTBiMjMzN2JFZTBjMiIsImlhdCI6MTcyMDc1OTE4MSwiZXhwIjoxNzIxNjIzMTgxfQ.3Y_aD8mZe-JNW4fSXmV3_5ZXc4n2Tp0dNzHvjiun2IY"
    },
    "code": 200,
    "message": "Success Login"
}

```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** You can either create your account using dashboard.ozurapay.com or use below API.
{% endhint %}

## Creating a user


# Creating a user

## Creating a merchant account

## Create sign up request.

<mark style="color:green;">`POST`</mark> `https://api.ozurapay.com/users/register-merchant`

Creates a new merchant registration and sends back bearer token.

#### Request Body

| Name                                    | Type   | Description                      |
| --------------------------------------- | ------ | -------------------------------- |
| email<mark style="color:red;">\*</mark> | string | Email of new merchant account    |
| password                                | string | Password of new merchant account |
| name                                    | string | Name of account holder           |
| phoneNo                                 | string | Business phone number            |
| businessName                            | string | Entity name                      |
| website                                 | string | Business site                    |

{% tabs %}
{% tab title="200 Login successfully created" %}

```javascript
{
    "data": {
        "id": "6690m187f80461a95af20f2c",
        "name": "John Doe",
        "email": "jdoe@ozurapay.com",
        "role": "merchant",
        "token": "eyPnoGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2OTBiNDg3ZjgwNDYxYTk1YWYyMGYyYyIsIm5hbWUiOiJkYmZkZmcgYmRmYmRmYiIsImVtYWlsIjoieXVnZXNuQG96dXJhcGF5LmNvbSIsInJvbGUiOiJtZXJjaGFudCIsImlhdCI6MTcyMDc1OTQzMiwiZXhwIjoxNzIxNjIzNDMyfQ.ol_qh3zXr-uGmBzgZmS8A5yN-SxLtXlijFEsjOdgYew",
        "depositAddress": "0xM99220EE1496A532eBdF7c7A4D40cbAD8C8D0BCF"
    },
    "code": 200,
    "message": "Merchant successfully registered"
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** You can either create your account using dashboard.ozurapay.com or use above API.
{% endhint %}

## Creating a payment widget


# Creating a payment widget

## Creating a payment widget

## Create sign up request.

<mark style="color:green;">`POST`</mark> `https://api.ozurapay.com/widget`

Creates a new payment widget, use the widget ID to append to the widget URL.

#### Request Body

| Name                   | Type   | Description                    |
| ---------------------- | ------ | ------------------------------ |
| productName            | string | Name of the product            |
| productPrice           | string | Price in US Dollar             |
| merchantProcessingFees | string | Processing fee in percentage   |
| imageUrl               | string | PNG or JPG URL for the product |

{% tabs %}
{% tab title="200 Login successfully created" %}

```javascript
{
    "data": {
        "productName": "Apple",
        "productPrice": 1,
        "merchantId": "65bxxx25068dd3f931f207a3",
        "merchantProcessingFees": 1,
        "imageUrl": "https://image.com/apple.png",
        "_id": "6699989f80461a95af2101c",
        "__v": 0
    },
    "code": 201,
    "message": "Widget successfully created"
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** You can use "\_id" and append it to the widget URL, .i.e. <https://widget.ozurapay.com/?widget=6699989f80461a95af2101c>
{% endhint %}

## Widget payment status


# Check payment status

## Get payment status on your widget

## Create request via widget ID

<mark style="color:green;">`GET`</mark> `https://api.ozurapay.com/payment/$_id`

Use the widget ID found in the URL or the response from POST request when you created the widget URL.

#### Request Body

| None |
| ---- |
|      |

{% tabs %}
{% tab title="200 Login successfully created" %}

```javascript
{
    "_id": "65bfb527b07c8d56d18e8fe9",
    "merchantId": "65bf64848a620918e01d5938",
    "productName": "Ozura Fest",
    "quantity": 1,
    "amountInUSD": 2021800,
    "expiration": "2024-02-04T16:12:47.351Z",
    "amountInETH": 878409495755237.2,
    "status": "PENDING",
    "completedAt": null,
    "transactionHash": null,
    "vaultId": "36",
    "depositAddress": "0x830CAEBcab3f45879d0909283ADe11a6b868B041",
    "name": "Test",
    "email": "test@test.com",
    "widgetId": "65bfb48f68315980381c128d",
    "merchantProcessingFees": 1,
    "ozuraProcessingFees": 0.09,
    "__v": 0
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** You can use "\_id" and append it to the widget URL, .i.e. <https://widget.ozurapay.com/?widget=6699989f80461a95af2101c>
{% endhint %}

## Check your balance


# Check your earnings

## Check your crypto holdings in dollars and native crypto currency

## Create a get balance request.

<mark style="color:green;">`GET`</mark> `https://api.ozurapay.com/GetMerchantBalance`

Creates a new payment widget, use the widget ID to append to the widget URL.

#### Request Body

| None |
| ---- |
| None |

{% tabs %}
{% tab title="200 Login successfully created" %}

```javascript
{"ethBalance":605813858374725.5,
"usdtBalance":0}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** Make sure you're logged in with bearer or your Auth 2.0 token.
{% endhint %}

## Widget payment status


# Withdraw your crypto

## Withdraw crypto to your desired address

## Create a request to get your earnings out of our dashboard

<mark style="color:green;">`POST`</mark> `https://api.ozurapay.com/requestWithdrawal`

Gather a desire ERC20 wallet address, from providers like Metamask.

#### Request Body

| Name    | Type    | Description                                    |
| ------- | ------- | ---------------------------------------------- |
| amount  | integer | The amount of crypto desired divided by 10000. |
| token   | string  | Symbol such as "ETH" or any specified currency |
| address | string  | The desired receipient address                 |

{% tabs %}
{% tab title="200 Login successfully created" %}

```javascript
{
"Transaction Id": "0xfcf94eb805d024ad46698f42ee77ed70d62ae1be2eca78bc2730c301c581d88b"
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** You can setup a wallet using metamask.
{% endhint %}


