Set a PIN
POST/v1/cards/:card_id/pin
Sets the PIN of a physical card from a PIN you have encrypted. It is a server-to-server call: there is no page to open. The same call sets a first PIN and resets a forgotten one.
- Get a key with
POST /v1/cards/{card_id}/pin-key. - Encrypt the PIN, as its digits, to that key with RSA-OAEP using SHA-256, and encode the result as base64.
- Send
key_idand the encrypted PIN here.
Encrypt on the cardholder's device. The PIN is ciphertext while it passes through your systems, and it stays out of PCI DSS scope only while your servers never see it in the clear. A server that handles the PIN unencrypted is in scope.
We check only what a PIN needs to be usable: digits, in the length the key
response gives as pin_length. Anything else is your policy, such as whether
to refuse repeated digits or sequences, and is yours to validate before you
encrypt. A PIN that isn't digits of that length is refused with
pin_invalid. A key that is unknown, already used or expired is refused with
invalid_parameter; get a new one.
Only a physical card that is active has a PIN to set. Any other card is
refused with card_invalid_state, and a closed card with card_closed.
Never write the PIN, encrypted or not, to a log, an analytics event, web storage or a support ticket.
Requires the cards:secrets scope.
Request
Responses
- 204
- 400
- 403
- 404
- 422
The PIN is set. Nothing is returned.
The request is malformed or contains an unrecognized parameter.
Credentials are valid but not permitted. Do not retry.
The resource does not exist, or belongs to another organization. The two are deliberately indistinguishable.
Well-formed but fails a business rule.