Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.4 KB

vault.md

File metadata and controls

49 lines (38 loc) · 1.4 KB

Vault

Tokenize sensitive details for use elsewhere in the API.

POST https://vault.paylike.io
{
  type: String,
  value: String,
}
// → Token

The type of value must be specified using the type parameter:

Type Value
pcn Payment card number (10-19 digits string)
pcsc Payment card security code (3 digits string)

Note that APIs accepting tokens expect the entire response. It is adviced not to inspect the response, but keep it as is for later use.

Status codes

Example

curl https://vault.paylike.io\
  --header 'Content-Type: application/json' \
  --header 'Accept-Version: 1' \
  --data '{"type": "pcn","value":"1234123412341234"}'
# {"token":"TTSOxu13AhHPdaIIMGdeUToEQXy+Y/JviNGXDTXKyhJOWhVWbJ2W2L8EUh5k6LNKZAQCOaseXo27VgpJoug5upZSPJaFjHgjfq6bxPrlCeYBDtkCFIokleqPJTN7mco5/PwGJdyV/smuL7qmebY="}
import Paylike from 'https://esm.sh/@paylike/[email protected]'
const paylike = Paylike()
paylike.tokenize('pcn', '1000100010001000').then(console.log, console.error)