> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mangopay.com/api-reference/mandates/list-mandates-user/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server. # List Mandates for a User GET https://api.sandbox.mangopay.com/v2.01/{ClientId}/users/{UserId}/mandates List Mandates for a User Reference: https://docs.mangopay.com/api-reference/mandates/list-mandates-user ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. If your platform is using a [proxy](/guides/sca/proxy-management) to take SCA-triggering action on behalf of users, you also need to integrate [mTLS authentication](/guides/sca/platform) and use the `api-mtls` base URL. ## Servers - `https://api.sandbox.mangopay.com` (Sandbox, default) - `https://api.mangopay.com` (Production) - `https://api-mtls.sandbox.mangopay.com` (mTLS Sandbox) - `https://api-mtls.mangopay.com` (mTLS Production) ## Request ### Path parameters - `ClientId` (string, required) — Platform's API account identifier, associated with the API key. - `UserId` (string, required) — The unique identifier of the user. ## Response ### 200 Success - `Array (Mandates)` (list of ListAllMandatesResponseArrayMandatesItems, optional) — The list of mandates created by the platform. ## Types ### ListAllMandatesResponseArrayMandatesItems - `Object (Mandate)` (ListAllMandatesResponseArrayMandatesItemsObjectMandate, optional) — The mandate created by the platform. ### ListAllMandatesResponseArrayMandatesItemsObjectMandate The mandate created by the platform. - `Id` (string, optional) — Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details) The unique identifier of the object. - `CreationDate` (integer, optional) — Unix timestamp (UTC) of the date and time the object was created. - `Status` (string, optional) — **Returned values:** `CREATED`, `SUBMITTED`, `ACTIVE`, `FAILED`, `EXPIRED` The status of the mandate: - `CREATED` – The mandate has been generated but not yet confirmed. - `SUBMITTED` – The mandate has been confirmed and sent to the user's bank, and can be used to request a direct debit pay-in. - `ACTIVE` – The mandate has been accepted by the user's bank or successfully used to process a direct debit direct pay-in. Further pay-ins can be requested. - `FAILED` – The mandate has been canceled or otherwise failed, and can no longer be used for payments. - `EXPIRED` – No payment has been made against the mandate in the last 24 months. It can no longer be used for payments. - `UserId` (string, optional) — The unique identifier of the User (natural or legal) who owns the bank account. - `ExecutionType` (string, optional) — **Returned values:** `WEB` The execution type of the mandate. - `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`. - `ResultCode` (string, optional) — The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. ## Examples **Response** ```json [ { "CreationDate": 1663244376, "ExecutionType": "WEB", "Id": "mdt_m_01J98YZT8AJBGWX47AA077XMKZ", "MandateType": "DIRECT_DEBIT", "ResultCode": 1807, "ResultMessage": "User has let the mandate session expire without confirming", "Status": "FAILED", "Tag": "Created using the Mangopay API Postman collection", "UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T" }, { "CreationDate": 1669040333, "ExecutionType": "WEB", "Id": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ", "MandateType": "DIRECT_DEBIT", "ResultCode": "000000", "ResultMessage": "Success", "Status": "ACTIVE", "Tag": "Created using the Mangopay API Postman collection", "UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T" } ] ``` **SDK Code** ```python 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 natural_user = NaturalUser.get('210513027') mandates = natural_user.mandates.all() for mandate in mandates: pprint(vars(mandate)) ``` ```javascript const mangopayInstance = require('mangopay4-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '151452401', } const listUserMandates = async (userId) => { return await mangopay.Mandates.getMandatesForUser(userId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } listUserMandates(user.Id) ``` ```java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Mandate; import java.util.List; public class ListUserMandates { 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_01HT2NFK7Z2BRQNGNHMY30VVTT"; List mandates = mangopay.getMandateApi().getForUser(userId, null, null, null); for (Mandate mandate : mandates) { Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(mandate); System.out.println(prettyJson); } } } ``` ```csharp using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; 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_01J2TZ261WZNDM0ZDRWGDYA4GN"; var viewUserMandates = await api.Mandates.GetForUserAsync(userId, new Pagination(1, 100), null); string prettyPrint = JsonConvert.SerializeObject(viewUserMandates, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` ```php Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890 '; $response = $api->Users->GetMandates($userId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```ruby 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 listMandatesUser(userId) begin response = MangoPay::Mandate.fetch_for_user(userId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch Mandates: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id:'146476890' } listMandatesUser(myUser[:Id]) ```