You can generate merchant API credentials when you receive a MERCHANT_PARTNER_ONBOARDED notification with a merchant ID (MID). BlueSnap assigns an MID when the merchant is approved to process transactions.
BlueSnap authenticates all requests to its RESTful web services with Basic authentication to process payments with BlueSnap, each merchant account must generate unique API credentials to include in API requests.
As a partner platform that processes transactions on behalf of your merchants, you need access to merchant API credentials from your partner account. You can leverage BlueSnap's API Credentials endpoint to build a custom solution that generates and manages merchant API credentials. This API provides testing parameters so you can test how your platform responds to all possible outcomes.
API Integration
Send the merchant ID in a POST request to generate the API credentials:
curl -v -X POST https://platform.bluesnap.com/services/2/merchants/api-credentials \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"merchantId":123456
}'
A successful request returns a 200 OK response that includes the merchant username and password:
{
"merchantId": 857345,
"username": "ABCMerchant",
"password": "kjhdA@3aA",
"dataProtectionKey": "Kru5Y50p"
}
You can base64-encode the username
and password
values from the response to create the API key:
echo -n "ABCMerchant:kjhdA@3aA" | base64
QUJDTWVyY2hhbnQ6a2poZEFAM2FB
You can include it in transaction requests to process payments on behalf of your merchants.
Test your API Integration
The API Credentials endpoint includes the approvalTesting
parameter that lets you simulate an API request and response without generating production API credentials for a merchant. Test requests help you verify that your platform responds appropriately when generating API credentials.
Set this parameter to true
to send the request in test mode:
curl -v -X POST https://platform.bluesnap.com/services/2/merchants/api-credentials \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"approvalTesting": true,
"merchantId":857345,
"username":"MerchantUsername",
"password":"kjhdA@3aA",
"dataProtectionKey": "Kru5Y50p"
}'