curl --request POST \
--url https://{subdomain}.truust.io/2.0/customers/{uuid}/cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payin_type": "M2P_ISSUING",
"wallet_id": 51
}
'import requests
url = "https://{subdomain}.truust.io/2.0/customers/{uuid}/cards"
payload = {
"payin_type": "M2P_ISSUING",
"wallet_id": 51
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({payin_type: 'M2P_ISSUING', wallet_id: 51})
};
fetch('https://{subdomain}.truust.io/2.0/customers/{uuid}/cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.truust.io/2.0/customers/{uuid}/cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payin_type' => 'M2P_ISSUING',
'wallet_id' => 51
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.truust.io/2.0/customers/{uuid}/cards"
payload := strings.NewReader("{\n \"payin_type\": \"M2P_ISSUING\",\n \"wallet_id\": 51\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.truust.io/2.0/customers/{uuid}/cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payin_type\": \"M2P_ISSUING\",\n \"wallet_id\": 51\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/customers/{uuid}/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payin_type\": \"M2P_ISSUING\",\n \"wallet_id\": 51\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"self": "<string>",
"uuid": "<string>",
"type": "<string>",
"cardholder": "<string>",
"alias": "<string>",
"expiration": "12/26",
"issuing_country": "<string>",
"issuing_bank": "<string>",
"is_3d_secure": true,
"confirmed": true,
"payin_type": "<string>",
"tokenization_link": "<string>",
"gateway_reference_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"connections": {}
}{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}Add Card to Customer
Adds a card to a customer. The behaviour depends on payin_type:
DCP,DCP_AUTH: tokenizes a card. The response includes atokenization_linkthe customer must visit to enter the card details.STRIPE: issues a virtual card againstwallet_id. See Stripe Authorization.M2P_ISSUING(only when card issuing is enabled): issues a card linked to a wallet previously created withPOST /walletsandtype: M2P_ISSUING. Issuance is asynchronous: the card is returned withconfirmed: falseand becomesconfirmed: true, with the issuer token ingateway_reference_id, once the issuer confirms it.
curl --request POST \
--url https://{subdomain}.truust.io/2.0/customers/{uuid}/cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payin_type": "M2P_ISSUING",
"wallet_id": 51
}
'import requests
url = "https://{subdomain}.truust.io/2.0/customers/{uuid}/cards"
payload = {
"payin_type": "M2P_ISSUING",
"wallet_id": 51
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({payin_type: 'M2P_ISSUING', wallet_id: 51})
};
fetch('https://{subdomain}.truust.io/2.0/customers/{uuid}/cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.truust.io/2.0/customers/{uuid}/cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payin_type' => 'M2P_ISSUING',
'wallet_id' => 51
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.truust.io/2.0/customers/{uuid}/cards"
payload := strings.NewReader("{\n \"payin_type\": \"M2P_ISSUING\",\n \"wallet_id\": 51\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.truust.io/2.0/customers/{uuid}/cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payin_type\": \"M2P_ISSUING\",\n \"wallet_id\": 51\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/customers/{uuid}/cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payin_type\": \"M2P_ISSUING\",\n \"wallet_id\": 51\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"self": "<string>",
"uuid": "<string>",
"type": "<string>",
"cardholder": "<string>",
"alias": "<string>",
"expiration": "12/26",
"issuing_country": "<string>",
"issuing_bank": "<string>",
"is_3d_secure": true,
"confirmed": true,
"payin_type": "<string>",
"tokenization_link": "<string>",
"gateway_reference_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"connections": {}
}{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}Authorizations
Use your account's Secret Key as the Bearer token.
Path Parameters
Customer UUID.
Body
DCP, DCP_AUTH, STRIPE, M2P_ISSUING ID of the wallet that backs the card. Required for STRIPE and M2P_ISSUING. Must belong to the customer.
51
M2P_ISSUING only. Optional cardholder data; cards are issued anonymous by default.
Show child attributes
Show child attributes
M2P_ISSUING only. Card product identifier.
M2P_ISSUING only. Card type or program code.
Response
Card created
Card brand (e.g. VISA, MASTERCARD).
Masked card number alias (e.g. 4242XXXXXXXX4242).
"12/26"
Whether the card has been successfully tokenized and confirmed.
Payment type this card is associated with.
URL to complete card tokenization. Only present immediately after creation.
Identifier of the card at the issuer (STRIPE, M2P_ISSUING). Only present for cards linked to a wallet.
Hypermedia links to related resources.
Show child attributes
Show child attributes
