> ## 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.

# List Transactions for a User

This call returns transactions with the same `AuthorId`.

<Warning>
  **Caution - ScaContext default value changing**

  On this endpoint, the default value for `ScaContext` is changing to `USER_PRESENT` on **Dec 15, 2025** (Dec 1 in Sandbox).

  From this date, if the `PendingUserAction.RedirectUrl` value is returned, then you need to redirect the user to perform SCA.

  With approval from Mangopay, your platform may be able to use the `USER_NOT_PRESENT` value provided you also have a legal proxy in place with the user and the user's consent to access wallet balances and transactions on their behalf (read more about [proxy management](/guides/sca/proxy-management)).
</Warning>

<Note>
  **Note – SCA triggered by this endpoint**

  This endpoint requires the user to [perform SCA to authenticate](/guides/sca/wallets) the access to their wallet, unless SCA for wallet access was successfully completed in the last 180 days (or unless your platform is using a [proxy and user consent](/guides/sca/proxy-management)).

  When SCA is required, this endpoint returns a **401 - Unauthorized** response.

  To let the user complete the SCA session on the Mangopay-hosted webpage, your platform needs to retrieve the `RedirectUrl` from the `WWW-Authenticate` response header, add an encoded `returnUrl` query parameter, and redirect the user. Read more about how to redirect them in the [SCA session](/guides/sca/session) guide.

  In Sandbox, you can bypass SCA by including the word `accept` in the `Email` value of the [Natural User](/api-reference/users/natural-user-object-sca) or the `LegalRepresentative.Email` value of the [Legal User](/api-reference/users/legal-user-object-sca) – for example `accept@example.com` or `john.doe+accept@example.com`.
</Note>

### Path parameters

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

### Query parameters

<ParamField query="ScaContext" type="string">
  **Possible values:** `USER_PRESENT`, `USER_NOT_PRESENT`

  The SCA context of the request, which is **required** if the user's `UserCategory` is `OWNER`:

  * `USER_PRESENT` – The user is taking the SCA-triggering action of accessing their wallet. The platform must [redirect the user](/guides/sca/session) using the `PendingUserAction.RedirectUrl` returned so that the user can complete the SCA session (unless exempted because a successful SCA session for wallet access occurred in the last 180 days, so no redirection link was returned).
  * `USER_NOT_PRESENT` – The platform is taking the action under proxy from the user and the user has previously given consent to Mangopay (via the SCA hosted experience) to allow the action. If the user has not given (or has revoked) their consent, then `USER_NOT_PRESENT` returns a 403 error.

  Read more about [managing proxy and user consent](/guides/sca/proxy-management) **→**

  **Note:** For existing platforms, the parameter is technically optional if the User is an `OWNER`, and the default value will become `USER_PRESENT` from **Dec 15, 2025** (Dec 1 in Sandbox)
</ParamField>

<ParamField query="Sort" type="string">
  **Possible values:** `CreationDate:ASC`, `CreationDate:DESC`

  **Default value:** `CreationDate:ASC`

  Indicates the direction in which to sort the list.
</ParamField>

<ParamField query="per_page" type="integer">
  Min. value: `1`; max. value: `100`

  **Default value:** `10`

  Indicates the number of items returned for each page of the pagination.
</ParamField>

<ParamField query="page" type="integer">
  Start value: `1`

  **Default value:** `1`

  Indicates the index of the page for the pagination.
</ParamField>

<ParamField query="Status" type="string">
  **Allowed values:** `CREATED`, `SUCCEEDED`, `FAILED`

  The status of the transaction. You can filter on multiple values by separating them with a comma.
</ParamField>

<ParamField query="ResultCode" type="string">
  The code indicating the result of the operation. You can filter on multiple values by separating them with a comma.
</ParamField>

<ParamField query="BeforeDate" type="Unix timestamp">
  The date before which the transaction was created (based on the transaction’s `CreationDate` parameter). You can filter on a specific time range by using both the `AfterDate` and `BeforeDate` query parameters.
</ParamField>

<ParamField query="AfterDate" type="Unix timestamp">
  The date after which the transaction was created (based on the transaction’s `CreationDate` parameter). You can filter on a specific time range by using both the `AfterDate` and `BeforeDate` query parameters.
