VB.NET UWP/WinRT Stripe: Create a PII Token

Back to Index

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.

Documentation: https://stripe.com/docs/api/curl#create_pii_token

CURL Command

curl https://api.stripe.com/v1/tokens \
   -d pii[personal_id_number]=000000000 \
   -X POST

VB.NET UWP/WinRT Example

Dim rest As New Chilkat.Rest
Dim success As Boolean

'  URL: https://api.stripe.com/v1/tokens
Dim bTls As Boolean = True
Dim port As Integer = 443
Dim bAutoReconnect As Boolean = True
success = Await rest.ConnectAsync("api.stripe.com",port,bTls,bAutoReconnect)
If (success <> True) Then
    Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
    Exit Sub
End If



Dim strResponseBody As String = Await rest.FullRequestFormUrlEncodedAsync("POST","/v1/tokens")
If (rest.LastMethodSuccess <> True) Then
    Exit Sub
End If

Dim jsonResponse As New Chilkat.JsonObject

Dim id As String
Dim object As String
Dim client_ip As Boolean
Dim created As Integer
Dim livemode As Boolean
Dim type As String
Dim used As Boolean

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")

Sample JSON Response Body

  "id": "pii_1BnETKGswQrCoh0XMUBp4DiD",
  "object": "token",
  "client_ip": null,
  "created": 1516662782,
  "livemode": false,
  "type": "pii",
  "used": false