API

CardSensitiveDetail

A card's sensitive details and PIN, read or set with client-side encryption.

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /twcard-data/v1/sensitive-card-data/details create Sensitive card details retrieved successfully
POST /twcard-data/v1/sensitive-card-data/pin create Card PIN retrieved successfully
POST /twcard-data/v1/sensitive-card-data/preset-pin create OK - PIN set successfully
GET /twcard-data/v1/clientSideEncryption/fetchEncryptingKey load RSA encryption key retrieved successfully

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

card_sensitive_detail, err := client.CardSensitiveDetail(nil).Load(nil, nil)
if err != nil {
    panic(err)
}
fmt.Println(card_sensitive_detail)
created, err := client.CardSensitiveDetail(nil).Create(map[string]any{"encryptedPayload": "example", "keyVersion": 1}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local card_sensitive_detail, err = client:CardSensitiveDetail():load()
local created, err = client:CardSensitiveDetail():create({ encryptedPayload = "example", keyVersion = 1 })

PHP

Construct client as shown in the PHP setup, then call the operations:

$card_sensitive_detail = $client->CardSensitiveDetail()->load();
$created = $client->CardSensitiveDetail()->create(["encryptedPayload" => "example", "keyVersion" => 1]);

Python

Construct client as shown in the Python setup, then call the operations:

card_sensitive_detail = client.CardSensitiveDetail().load()
created = client.CardSensitiveDetail().create({ "encryptedPayload": "example", "keyVersion": 1 })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

card_sensitive_detail = client.CardSensitiveDetail.load()
created = client.CardSensitiveDetail.create({ "encryptedPayload" => "example", "keyVersion" => 1 })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const card_sensitive_detail = await client.CardSensitiveDetail().load()
const created = await client.CardSensitiveDetail().create({ encryptedPayload: "example", keyVersion: 1 })

Fields

Field Type Required Description
encryptedPayload string Yes Your JWE payload.
key string No The RSA public key.
keyVersion integer Yes The version of the key to use.
version integer No Version of the encryption key.

create

POST /twcard-data/v1/sensitive-card-data/details

Operation ID: cardSensitiveDetailsGet.

Authentication: bearer token (UserToken).

Parameters

Parameter In Type Required Description
x-tw-twcard-card-token header string (uuid) Yes The card token identifying which card to retrieve details for.
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Request body

application/json

Property Type Required Description
encryptedPayload string Yes Your JWE encrypted payload.
keyVersion integer (int32) Yes The version of the encryption key to use. Always set to 1.

Responses

200: Sensitive card details retrieved successfully

application/json

Property Type Required Description
cardholderName string No Name on the card.
cvv2 string No The card CVV2 security code.
expiryDate string No The card expiry date in MM/YY format.
nonce string (uuid) No An arbitrary UUID issued from the cryptographic communication.
pan string No The card Primary Account Number.
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

POST /twcard-data/v1/sensitive-card-data/pin

Operation ID: cardPinGet.

Authentication: bearer token (UserToken).

Parameters

Parameter In Type Required Description
x-tw-twcard-card-token header string (uuid) Yes The card token identifying which card to retrieve the PIN for.
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Request body

application/json

Property Type Required Description
encryptedPayload string Yes Your JWE encrypted payload.
keyVersion integer (int32) Yes The version of the encryption key to use. Always set to 1.

Responses

200: Card PIN retrieved successfully

application/json

Property Type Required Description
nonce string (uuid) No An arbitrary UUID issued from the cryptographic communication.
pin string No The card PIN.
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

POST /twcard-data/v1/sensitive-card-data/preset-pin

Operation ID: cardOrderPresetPin.

Authentication: bearer token (UserToken).

Parameters

Parameter In Type Required Description
x-tw-twcard-order-id header string Yes The card order ID.
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Request body

application/json

Property Type Required Description
encryptedPayload string Yes Your JWE payload.
keyVersion integer Yes The version of the key to use. It is always set to 1.

Responses

200: OK - PIN set successfully

text/plain

The response is string.

429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.

load

GET /twcard-data/v1/clientSideEncryption/fetchEncryptingKey

Operation ID: cardEncryptionKeyGet.

Authentication: bearer token (UserToken).

Parameters

Parameter In Type Required Description
X-External-Correlation-Id header string (uuid) No Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Responses

200: RSA encryption key retrieved successfully

application/json

Property Type Required Description
key string No The RSA public key.
version integer (int32) No Version of the encryption key.
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.