Initialize transactions
This section shows how to initialize transactions for merchants, that have been onboarded before.
Before you start
Before you start processing payments make sure you've completed the steps described in the Merchant Onboarding section: You should have onboarded the merchant by now and have received a merchantId
. In addition, a third party agreements should be linked to the merchant.
Initialize a transaction
The Payment services API handles transactions. You use it to initialize payments, refunds or to reverse transactions.
TAP Payment services base url (testing):
The Initialize a transaction call's path contains the type
parameter:
/ms/aapay/v2/transaction/{type}/initialize
Since, in our example, we want to initialize a purchase, the relevant path parameter (type) has to be purchase
:
/ms/aapay/v2/transaction/purchase/initialize
Alternate type values would be refund
or reversal
. Please check the API reference for details.
Below is an example of an Initialize a transation request:
Initialize a transaction
curl --request POST \ --url https://naa-payment-service-dgw-t.paas-test.bbsas.no/ms/aapay/v2/transaction/purchase/initialize \ --header 'Authorization: SOME_STRING_VALUE' \ --header 'content-type: application/json;charset=utf-8;version=2.0' \
Request body
Initialize a transaction - payload
{ "merchantId": "string", "method": "string", "purchaseAmount": {
As shown above, the call's request body must include:
-
the
merchantId
- you should have received the merchantId as a result of the Add merchant call. -
the
method
- refers to the payment method. Possible values depend on the agreement. -
the
purchaseAmount
object -
the
consumer
object
Please learn more about optional fields in our API reference.
After you've initialized the transaction, you SHOULD send the retrieve transaction details call, to learn whether or not the transaction was successful.