Creates a single use token that wraps the details of personally identifiable information (PII). This token can be used in place of a personal_id_number in the Account Update API method. These tokens can only be used once.
curl https://api.stripe.com/v1/tokens \
-u STRIPE_SECRET_KEY: \
-d pii[personal_id_number]=000000000 \
-X POST
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set rest = Server.CreateObject("Chilkat_9_5_0.Rest")
' URL: https://api.stripe.com/v1/tokens
bTls = 1
port = 443
bAutoReconnect = 1
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect)
If (success <> 1) Then
Response.Write "<pre>" & Server.HTMLEncode( "ConnectFailReason: " & rest.ConnectFailReason) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"
End If
success = rest.SetAuthBasic("STRIPE_SECRET_KEY","")
success = rest.AddQueryParam("pii[personal_id_number]","000000000")
strResponseBody = rest.FullRequestFormUrlEncoded("POST","/v1/tokens")
If (rest.LastMethodSuccess <> 1) Then
Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"
End If
set jsonResponse = Server.CreateObject("Chilkat_9_5_0.JsonObject")
success = jsonResponse.Load(strResponseBody)
id = jsonResponse.StringOf("id")
object = jsonResponse.StringOf("object")
client_ip = jsonResponse.IsNullOf("client_ip")
created = jsonResponse.IntOf("created")
livemode = jsonResponse.BoolOf("livemode")
type = jsonResponse.StringOf("type")
used = jsonResponse.BoolOf("used")
%>
</body>
</html>
{
"id": "pii_1BnETKGswQrCoh0XMUBp4DiD",
"object": "token",
"client_ip": null,
"created": 1516662782,
"livemode": false,
"type": "pii",
"used": false
}