curl --request POST \
--url https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"card_id": "card_291u96075mva",
"certificates": [
"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...",
"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA..."
],
"device_type": "mobile_phone",
"nonce": "vXWJaBidcTLaJJCF",
"nonce_signature": "jD4Aphu+93N2wbBn",
"provisioning_app_version": "2.13.3"
}
'import requests
url = "https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay"
payload = {
"card_id": "card_291u96075mva",
"certificates": ["MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...", "MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA..."],
"device_type": "mobile_phone",
"nonce": "vXWJaBidcTLaJJCF",
"nonce_signature": "jD4Aphu+93N2wbBn",
"provisioning_app_version": "2.13.3"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_id: 'card_291u96075mva',
certificates: [
'MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...',
'MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...'
],
device_type: 'mobile_phone',
nonce: 'vXWJaBidcTLaJJCF',
nonce_signature: 'jD4Aphu+93N2wbBn',
provisioning_app_version: '2.13.3'
})
};
fetch('https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay', 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://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay",
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([
'card_id' => 'card_291u96075mva',
'certificates' => [
'MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...',
'MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...'
],
'device_type' => 'mobile_phone',
'nonce' => 'vXWJaBidcTLaJJCF',
'nonce_signature' => 'jD4Aphu+93N2wbBn',
'provisioning_app_version' => '2.13.3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay"
payload := strings.NewReader("{\n \"card_id\": \"card_291u96075mva\",\n \"certificates\": [\n \"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...\",\n \"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...\"\n ],\n \"device_type\": \"mobile_phone\",\n \"nonce\": \"vXWJaBidcTLaJJCF\",\n \"nonce_signature\": \"jD4Aphu+93N2wbBn\",\n \"provisioning_app_version\": \"2.13.3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"card_id\": \"card_291u96075mva\",\n \"certificates\": [\n \"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...\",\n \"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...\"\n ],\n \"device_type\": \"mobile_phone\",\n \"nonce\": \"vXWJaBidcTLaJJCF\",\n \"nonce_signature\": \"jD4Aphu+93N2wbBn\",\n \"provisioning_app_version\": \"2.13.3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_id\": \"card_291u96075mva\",\n \"certificates\": [\n \"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...\",\n \"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...\"\n ],\n \"device_type\": \"mobile_phone\",\n \"nonce\": \"vXWJaBidcTLaJJCF\",\n \"nonce_signature\": \"jD4Aphu+93N2wbBn\",\n \"provisioning_app_version\": \"2.13.3\"\n}"
response = http.request(request)
puts response.read_body{
"activation_data": "TUJQQUMtMS1GSy03NDgwNTIuMS0tVERF",
"card_id": "card_291u96075mva",
"encrypted_pass_data": "w9NGKYa3OkPGeQ+FmAKGga",
"ephemeral_public_key": "BMop3NufgKwy/r0GX1muvomvw"
}Provision with Apple Pay
curl --request POST \
--url https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"card_id": "card_291u96075mva",
"certificates": [
"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...",
"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA..."
],
"device_type": "mobile_phone",
"nonce": "vXWJaBidcTLaJJCF",
"nonce_signature": "jD4Aphu+93N2wbBn",
"provisioning_app_version": "2.13.3"
}
'import requests
url = "https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay"
payload = {
"card_id": "card_291u96075mva",
"certificates": ["MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...", "MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA..."],
"device_type": "mobile_phone",
"nonce": "vXWJaBidcTLaJJCF",
"nonce_signature": "jD4Aphu+93N2wbBn",
"provisioning_app_version": "2.13.3"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_id: 'card_291u96075mva',
certificates: [
'MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...',
'MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...'
],
device_type: 'mobile_phone',
nonce: 'vXWJaBidcTLaJJCF',
nonce_signature: 'jD4Aphu+93N2wbBn',
provisioning_app_version: '2.13.3'
})
};
fetch('https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay', 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://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay",
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([
'card_id' => 'card_291u96075mva',
'certificates' => [
'MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...',
'MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...'
],
'device_type' => 'mobile_phone',
'nonce' => 'vXWJaBidcTLaJJCF',
'nonce_signature' => 'jD4Aphu+93N2wbBn',
'provisioning_app_version' => '2.13.3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay"
payload := strings.NewReader("{\n \"card_id\": \"card_291u96075mva\",\n \"certificates\": [\n \"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...\",\n \"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...\"\n ],\n \"device_type\": \"mobile_phone\",\n \"nonce\": \"vXWJaBidcTLaJJCF\",\n \"nonce_signature\": \"jD4Aphu+93N2wbBn\",\n \"provisioning_app_version\": \"2.13.3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"card_id\": \"card_291u96075mva\",\n \"certificates\": [\n \"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...\",\n \"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...\"\n ],\n \"device_type\": \"mobile_phone\",\n \"nonce\": \"vXWJaBidcTLaJJCF\",\n \"nonce_signature\": \"jD4Aphu+93N2wbBn\",\n \"provisioning_app_version\": \"2.13.3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treasuryprime.com/card/{card_id}/digital_wallet_token/apple_pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_id\": \"card_291u96075mva\",\n \"certificates\": [\n \"MIIEPDCCA+KgAwIBAgICEAAwCQYHKoZIzj...\",\n \"MIIDZjCCAw2gAwIBAgIJAJx22AGaEPSgMA...\"\n ],\n \"device_type\": \"mobile_phone\",\n \"nonce\": \"vXWJaBidcTLaJJCF\",\n \"nonce_signature\": \"jD4Aphu+93N2wbBn\",\n \"provisioning_app_version\": \"2.13.3\"\n}"
response = http.request(request)
puts response.read_body{
"activation_data": "TUJQQUMtMS1GSy03NDgwNTIuMS0tVERF",
"card_id": "card_291u96075mva",
"encrypted_pass_data": "w9NGKYa3OkPGeQ+FmAKGga",
"ephemeral_public_key": "BMop3NufgKwy/r0GX1muvomvw"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The ID card being added to the wallet
Body
The apple-pay-token-request to create
The ID card being added to the wallet
Leaf and sub-CA certificates provided by Apple
One of mobile_phone, watch, or tablet
One-time-use nonce provided by Apple for security purposes
Apple-provided signature to the nonce
Version of the application making the provisioning request
Response
The apple-pay-token-request created
The ID card being added to the wallet
Leaf and sub-CA certificates provided by Apple
One of mobile_phone, watch, or tablet
One-time-use nonce provided by Apple for security purposes
Apple-provided signature to the nonce
Version of the application making the provisioning request
Was this page helpful?