This operation sets PIN with encrypted PIN block in ISO format 1. The PIN block is encrypted using a pre-shared\ndouble-length 3DES key.
POST
/
v2
/
{plasticId}
Set PIN
curl --request POST \
--url 'https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"zpkIndex": "0",
"pinBlock": "0123456789ABCDEF"
}
'import requests
url = "https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}"
payload = {
"zpkIndex": "0",
"pinBlock": "0123456789ABCDEF"
}
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({zpkIndex: '0', pinBlock: '0123456789ABCDEF'})
};
fetch('https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}', 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://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}",
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([
'zpkIndex' => '0',
'pinBlock' => '0123456789ABCDEF'
]),
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://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}"
payload := strings.NewReader("{\n \"zpkIndex\": \"0\",\n \"pinBlock\": \"0123456789ABCDEF\"\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://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"zpkIndex\": \"0\",\n \"pinBlock\": \"0123456789ABCDEF\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}")
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 \"zpkIndex\": \"0\",\n \"pinBlock\": \"0123456789ABCDEF\"\n}"
response = http.request(request)
puts response.read_body{}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}Example
// PIN 1234 in ISO format 1
var pinBlock = "141234AAAAAAAAAA";
// pre-shared zpk
var zpk = Hex.decode("00112233445566778899AABBCCDDEEFF0011223344556677");
// encrypt pinBlock with zpk
var des = Cipher.getInstance("DESede/ECB/NoPadding");
des.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(zpk, "DESede"));
var encryptedPinBlock = Hex.toHexString(des.doFinal(Hex.decode(pinBlock)));
// make request
pinApiClient.post()
.uri("/pin/v2/{plasticId}?auditUser={user}", 123456, "test")
.bodyValue(Map.of(
"zpkIndex", "0",
"pinBlock", encryptedPinBlock
))
.retrieve()
.bodyToMono(Object.class)
.block();
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The plastic id for given card
Query Parameters
The audit user to log the request
Body
application/json
The related PIN control request data
The PIN encryption key (ZPK) index. This index is used to point out which key to use in case there are multiple keys available.
Example:
"0"
ISO format 1 PIN block 3DES encrypted with PIN encryption key in hexadecimal.
Required string length:
16Example:
"0123456789ABCDEF"
Response
PIN set successfully
The response is of type setPinResponse · object.
Was this page helpful?
⌘I
Set PIN
curl --request POST \
--url 'https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"zpkIndex": "0",
"pinBlock": "0123456789ABCDEF"
}
'import requests
url = "https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}"
payload = {
"zpkIndex": "0",
"pinBlock": "0123456789ABCDEF"
}
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({zpkIndex: '0', pinBlock: '0123456789ABCDEF'})
};
fetch('https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}', 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://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}",
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([
'zpkIndex' => '0',
'pinBlock' => '0123456789ABCDEF'
]),
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://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}"
payload := strings.NewReader("{\n \"zpkIndex\": \"0\",\n \"pinBlock\": \"0123456789ABCDEF\"\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://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"zpkIndex\": \"0\",\n \"pinBlock\": \"0123456789ABCDEF\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integration-api-cat1.{{environment}}.ext.{{realm}}.cia.enfuce.com/pin/v2/{plasticId}")
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 \"zpkIndex\": \"0\",\n \"pinBlock\": \"0123456789ABCDEF\"\n}"
response = http.request(request)
puts response.read_body{}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"errorReason": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
