# External Debit

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

## Create

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

#### Request Body

| Name                                          | Type | Description      |
| --------------------------------------------- | ---- | ---------------- |
| request\_id<mark style="color:red;">\*</mark> | int  | Enter request id |
| wallet\_id<mark style="color:red;">\*</mark>  | int  | Enter wallet id  |
| amount<mark style="color:red;">\*</mark>      | int  | Enter the amount |
| user\_id<mark style="color:red;">\*</mark>    | int  | Enetr user id    |
| deductions<mark style="color:red;">\*</mark>  | int  | Amount deducted  |

{% tabs %}
{% tab title="200: OK Transaction Completed" %}

```json
{
    "status_code": 200,
    "status": true,
    "message": "Transaction Completed",
    "data": [
        {
            "transaction_id": 287,
            "user_id": "1"
        },
        {
            "deductions_submitted": {
                "usd": {
                    "tax": 94
                }
            },
            "deductions_wallet_id": "usd",
            "total_deductions_usd": 94,
            "total": 10,
            "deductions_txn_id_usd": "SELF_DEDUCTED",
            "record": 288
        }
    ]
}
```

{% endtab %}

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

```json
{
    "status_code": 400,
    "status": false,
    "message": "Insufficient balance",
    "error": {
        "ngn": "Insufficient balance in ngn"
    }
}
```

{% endtab %}

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

```json
{
    "status_code": 400,
    "status": false,
    "message": "invalid input",
    "error": {
        "user_id": "user_id cannot be zero",
        "amount": "Field Cannot be empty"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Transaction already exists " %}

```json
{
    "status_code": 400,
    "status": false,
    "message": "409",
    "error": {
        "txn_id": "283",
        "exist": "Transaction already executed"
    }
}
```

{% 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": "Transaction Completed",
    "data": [
        {
            "transaction_id": 287,
            "user_id": "1"
        },
        {
            "deductions_submitted": {
                "usd": {
                    "tax": 94
                }
            },
            "deductions_wallet_id": "usd",
            "total_deductions_usd": 94,
            "total": 10,
            "deductions_txn_id_usd": "SELF_DEDUCTED",
            "record": 288
        }
    ]
}
```

{% endtab %}

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

```json
{
    "status_code": 400,
    "status": false,
    "message": "Insufficient balance",
    "error": {
        "ngn": "Insufficient balance in ngn"
    }
}
```

{% endtab %}

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

```json
{
    "status_code": 400,
    "status": false,
    "message": "invalid input",
    "error": {
        "user_id": "user_id cannot be zero",
        "amount": "Field Cannot be empty"
    }
}
```

{% endtab %}

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

```json
{
    "status_code": 400,
    "status": false,
    "message": "409",
    "error": {
        "txn_id": "283",
        "exist": "Transaction already executed"
    }
}
```

{% endtab %}
{% endtabs %}
