When using Hosted Payment Fields, you will need to obtain a unique Hosted Payment Fields token for each session, and then use that in your checkout form. BlueSnap will save the shopper's payment information and associate it with the token, and you can include the token in your API requests in order to process card transactions or create or update vaulted shoppers.
For detailed instructions, see Implementing Hosted Payment Fields in your checkout form.
The Hosted Payment Fields Token will expire after 60 minutes.
To create a Hosted Payment Fields token, simply send a POST request to:
The response will provide the token in the location header, as follows:
curl -v -X POST https://sandbox.bluesnap.com/services/2/payment-fields-tokens \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \ -d '
HTTP/ 1.1 201 Created Location: https://sandbox.bluesnap.com/services/2/payment-fields-tokens/12345abcde*********