</ParamField>

<ParamField query="Type" type="string">
  **Allowed values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT`

  The type of the transaction. You can filter on multiple values by separating them with a comma.
</ParamField>

<ParamField query="Nature" type="string">
  **Allowed values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT`

  The nature of the transaction, providing more information about the context in which the transaction occurred. You can filter on multiple values by separating them with a comma.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="Array (Transactions)" type="array">
      The list of transactions created by the platform.

      <Expandable title="properties">
        <ResponseField name="Object (transaction)" type="object">
          The transaction created by the platform.

          <Expandable title="properties">
            <ResponseField name="Id" type="string">
              Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details)

              The unique identifier of the object.
            </ResponseField>

            <ResponseField name="Tag" type="string">
              Max. length: 255 characters

              Custom data that you can add to this object.\
              For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
            </ResponseField>

            <ResponseField name="CreationDate" type="Unix timestamp">
              The date and time at which the object was created.
            </ResponseField>

            <ResponseField name="AuthorId" type="string">
              The unique identifier of the user at the source of the transaction.
            </ResponseField>

            <ResponseField name="CreditedUserId" type="string">
              **Default value:** The unique identifier of the owner of the credited wallet.

              The unique identifier of the user whose wallet is credited.
            </ResponseField>

            <ResponseField name="DebitedFunds" type="object">
              Information about the debited funds.

              <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 debited funds (the sell currency).
                </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`).

                  During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. 
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="CreditedFunds" type="object">
              Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).

              <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 credited funds.
                </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="Fees" type="object">
              Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).

              <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 fees.
                </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="Status" type="string">
              **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED`

              The status of the transaction.
            </ResponseField>

            <ResponseField name="ResultCode" type="string">
              The code indicating the result of the operation. This information is mostly used to <a href="/errors/codes">handle errors</a> or for filtering purposes.
            </ResponseField>

            <ResponseField name="ResultMessage" type="string">
              The explanation of the result code.
            </ResponseField>

            <ResponseField name="ExecutionDate" type="Unix timestamp">
              The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`.
            </ResponseField>

            <ResponseField name="Type" type="string">
              The type of transaction.
            </ResponseField>

            <ResponseField name="Nature" type="string">
              **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT`

              The nature of the transaction, providing more information about the context in which the transaction occurred:

              * `REGULAR` – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow.
              * `REPUDIATION` – Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user has requested a chargeback).
              * `REFUND` – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay).
              * `SETTLEMENT` – Transfer made to the repudiation wallet by the platform to settle a lost dispute.
            </ResponseField>

            <ResponseField name="CreditedWalletId" type="string">
              The unique identifier of the credited wallet.
            </ResponseField>

            <ResponseField name="DebitedWalletId" type="string">
              The unique identifier of the debited wallet.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="401 - SCA required" defaultOpen>
    When SCA is required for wallet access, this endpoint returns a **401 - Unauthorized** response code with the `redirectUrl` in the `WWW-Authenticate` response header:

    ```HTTP 401 response header theme={null}
    WWW-Authenticate: PendingUserAction redirectUrl=https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13
    ```

    In this case, your platform needs to retrieve the URL value, encode and add a `returnUrl` query parameter, and redirect the user.

    Read more about [SCA redirection](/guides/sca/) and [SCA on wallet access](/guides/sca/wallets) **→**
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  [
      {
          "Id": "payin_m_01HSJVEP9KCCQK6FKC7973B3TZ",
          "Tag": "Created using the Mangopay API Postman collection",
          "CreationDate": 1711103498,
          "AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
          "CreditedUserId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
          "DebitedFunds": {
              "Currency": "EUR",
              "Amount": 6732
          },
          "CreditedFunds": {
              "Currency": "EUR",
              "Amount": 6732
          },
          "Fees": {
              "Currency": "EUR",
              "Amount": 0
          },
          "Status": "SUCCEEDED",
          "ResultCode": "000000",
          "ResultMessage": "Success",
          "ExecutionDate": 1711103498,
          "Type": "PAYIN",
          "Nature": "REGULAR",
          "CreditedWalletId": "wlt_m_01HSDQGSRYK3CXPA5RBJ08R2XJ",
          "DebitedWalletId": null,
          "DepositId": null
      }
  ]  
  ```

  ```json 401 - SCA required theme={null}
  // No response body, redirectUrl returned in WWW-Authenticate response header
  ```
</ResponseExample>

<RequestExample>
  ```json REST theme={null}
  // GET has no body parameters
  ```

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

  require_once 'vendor/autoload.php';

  use MangoPay\MangoPayApi;

  $api = new MangoPayApi();

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

  try {
      $userId = 'user_m_01K894KCN9MKGAJDCCDGQ7RSQX';
      $pagination = new \MangoPay\Pagination(1, 10);
      $filter = new \MangoPay\FilterTransactions();
      $filter->ScaContext = "USER_PRESENT";

      $response = $api->Users->GetTransactions($userId, $pagination, $filter);

      print_r($response);
  } catch (\MangoPay\Libraries\ResponseException $exception) {
      print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
  }
  ```

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

  let user = {
    Id: "user_m_01JZ8AVM2Y1RWVY1RT396BYW9V",
  };

  const listUserTransactions = async (userId) => {
    return await mangopay.Users.getTransactions(userId, {
      parameters: {
        ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
      },
      resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
    })
      .then((response) => {
        console.info(response);
        return response;
      })
      .catch((err) => {
        console.log(err);
        return false;
      });
  };

  listUserTransactions(user.Id);
  ```

  ```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 listTransactionsUser(userId)
      begin
          response = MangoPay::User.transactions(userId, {'ScaContext': 'USER_PRESENT'})
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to fetch transactions for the user: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myUser = {
      Id: 'user_m_01JXJ256GTH5TKXF6RGVFYQVV7',
  }

  listTransactionsUser(myUser[:Id])  
  ```

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

  public class ListUserTransactionsSca
  {
      public void Run()
      {
          Task.Run(async () =>
          {
              MangoPayApi api = new MangoPayApi();

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

              var userId = "user_m_01K8AZGCCWGE9AA7J2M7ZE0SQ5";
              var pagination = new Pagination(1, 100);
              var filter = new FilterTransactions
              {
                  ScaContext = "USER_PRESENT"
              };

              try
              {
                  await api.Users.GetTransactionsAsync(userId, pagination, filter);
              }
              catch (ResponseException ex)
              {
                  Dictionary<string, string> data = ex.ResponseError.Data;
                  string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
                  Console.WriteLine(prettyPrint);
              }
          }).GetAwaiter().GetResult();
      }
  }
  ```

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

  import mangopay
  from mangopay.exceptions import APIError

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

  from mangopay.api import APIRequest

  handler = APIRequest(sandbox=True)

  from mangopay.resources import Wallet, Transaction, NaturalUserSca

  natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')

  try:
      transactions = Transaction.all(user_id=natural_user.id, ScaContext='USER_PRESENT')
  except APIError as ex:
      print(ex.headers.get('www-authenticate'))
  ```

  ```java Java theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.core.FilterTransactions;
  import com.mangopay.core.Pagination;
  import com.mangopay.core.Sorting;
  import com.mangopay.core.enumerations.SortDirection;
  import com.mangopay.entities.Transaction;

  import java.util.List;

  public class ListUserTransactions {
      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_01HSAVT2J0REPGV5ZRPNK079K9";

          // Pagination: 20 per page, starting at page 1
          Pagination pagination = new Pagination(1, 20);

          // Filter with ScaContext
          FilterTransactions filter = new FilterTransactions();
          filter.setScaContext("USER_PRESENT");

          // Sorting: CreationDate DESC
          Sorting sorting = new Sorting();
          sorting.addField("CreationDate", SortDirection.desc);

          List<Transaction> transactions = mangopay.getUserApi().getTransactions(userId, pagination, filter, sorting);

          for (Transaction transaction : transactions) {
              Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
              String prettyJson = prettyPrint.toJson(transaction);

              System.out.println(prettyJson);
          }
      }
  }
  ```
</RequestExample>
