// This POST has no body
using MangoPay.SDK;
using Newtonsoft.Json;
public class EnrollUser
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var result =
await api.Users.ManageConsent("user_m_01K8B28H25JBHX1QFVC0T54S1Q");
string prettyPrint = JsonConvert.SerializeObject(result, Formatting.Indented);
Console.WriteLine(prettyPrint);
}).GetAwaiter().GetResult();
}
}
{
"PendingUserAction": {
"RedirectUrl": "https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13"
}
}
Users
Manage proxy consent for a User
Allow a user to give or revoke consent for proxy actions
POST
/
v2.01
/
{ClientId}
/
sca
/
users
/
{UserId}
/
consent
// This POST has no body
using MangoPay.SDK;
using Newtonsoft.Json;
public class EnrollUser
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var result =
await api.Users.ManageConsent("user_m_01K8B28H25JBHX1QFVC0T54S1Q");
string prettyPrint = JsonConvert.SerializeObject(result, Formatting.Indented);
Console.WriteLine(prettyPrint);
}).GetAwaiter().GetResult();
}
}
{
"PendingUserAction": {
"RedirectUrl": "https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13"
}
}
This endpoint allows your platform to manage consent given by the end user for SCA-triggering actions taken under proxy.
Your platform needs to retrieve the returned
PendingUserAction.RedirectUrl, add an encoded returnUrl query parameter for them to be returned to after the SCA session, and redirect the user (read more about SCA redirection).
On the SCA session link in the response, the user can:
- Give consent for the first time
- Give consent to additional actions included by your platform
- Revoke consent (which your platform must allow at any time)
Path parameters
string
required
The unique identifier of the user.
Responses
200
200
object
Object containing the link needed for SCA redirection if triggered by the API call (otherwise returned
null).Hide properties
Hide properties
string
The URL to which to redirect the user to perform strong customer authentication (SCA) via a Mangopay-hosted webpage. This value is a variable and should not be hardcoded.The SCA session link expires 10 minutes after it’s generated.Caution: Before redirecting the user on this URL, you must add the query parameter
ReturnUrl with the percent-encoded URL to which you want the SCA session to return the user after authentication (whether successful or not).For more details, see How to redirect a user for an SCA session.400 - Proxy management not activated
400 - Proxy management not activated
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "b66bd1bf-6176-4416-8e1e-82e4f5cffad7#1762179938",
"Date": 1762179940,
"errors": {
"Invalid SCA request": "Consent cannot be given when no proxy is required by the client."
}
}
{
"PendingUserAction": {
"RedirectUrl": "https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13"
}
}
// This POST has no body
using MangoPay.SDK;
using Newtonsoft.Json;
public class EnrollUser
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var result =
await api.Users.ManageConsent("user_m_01K8B28H25JBHX1QFVC0T54S1Q");
string prettyPrint = JsonConvert.SerializeObject(result, Formatting.Indented);
Console.WriteLine(prettyPrint);
}).GetAwaiter().GetResult();
}
}
Was this page helpful?