# Amount Converter

{% hint style="info" %}
**You must have the Authorization to use this API**
{% endhint %}

## &#x20;Amount converter

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/wp-json/rimplenet-wallet-addon/v1/amount-converter`

#### Request Body

| Name                                                  | Type   | Description                      |
| ----------------------------------------------------- | ------ | -------------------------------- |
| amount\_to\_convert<mark style="color:red;">\*</mark> | int    | Enter the amount to be converted |
| conversion\_rate<mark style="color:red;">\*</mark>    | int    | Conversion rate                  |
| wallet\_from<mark style="color:red;">\*</mark>        | String | Wallet address  of user          |

{% tabs %}
{% tab title="200: OK successful amount conversion" %}

```json
{
    "status_code": 200,
    "status": true,
    "message": "Amount conversion",
    "data": {
        "converted_amount": 3000
    },
    "submitted": {
        "rate": 600,
        "amount": "5",
        "wallet_to": "usd",
        "wallet_from": "ngn"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "status_code": 400,
    "status": false,
    "message": "invalid input",
    "error": {
        "wallet_to": "Field Cannot be empty"
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
To view request params, click on the arrow (>) at the right-hand side of the endpoint URL to expand or collapse
{% endhint %}

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "status_code": 200,
    "status": true,
    "message": "Amount conversion",
    "data": {
        "converted_amount": 3000
    },
    "submitted": {
        "rate": 600,
        "amount": "5",
        "wallet_to": "usd",
        "wallet_from": "ngn"
    }
}
```

{% endtab %}

{% tab title="400 BAD REQUEST" %}

```json
{
    "status_code": 400,
    "status": false,
    "message": "invalid input",
    "error": {
        "wallet_to": "Field Cannot be empty"
    }
}
```

{% endtab %}
{% endtabs %}

**Amount Converter Multi Live**

## Amount Converter Multi Live

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/wp-json/rimplenet-wallet-addon/v1/amount-converter-multi`

#### Request Body

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| conversions | String |             |
| wallet\_to  | String |             |

{% tabs %}
{% tab title="200: OK successful amount conversion" %}

```json
{
    "status_code": 200,
    "status": true,
    "message": "Amount Conversion",
    "data": {
        "converted_amount": {
            "usd": 32000,
            "btc": 630,
            "eth": 2700
        }
    },
    "submitted": {
        "rate": {
            "usd": {
                "amount": 40,
                "rate": 800
            },
            "btc": {
                "amount": 90,
                "rate": 7
            },
            "eth": {
                "amount": 4,
                "rate": 675
            }
        },
        "wallet_to": "ngn"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid amount conversion" %}

```json
{
    "status_code": 400,
    "status": false,
    "message": "",
    "error": {
        "usd": {
            "msg_amount": "invalid_amount_conversion",
            "amount": -40
        },
        "btc": {
            "msg_rate": "invalid_conversion_rate",
            "rate": -7
        }
    },
    "submitted": {
        "rate": {
            "usd": {
                "amount": -40,
                "rate": 800
            },
            "btc": {
                "amount": 0,
                "rate": -7
            },
            "eth": {
                "amount": 4,
                "rate": 675
            }
        },
        "wallet_to": "ngn"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid input" %}

```json
{
    "status_code": 400,
    "status": false,
    "message": "invalid input",
    "error": {
        "rate": "Field Cannot be empty"
    },
    "submitted": {
        "rate": null,
        "wallet_to": "ngn"
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
To view request params, click on the arrow (>) at the right-hand side of the endpoint URL to expand or collapse
{% endhint %}

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "status_code": 200,
    "status": true,
    "message": "Amount Conversion",
    "data": {
        "converted_amount": {
            "usd": 32000,
            "btc": 630,
            "eth": 2700
        }
    },
    "submitted": {
        "rate": {
            "usd": {
                "amount": 40,
                "rate": 800
            },
            "btc": {
                "amount": 90,
                "rate": 7
            },
            "eth": {
                "amount": 4,
                "rate": 675
            }
        },
        "wallet_to": "ngn"
    }
}
```

{% endtab %}

{% tab title="400 BAD REQUEST" %}

```json
{
    "status_code": 400,
    "status": false,
    "message": "",
    "error": {
        "usd": {
            "msg_amount": "invalid_amount_conversion",
            "amount": -40
        },
        "btc": {
            "msg_rate": "invalid_conversion_rate",
            "rate": -7
        }
    },
    "submitted": {
        "rate": {
            "usd": {
                "amount": -40,
                "rate": 800
            },
            "btc": {
                "amount": 0,
                "rate": -7
            },
            "eth": {
                "amount": 4,
                "rate": 675
            }
        },
        "wallet_to": "ngn"
    }
}
```

{% endtab %}

{% tab title="400 BAD REQUEST" %}

```json
{
    "status_code": 400,
    "status": false,
    "message": "invalid input",
    "error": {
        "rate": "Field Cannot be empty"
    },
    "submitted": {
        "rate": null,
        "wallet_to": "ngn"
    }
}
```

{% endtab %}
{% endtabs %}
