Boka Payments


Boka Payments is a payment proxy and a subsystem where a customer can choose to connect a number of supported payment providers.

To initiate a purchase through Boka Payments, you will need to do one of the following.

Request transaction keys for a customer account on Boka Payments.
The keys are used to compute a hash to validate a purchase.
Request an application key used to retrieve the above transaction keys.

This is useful if you are offering a general service where you don't represent a single customer account. This is however not generally available to anything other than applications developed by Boka or its partners.

Initiating a purchase

To initiate a purchase you will need the merchant's ID number aswell as their transaction keys. Provided that you already possess this, follow these steps.

Step 1

Send a HTTP POST to

The POST data should contain the following fields.

Field Description
MerchantId Unique identifier for merchant
Timestamp Number of miliseconds since 1970-01-01 (Unix epoc) in UTC.
Amount The amount to be drawn.
Currency Abbrevated currency, such as SEK or USD.
AcceptUrl Local URL where the user will be transferred after successful payment.
CancelUrl Local URL where the user will be transferred upon cancelling the payment.
MD5Key Hash based on form data and transaction keys. See below.

The MD5Key hash is computed using the following pattern.

pass1 = hex(md5(key1 + "merchant=" + merchantId + "&currency=" + currency + "&amount=" + amount + "&timestamp=" timestamp))
md5key = hex(md5(key2 + pass1))

Step 2

If the POST in step 1 was successful, you should now have gotten a response with a URL.<merchantId>/<transactionId>

The next step is to redirect your users to this URL. This page will list all the different payment providers set up for the merchant.

Let your user follow the payment flow on the selected payment provider.

Step 3

When a payment is successful, you will be redirected to the AcceptUrl provided in the initial POST.

You will notice that the AcceptUrl will have a parameter called bpTransactionId appended as a query string value. You can store this transaction ID in your application for subsequent use within Boka Payments, or in contact with the Boka Payments support.

Retrieving transaction keys

NOTE! This option is only available to applications developed within Boka or by its partners.

To retrieve the transaction keys used in the steps above, you can issue a HTTP GET to the following URL.<merchantId>/transactionkeys

To successfully implement this, you will need to add the HTTP header X-Boka-App-Id with an application identifier provided by the Boka Payments support.

You need to make sure that the transaction keys are not visible to the public in your application.