Skip to main content

Enbank API Integration

How does the payment flow work

Untitled

  1. User opens the merchant’s checkout page
  2. A POST request to https://pay.enbank.me is sent to the server with the data needed for the payment.
  • token
  • amount
  • description
  • successCallback
  • errorCallback

The request will return the transactionId needed for the next step.

  1. A “Pay with Enbank” web component, to which the transactionId is passed, is shown to the user.
  2. When the user clicks on the button, they are redirected to the payment page, where they can complete the payment
  3. When the user completes the payment flow, we will call the success/fail callback that was given to us in the request.
note

You should check our OpenAPI docs which can be used to generate code for a client and see how the API endpoints can be used.

In more technical terms a POST request is send to https://enbank-server-local.fly.dev/transactions/newor to https://pay.enbank.me/transactions/newthat has a JSON body that describes the payment details. They will be used to create a new transaction. All transaction details must be included for a transaction to be created, however there are flags that can further modify a transaction and are optional.

Transaction Details

amountTransaction amount how much you want the user to pay. Example: "amount": 15
tokenEnbank generated token. Example: "token":"<your_enbank_token>”
descriptionTransaction description that will be shown to the user. Example: "description": "My first Enbank transaction”
successCallbackThe url we will send a GET request to when the payment was completed. (In the headers we attach the amount of the transaction and the transaction Id.)
errorCallbackThe url we will send a GET request to when the payment was unsuccessful this may be called multiple times.

Transaction Flags

lineItemsFor including the shopping cart items
tipTo enable tips
timeOutTo enable payment expiration, a unix time stamp
singleMobileBank643e710c753d573cad4b4edc9916bdea (Revolut)
caution

Please do not use the sandbox token on your live site this will send our CTO some money he does not deserve. Let him eat ramen.

Examples for different programming languages.

Enbank - PHP example docs

Enbank - NextJS example docs

Enbank - Java example docs

Enbank - cURL example docs

Enbank - .NET example docs

Enbank - node.js example docs