Set PIN

Set a pin for a debit card

When a card number is activated, you can also PATCH the PIN. The PIN is sometimes requested from a merchant during a POS transaction. Please be sure to encrypt the pin before submitting.

API ENDPOINT

https://uat-api.synapsefi.com/v3.1/users/:user_id/nodes/:node_id/subnets/:subnet_id

PATH PARAMETER

user_id :
required
string

The user ID of the user

node_id :
required
string

The ID of the node the card number was issued to

subnet_id:
required
string

The ID of the subnet (card number)

BODY PARAMETER

card_pin:
required
string

Encrypted pin for the card

EXAMPLE REQUEST

PATCH /v3.1/users/5bb29f48520da000a38cb107/nodes/5bb29f5471fd1b0091317410/subnets/5bc920f2fff373002bf0d51b
HTTP/1.1
Host: uat-api.synapsefi.com
X-SP-USER-IP: 127.0.0.1
X-SP-USER: oauth_NhFV8tDKOMms2j5I4lzxJXUQY9BH6abycdnpTCA3|J6fhD7DNd238
Content-Type: application/json

{
      "card_pin": "mlMKMv5+ekyw9M5AtqUBZxgdzj+GEjzddp93qSPw6uRXGpdNiNulVZxcbH1gGGiwEU9UeOwGmgiMaQsDkpbuh3SWY6IxSiPNHI9ryY8z/z+d8MXockQxsKnl1B+ekcLAXx9s2RZM7T6Nfoa+ABGwRV7aFGt91NYaolA0tfU1981J9juB/iljm9cz5JUKDPCxZbn+LW1f4O/5Pt3fDX9Nrre/HsuHtgc7OIu6XTvg1FCm+ds3AkFdHA0dw1aW4j5biXWVEkNpb01PIicANYXtO/AusqH8udBLh0GIU/xNSTzipk/M2hUqoTZdOo7Hu8UZgLbWUEpv7hAAY2tfu/ymsA=="

}
node_id = '594e606212e17a002f2e3251'
subnet_id = '59c9f77cd412960028b99d2b'

body = {
  "card_pin": ""mlMKMv5+ekyw9M5AtqUBZxgdzj+GEjzddp93qSPw6uRXGpdNiNulVZxcbH1gGGiwEU9UeOwGmgiMaQsDkpbuh3SWY6IxSiPNHI9ryY8z/z+d8MXockQxsKnl1B+ekcLAXx9s2RZM7T6Nfoa+ABGwRV7aFGt91NYaolA0tfU1981J9juB/iljm9cz5JUKDPCxZbn+LW1f4O/5Pt3fDX9Nrre/HsuHtgc7OIu6XTvg1FCm+ds3AkFdHA0dw1aW4j5biXWVEkNpb01PIicANYXtO/AusqH8udBLh0GIU/xNSTzipk/M2hUqoTZdOo7Hu8UZgLbWUEpv7hAAY2tfu/ymsA=="
}

user.update_subnet(node_id, subnet_id, body)
const nodeID = '594e606212e17a002f2e3251';
const subnetID = '59c9f77cd412960028b99d2b';
const body = {
  "card_pin": ""mlMKMv5+ekyw9M5AtqUBZxgdzj+GEjzddp93qSPw6uRXGpdNiNulVZxcbH1gGGiwEU9UeOwGmgiMaQsDkpbuh3SWY6IxSiPNHI9ryY8z/z+d8MXockQxsKnl1B+ekcLAXx9s2RZM7T6Nfoa+ABGwRV7aFGt91NYaolA0tfU1981J9juB/iljm9cz5JUKDPCxZbn+LW1f4O/5Pt3fDX9Nrre/HsuHtgc7OIu6XTvg1FCm+ds3AkFdHA0dw1aW4j5biXWVEkNpb01PIicANYXtO/AusqH8udBLh0GIU/xNSTzipk/M2hUqoTZdOo7Hu8UZgLbWUEpv7hAAY2tfu/ymsA=="
};

 user.updateSubnet(nodeID, subnetID, body);
node_id = '594e606212e17a002f2e3251'
subnet_id = '59c9f77cd412960028b99d2b'

body=  {
  "card_pin": ""mlMKMv5+ekyw9M5AtqUBZxgdzj+GEjzddp93qSPw6uRXGpdNiNulVZxcbH1gGGiwEU9UeOwGmgiMaQsDkpbuh3SWY6IxSiPNHI9ryY8z/z+d8MXockQxsKnl1B+ekcLAXx9s2RZM7T6Nfoa+ABGwRV7aFGt91NYaolA0tfU1981J9juB/iljm9cz5JUKDPCxZbn+LW1f4O/5Pt3fDX9Nrre/HsuHtgc7OIu6XTvg1FCm+ds3AkFdHA0dw1aW4j5biXWVEkNpb01PIicANYXtO/AusqH8udBLh0GIU/xNSTzipk/M2hUqoTZdOo7Hu8UZgLbWUEpv7hAAY2tfu/ymsA=="
}

