2. USER
Module: user
User
Bases: MEBase
A factory for a User class.
This class provides methods to interact with user information in the MelhorEnvio API.
| METHOD | DESCRIPTION |
|---|---|
me |
Returns the current user information. |
addresses |
List of addresses of the current user account. |
balance |
Returns the balance of the current user. |
insert_balance |
Inserts a new balance for a given gateway. |
me() -> dict
Returns the current user information .
Usage:
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A dictionary containing user information.
TYPE:
|
Source code in melhorenvio/resources/user.py
addresses() -> dict
List of addresses of current user account .
This method retrieves a list of addresses associated with the current user account in the MelhorEnvio API.
Usage:
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A dictionary containing a list of user addresses.
TYPE:
|
Source code in melhorenvio/resources/user.py
balance() -> dict
Returns the balance of the current user .
This method retrieves the balance of the current user's account in the MelhorEnvio API.
Usage:
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A dictionary containing the user's balance information.
TYPE:
|
Source code in melhorenvio/resources/user.py
insert_balance(gateway: str, value: str) -> dict
Inserts a new balance for a given gateway .
This method allows you to insert a new balance for a specific gateway in the user's account in the MelhorEnvio API.
Usage:
>>> gateway = "example_gateway"
>>> value = "100.00"
>>> sdk.user().insert_balance(gateway=gateway, value=value)
| PARAMETER | DESCRIPTION |
|---|---|
gateway |
The gateway for which you want to insert the balance.
TYPE:
|
value |
The value of the balance to be inserted.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
A dictionary containing information about the inserted balance.
TYPE:
|