get https://development.knotapi.com/jwe/key
This endpoint returns a JWE public key which you can use to encrypt a JSON payload containing user and card information.
Building the JWE
You can encrypt the payload you'll provide to the Switch a Card (JWE) endpoint using your JWE public key. The JWE specifications are the following:
- RSA 2048 certificate in JWK format
- RSA-OAEP-256 as key encryption algorithm
- A256GCM as content encryption algorithm
The JWE value should be a JSON string with the following structure:
{
"user": {
"name": {
"first_name": "John",
"last_name": "Smith"
},
"address": {
"street": "348 WEST 57TH STREET",
"street2": "#367",
"city": "NEW YORK",
"region": "NY",
"postal_code": "10019",
"country": "US"
},
"phone_number": "+14155550123"
},
"card": {
"number": "4242424242424242",
"expiration": "08/2025",
"cvv": "012"
}
}
Card expiration date format
MM/YYYY
andMM/YY
are both accepted formats.