user.update_subnet(node_id: node_id, payload: body, subnter_id: subnet_id)
$body = (object)[
  "card_pin" => "mlMKMv5+ekyw9M5AtqUBZxgdzj+GEjzddp93qSPw6uRXGpdNiNulVZxcbH1gGGiwEU9UeOwGmgiMaQsDkpbuh3SWY6IxSiPNHI9ryY8z/z+d8MXockQxsKnl1B+ekcLAXx9s2RZM7T6Nfoa+ABGwRV7aFGt91NYaolA0tfU1981J9juB/iljm9cz5JUKDPCxZbn+LW1f4O/5Pt3fDX9Nrre/HsuHtgc7OIu6XTvg1FCm+ds3AkFdHA0dw1aW4j5biXWVEkNpb01PIicANYXtO/AusqH8udBLh0GIU/xNSTzipk/M2hUqoTZdOo7Hu8UZgLbWUEpv7hAAY2tfu/ymsA=="
];

node_id = '594e606212e17a002f2e3251'
subnet_id = '59c9f77cd412960028b99d2b'

$user->update_subnet(node_id, subnet_id, $body);
nodeID := "594e606212e17a002f2e3251"
subnetID := "5bc920f2fff373002bf0d51b"
body := `{
  "card_pin": ""mlMKMv5+ekyw9M5AtqUBZxgdzj+GEjzddp93qSPw6uRXGpdNiNulVZxcbH1gGGiwEU9UeOwGmgiMaQsDkpbuh3SWY6IxSiPNHI9ryY8z/z+d8MXockQxsKnl1B+ekcLAXx9s2RZM7T6Nfoa+ABGwRV7aFGt91NYaolA0tfU1981J9juB/iljm9cz5JUKDPCxZbn+LW1f4O/5Pt3fDX9Nrre/HsuHtgc7OIu6XTvg1FCm+ds3AkFdHA0dw1aW4j5biXWVEkNpb01PIicANYXtO/AusqH8udBLh0GIU/xNSTzipk/M2hUqoTZdOo7Hu8UZgLbWUEpv7hAAY2tfu/ymsA=="
}`

data, err := user.UpdateSubnet(nodeID, subnetID, body)

EXAMPLE RESPONSE

{
    "_id": "5bc920f2fff373002bf0d51b",
    "_links": {
        "self": {
            "href": "https://uat-api.synapsefi.com/v3.1/users/5bb29f48520da000a38cb107/nodes/5bb29f5471fd1b0091317410/subnets/5bc920f2fff373002bf0d51b"
        }
    },
    "access_token": "5bc920f9a5061e002681c89f",
    "account_class": "DEBIT_CARD",
    "card_hash": "78eb685b26d99d32538feb97cfd1274f994bdde48fa75471f22ba3029cbbc4e0",
    "card_number": "5431",
    "card_style_id": null,
    "client": {
        "id": "5b0da0f66e990e001f0c5f54",
        "name": "YY Test Account"
    },
    "cvc": "***",
    "exp": "2022-11-17",
    "nickname": "My Debit Card",
    "node_id": "5bb29f5471fd1b0091317410",
    "preferences": {
        "allow_foreign_transactions": true,
        "daily_atm_withdrawal_limit": 10,
        "daily_transaction_limit": 1000,
        "spending_limit": false
    },
    "status": "ACTIVE",
    "user_id": "5bb29f48520da000a38cb107"
}

Maximum PIN Attempts

This limit is set in your controls, as listed on your spec sheet. When a user goes over the maximum amount of pin attempts permitted, you will need to reset the pin or the user’s account will be locked for 24 hours.

Encrypting Data

Make sure you encrypt the card_pin on the client's device using our public key provided below. The public key is the same for the sandbox and production environments.

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzxVLeRTf77kmG/42SdjjtRfaI/7GN4UoUBfxzN80gCyrjK+tHYJR7DKefC47fNyA2dGU7x3tu1wQRKOkjschbC3ZWF1mCqccUiHRPiGhH9VBsxLbAUCFAKOPZcBDCT7IhUdd6S23e99ewkb0c6pRk28u+kz+7ZB7d6Z/S+Em316zs0HqEnEaoUNFXtdTyW3EPuaqo0+p9daICRC44VbrTlzc+Y1A/CsiOcCCl4ske8scu/fWg0K3nybfn7IdO2smkzRwwGOc4uexBMnAkAyl0eQrqXZO4vis6ktmLFV4NpYsd0U2vvmuXFoA9XBcJHdbAww/TGwHq5RJ3505QSEK8QIDAQAB
-----END PUBLIC KEY-----

Padding

Please make sure you are using PKCS1_v1_5 padding for encryption.

JSencrypt is an easy to use library to use for this purpose, the implementation would look something like this

// Encrypt with the public key...
var encrypt = new JSEncrypt();
encrypt.setPublicKey($('#pubkey').val());
var encryptedCardPin = encrypt.encrypt($('#card_pin').val());

Set PIN


Set a pin for a debit card

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.