# Create Credits

{% hint style="info" %}

#### Must have the authorization to use this API

{% endhint %}

## Credit will be added to the specified users name

<mark style="color:green;">`POST`</mark> `https://example.com/wp-json/rimplenet/v1/credits`

#### Request Body

| Name                                           | Type   | Description                              |
| ---------------------------------------------- | ------ | ---------------------------------------- |
| wallet\_id<mark style="color:red;">\*</mark>   | String | Id of wallet about to be funded          |
| amount<mark style="color:red;">\*</mark>       | int    | Enter desired amount                     |
| request\_id <mark style="color:red;">\*</mark> | any    | A unique identifier for this transaction |
| user\_id <mark style="color:red;">\*</mark>    | int    | id of user to be credited                |
| note                                           | String | Add some note                            |

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

```php
{
    "status_code": 200,
    "status": true,
    "message": "Transaction Completed",
    "data": {
        "transaction_id": 457,
        "user_id": 163
    }
}
```

{% endtab %}

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

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

{% endtab %}

{% tab title="404: Not Found Invalid user credentials " %}

```php
{
    "status_code": 404,
    "status": false,
    "message": "Invalid User credentials",
    "error": [
        "Unable to reach 800"
    ]
}
```

{% endtab %}

{% tab title="409: Conflict Transaction already exists " %}

```php
{
    "status_code": 409,
    "status": false,
    "message": "Transaction already exists",
    "error": {
        "txn_id": "456",
        "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" %}

```php
// Some code
```

{% endtab %}

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

```php
{
    "status_code": 400,
    "status": false,
    "message": "invalid input",
    "error": {
        "request_id": "Field Cannot be empty",
        "amount": "Field Cannot be empty"
    }
}
```

{% endtab %}

{% tab title="404 NOT FOUND" %}

```php
{
    "status_code": 404,
    "status": false,
    "message": "Invalid User credentials",
    "error": [
        "Unable to reach 800"
    ]
}
```

{% endtab %}

{% tab title="409 CONFLICT" %}

```php
{
    "status_code": 409,
    "status": false,
    "message": "Transaction already exists",
    "error": {
        "txn_id": "456",
        "exist": "Transaction already executed"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rimplenet.gitbook.io/rimplenet/api-reference/credit/create-credits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
