> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# View User EMoney

The path parameters `Month` and `Year` are optional. If not given, this call returns all the credited and debited e-money since the user was created.

### Path parameters

<ParamField path="UserId" type="string" required>
  The unique identifier of the user.
</ParamField>

<ParamField path="Year" type="string">
  Format: "YYYY" (e.g., "2019")

  The year by which to filter the returned values.
</ParamField>

<ParamField path="Month" type="string">
  Format: “MM” (e.g., “03”)

  The month by which to filter the returned values.
</ParamField>

### Body parameters

<ParamField body="Currency" type="string">
  **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

  The currency of the wallets for which to return the values for credited and debited e-money.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200" defaultOpen>
    <ResponseField name="UserId" type="string">
      The unique identifier of the user.
    </ResponseField>

    <ResponseField name="CreditedEMoney" type="object">
      Information about the pay-ins and transfers credited to wallets owned by the user.

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the amount.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="DebitedEMoney" type="object">
      Information about the payouts debited from wallets owned by the user.

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the amount.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
      "UserId": "156671912",
      "CreditedEMoney": {
          "Currency": "EUR",
          "Amount": 2900
      },
      "DebitedEMoney": {
          "Currency": "EUR",
          "Amount": 1000
      }
  }  
  ```
</ResponseExample>

<RequestExample>
  ```php PHP theme={null}
  <?php 

  require_once 'vendor/autoload.php';

  use MangoPay\MangoPayApi;
  use MangoPay\Libraries\ResponseException as MGPResponseException;
  use MangoPay\Libraries\Exception as MGPException;

  $api = new MangoPayApi();

  $api->Config->ClientId = 'your-client-id';
  $api->Config->ClientPassword = 'your-api-key';
  $api->Config->TemporaryFolder = 'tmp/';

  try {
      $userId ='146476890';
      $year = 2023;
      $month = 6;

      $response = $api->Users->GetEMoney($userId, $year, $month);

      print_r($response);
  } catch(MGPResponseException $e) {
      print_r($e);
  } catch(MGPException $e) {
      print_r($e);
  }  
  ```

  ```javascript NodeJS   theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk')
  const mangopay = new mangopayInstance({
      clientId: 'your-client-id',
      clientApiKey: 'your-api-key',
  })

  let myUser = {
    Id: '146476890',
  }

  // timeframe is optional, if not given, returns all the credited and debited e-money since the user was created.
  let timeframe = {
    Year: '2023',
    Month: '04',
  }

  const viewClientWallet = async (userId, year, month) => {
    return await mangopay.Users.getEMoney(userId, year, month)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  viewClientWallet(myUser.Id, timeframe.Year, timeframe.Month)  
  ```

  ```ruby Ruby   theme={null}
  require 'mangopay'

  MangoPay.configure do |client|
      client.preproduction = true
      client.client_id = 'your-client-id'
      client.client_apiKey = 'your-api-key'
      client.log_file = File.join(Dir.pwd, 'mangopay.log')
  end

  def viewUserEmoney(userId, year, month)
      begin
          response = MangoPay::User.emoney(userId, year, month)
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to fetch emoney: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myUser = {
      Id: '194338122'
  }

  # timeframe is optional, if not given, returns all the credited and debited e-money since the user was created.
  timeFrame = {
      year: 2023,
      month: 06
  }

  viewUserEmoney(myUser[:Id], timeFrame[:year], timeFrame[:month])  
  ```

  ```java Java   theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.core.Money;
  import com.mangopay.entities.EMoney;

  public class ViewUserEMoney {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-api-key");
          
          var userId = "user_m_01HRS7PQEGE4YGCM1AZK1ENTGE";
          EMoney viewEMoney = mangopay.getUserApi().getEMoney(userId, "2023");
          
          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(viewEMoney);

          System.out.println(prettyJson);
      }
  }

  ```

  ```python Python   theme={null}
  from pprint import pprint
  import mangopay

  mangopay.client_id='your-client-id'
  mangopay.apikey='your-api-key'

  from mangopay.api import APIRequest
  handler = APIRequest(sandbox=True)

  from mangopay.resources import NaturalUser, EMoney

  natural_user = NaturalUser.get('213753890')

  view_user_emoney = natural_user.get_emoney()

  view_user_emoney = view_user_emoney.data[0]

  pprint(vars(view_user_emoney))  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using Newtonsoft.Json;


  class Program
  {
      static async Task Main(string[] args)
      {
          MangoPayApi api = new MangoPayApi();

          api.Config.ClientId = "your-client-id";
          api.Config.ClientPassword = "your-api-key";

          var userId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR";

          var viewUserEMoney = await api.Users.GetEmoneyAsync(userId);

          string prettyPrint = JsonConvert.SerializeObject(viewUserEMoney, Formatting.Indented);
          Console.WriteLine(prettyPrint);
      }
  }
  ```
</RequestExample>
