curl -X GET https://api.sandbox.mangopay.com/v2.01/{ClientId}/cardregistrations/{CardRegistrationId} \
<?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 {
$cardRegistrationId = '192900791';
$response = $api->CardRegistrations->Get($cardRegistrationId);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk');
const mangopay = new mangopayInstance({
clientId: "your-client-id",
clientApiKey: "your-api-key",
})
let userCardRegistration = {
Id: 'cardreg_m_01HRETW28RKJFC8RB9H625RVBD',
}
const viewCardRegistration = async (cardRegistrationId) => {
return await mangopay.CardRegistrations.get(cardRegistrationId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
viewCardRegistration(userCardRegistration.Id)
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 viewCardRegistration(cardRegistrationId)
begin
response = MangoPay::CardRegistration.fetch(cardRegistrationId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Card Registration: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myCardRegistration = {
Id: '195067583'
}
viewCardRegistration(myCardRegistration[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.CardRegistration;
public class ViewCardRegistration {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
String cardRegId = "cardreg_m_01HXY9VZN4J1TERYG1BNPDHENN";
CardRegistration viewCardRegistration = mangopay.getCardRegistrationApi().get(cardRegId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(viewCardRegistration);
System.out.println(prettyJson);
}
}
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 CardRegistration
card_registration = CardRegistration(
id = '213600973'
)
try:
view_card_registration = CardRegistration.get(card_registration.id)
pprint(vars(view_card_registration))
except CardRegistration.DoesNotExist:
print('Card registration {} does not exist.'.format(view_card_registration.id))
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.POST;
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 cardRegistrationId = "cardreg_m_01J2Y3ZTFTZSKB5XWAKCNMPWFC";
var viewCardRegistration = await api.CardRegistrations.GetAsync(cardRegistrationId);
string prettyPrint = JsonConvert.SerializeObject(viewCardRegistration, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Id": "cardreg_wt_80b891e6-15f2-4f41-92f6-6e1a4bd85f2c",
"Tag": null,
"CreationDate": 1726239743,
"UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS",
"AccessKey": "0dEUcnUbQTdNXi3WF4WM",
"PreregistrationData": "lW7pQ21Gv8eJh5u4qWUKd8PUVwdHTGBDaBGXeVcQdSjIGJ7HqsEgrWMKFcQlGUPrn6X2n88FG9yZmJa932yIDyK6lpGoNUYyrgeQDsluRU9",
"RegistrationData": "data=qc_ShKapgXF-A2t_OC72KsUngOEnxFTIhI4U9nqKay8J_UGfLFelDx_8GUFWt5zp8HH5DRSTnhLZ_RIB_OJ35ZsP3bOVmF1YdoePYUxf8CWOxMdP0Uc0Rm6ABJRWHIWYn7Rs6J2udgLD-WrTkZpRtw",
"CardId": "card_m_GhrYYFpBoNeXXRFx",
"CardType": "CB_VISA_MASTERCARD",
"CardRegistrationURL": "https://pci.sandbox.mangopay.com/api/mangopay/vault/tokenize/eyJjbGllbnQiOiJhbnRob255aF90ZXN0MSIsInRva2VuIjoiRU50VVhTc2RhSUpBVUJ6VCJ9",
"ResultCode": "000000",
"ResultMessage": "Success",
"Currency": "EUR",
"Status": "VALIDATED"
}
Card registrations
View a Card Registration
GET
/
v2.01
/
{ClientId}
/
cardregistrations
/
{CardRegistrationId}
curl -X GET https://api.sandbox.mangopay.com/v2.01/{ClientId}/cardregistrations/{CardRegistrationId} \
<?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 {
$cardRegistrationId = '192900791';
$response = $api->CardRegistrations->Get($cardRegistrationId);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk');
const mangopay = new mangopayInstance({
clientId: "your-client-id",
clientApiKey: "your-api-key",
})
let userCardRegistration = {
Id: 'cardreg_m_01HRETW28RKJFC8RB9H625RVBD',
}
const viewCardRegistration = async (cardRegistrationId) => {
return await mangopay.CardRegistrations.get(cardRegistrationId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
viewCardRegistration(userCardRegistration.Id)
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 viewCardRegistration(cardRegistrationId)
begin
response = MangoPay::CardRegistration.fetch(cardRegistrationId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Card Registration: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myCardRegistration = {
Id: '195067583'
}
viewCardRegistration(myCardRegistration[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.CardRegistration;
public class ViewCardRegistration {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
String cardRegId = "cardreg_m_01HXY9VZN4J1TERYG1BNPDHENN";
CardRegistration viewCardRegistration = mangopay.getCardRegistrationApi().get(cardRegId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(viewCardRegistration);
System.out.println(prettyJson);
}
}
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 CardRegistration
card_registration = CardRegistration(
id = '213600973'
)
try:
view_card_registration = CardRegistration.get(card_registration.id)
pprint(vars(view_card_registration))
except CardRegistration.DoesNotExist:
print('Card registration {} does not exist.'.format(view_card_registration.id))
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.POST;
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 cardRegistrationId = "cardreg_m_01J2Y3ZTFTZSKB5XWAKCNMPWFC";
var viewCardRegistration = await api.CardRegistrations.GetAsync(cardRegistrationId);
string prettyPrint = JsonConvert.SerializeObject(viewCardRegistration, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Id": "cardreg_wt_80b891e6-15f2-4f41-92f6-6e1a4bd85f2c",
"Tag": null,
"CreationDate": 1726239743,
"UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS",
"AccessKey": "0dEUcnUbQTdNXi3WF4WM",
"PreregistrationData": "lW7pQ21Gv8eJh5u4qWUKd8PUVwdHTGBDaBGXeVcQdSjIGJ7HqsEgrWMKFcQlGUPrn6X2n88FG9yZmJa932yIDyK6lpGoNUYyrgeQDsluRU9",
"RegistrationData": "data=qc_ShKapgXF-A2t_OC72KsUngOEnxFTIhI4U9nqKay8J_UGfLFelDx_8GUFWt5zp8HH5DRSTnhLZ_RIB_OJ35ZsP3bOVmF1YdoePYUxf8CWOxMdP0Uc0Rm6ABJRWHIWYn7Rs6J2udgLD-WrTkZpRtw",
"CardId": "card_m_GhrYYFpBoNeXXRFx",
"CardType": "CB_VISA_MASTERCARD",
"CardRegistrationURL": "https://pci.sandbox.mangopay.com/api/mangopay/vault/tokenize/eyJjbGllbnQiOiJhbnRob255aF90ZXN0MSIsInRva2VuIjoiRU50VVhTc2RhSUpBVUJ6VCJ9",
"ResultCode": "000000",
"ResultMessage": "Success",
"Currency": "EUR",
"Status": "VALIDATED"
}
Path parameters
string
required
The unique identifier of the Card Registration object.
Responses
200
200
string
The unique identifier of the Card Registration object.
string
Custom data that can be added to this object.
In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object
In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object
Tag parameter and will not be editable.Unix timestamp
The date and time at which the object was created.
string
The unique identifier of the user the card belongs to.
string
The secure value to use when tokenizing the card via the dedicated endpoint.
string
The secure value to identify the registration when tokenizing the card via the dedicated endpoint.
string
The string returned by the tokenization server, which must be sent in full as the
RegistrationData on the PUT Update a Card Registration endpoint to create the Card object.string
The unique identifier of the Card object, which is returned after updating the Card Registration object with the
RegistrationData.string
Returned values:
CB_VISA_MASTERCARD, AMEX, MAESTRO, BCMCDefault value: CB_VISA_MASTERCARDThe type of the card. If not supplied, the default value will be taken into account.string
The URL to make the card tokenization call.Caution: This variable URL is specific to each card registration. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it.
string
The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes.
string
The explanation of the result code.
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the card.
string
Returned values:
CREATED, VALIDATED, ERRORThe status of the card registration:CREATED– The card registration has been created, but noRegistrationDatahas been entered yet and theCardIdvalue isnull.VALIDATED– The card registration has been successfully updated with theRegistrationDatafrom the tokenization server.ERROR– The card registration couldn’t be updated with theRegistrationDataand noCardIdwas generated. For more information, refer to theResultCode(105206, 105299) andResultMessage.
{
"Id": "cardreg_wt_80b891e6-15f2-4f41-92f6-6e1a4bd85f2c",
"Tag": null,
"CreationDate": 1726239743,
"UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS",
"AccessKey": "0dEUcnUbQTdNXi3WF4WM",
"PreregistrationData": "lW7pQ21Gv8eJh5u4qWUKd8PUVwdHTGBDaBGXeVcQdSjIGJ7HqsEgrWMKFcQlGUPrn6X2n88FG9yZmJa932yIDyK6lpGoNUYyrgeQDsluRU9",
"RegistrationData": "data=qc_ShKapgXF-A2t_OC72KsUngOEnxFTIhI4U9nqKay8J_UGfLFelDx_8GUFWt5zp8HH5DRSTnhLZ_RIB_OJ35ZsP3bOVmF1YdoePYUxf8CWOxMdP0Uc0Rm6ABJRWHIWYn7Rs6J2udgLD-WrTkZpRtw",
"CardId": "card_m_GhrYYFpBoNeXXRFx",
"CardType": "CB_VISA_MASTERCARD",
"CardRegistrationURL": "https://pci.sandbox.mangopay.com/api/mangopay/vault/tokenize/eyJjbGllbnQiOiJhbnRob255aF90ZXN0MSIsInRva2VuIjoiRU50VVhTc2RhSUpBVUJ6VCJ9",
"ResultCode": "000000",
"ResultMessage": "Success",
"Currency": "EUR",
"Status": "VALIDATED"
}
curl -X GET https://api.sandbox.mangopay.com/v2.01/{ClientId}/cardregistrations/{CardRegistrationId} \
<?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 {
$cardRegistrationId = '192900791';
$response = $api->CardRegistrations->Get($cardRegistrationId);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk');
const mangopay = new mangopayInstance({
clientId: "your-client-id",
clientApiKey: "your-api-key",
})
let userCardRegistration = {
Id: 'cardreg_m_01HRETW28RKJFC8RB9H625RVBD',
}
const viewCardRegistration = async (cardRegistrationId) => {
return await mangopay.CardRegistrations.get(cardRegistrationId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
viewCardRegistration(userCardRegistration.Id)
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 viewCardRegistration(cardRegistrationId)
begin
response = MangoPay::CardRegistration.fetch(cardRegistrationId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Card Registration: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myCardRegistration = {
Id: '195067583'
}
viewCardRegistration(myCardRegistration[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.CardRegistration;
public class ViewCardRegistration {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
String cardRegId = "cardreg_m_01HXY9VZN4J1TERYG1BNPDHENN";
CardRegistration viewCardRegistration = mangopay.getCardRegistrationApi().get(cardRegId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(viewCardRegistration);
System.out.println(prettyJson);
}
}
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 CardRegistration
card_registration = CardRegistration(
id = '213600973'
)
try:
view_card_registration = CardRegistration.get(card_registration.id)
pprint(vars(view_card_registration))
except CardRegistration.DoesNotExist:
print('Card registration {} does not exist.'.format(view_card_registration.id))
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.POST;
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 cardRegistrationId = "cardreg_m_01J2Y3ZTFTZSKB5XWAKCNMPWFC";
var viewCardRegistration = await api.CardRegistrations.GetAsync(cardRegistrationId);
string prettyPrint = JsonConvert.SerializeObject(viewCardRegistration, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?