Gateway API (0.23.0)

Overview

Konnect provides an easy payment experience for your customers and easy integration process for the developers. Payment process works by creating Payment Request and then the customers accepting the Payment Request.

  1. Create payment request URLs, each request has a unique Payment Reference.
  2. Your customers have the choice to specify their payment methods.
  3. You receive the payment confirmation with a unique Payment ID.

Setup

  1. Create a Konnect account https://preprod.konnect.network/admin
  2. Create a Konnect account https://preprod.konnect.network/admin
  3. Create an organisation
  4. Copy the wallet key from the organisation dashboard
  5. generate an api key from organisation dashboard
  6. Use your wallet & api key to initiate and receive payments


Note

You can test all our API endpoints in our Sandbox environment, by signing up on our Sandbox Platform.

which will mock your transactions to perform end-to-end testing of your Integration flow.

The base URL for production environment will be https://api.konnect.network/api/v2/

The base URL for Sandbox environment will be https://api.preprod.konnect.network/api/v2/

Payments

Init payment

This endpoint initiates a new payment.

header Parameters
x-api-key
required
string
Example: 6137ad140c181c5eb44a7f88:Rp2dpHPb0mBpj3_51s86zzp3PXs5w1

An API key is a unique identifier for each organisation used to perform API calls to Konnect API.

Request Body schema: application/json
receiverWalletId
required
string

The konnect wallet id of the payment receiver. Your Wallet ID is accessible on the dashboard.

token
string
Enum: "TND" "EUR" "USD"

The currency of the payment.
When token is different from TND, we will handle conversion ourlselves so the receiver gets paid in TND.

amount
required
number

The amount to be paid (in Millimes for TND / Centimes for EUR and USD).

type
string
Enum: "immediate" "partial"

The type decides if the payment could be paid partially (partial) or should be paid all at once (immediate).

description
string

A description you can add to the payment. It will be seen by the payer in the gateway payment page.

lifespan
number

Duration before the payment expires, in minutes.

feesIncluded
boolean

Whether to ask the client to pay an extra amount to cover Konnect fees.

firstName
string

The first name of the payer

lastName
string

The last name of the payer

phoneNumber
string

The phone number of the payer

email
string

The email of the payer

orderId
string

An identifier that you can give to this order.

webhook
string

When the payment is done, Konnect system will send a request to your system on
GET WEBHOOK/payments?payment_ref=paymentId

silentWebhook
boolean

If this is true, Konnect will make the call to the webhook without redirecting the payer to the webhook URL.

successUrl
string

A URL to redirect the user to when the payment succeeds.
This will be ignored if the webook is activated and not set to silent.

failUrl
string

A URL to redirect the user to when the payment fails.
This will be ignored if the webook is activated and not set to silent.

checkoutForm
boolean

Ask the payer to fill a checkout form before payment.

acceptedPaymentMethods
Array of strings
Default: ["wallet","bank_card","e-DINAR"]
Items Enum: "wallet" "bank_card" "e-DINAR" "flouci" "wire_transfer"

An array containing the payment methods you wish to get paid with

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Get Payment details

path Parameters
paymentId
string
Example: 5e68ed190a43a43998c6eeba

The ID of the payment

Responses

Response samples

Content type
application/json
{
  • "payment": {
    }
}

Webhook

Once the payment is done, your system will be notified by a call from our server on the webhook. The request you will get is a GET request on your_webhook.com?payment_ref=PAYMENT_ID

For example:
https: //www.monsite.tn/module/konnect/webhook?cart_id=6670&payment_ref=5f9498735289e405fc7c18ac

If you are handling this on your server side and you don't wish your client to be redirected to the webhook,
you can change that by using the silentWebhook attribute.

Once you access the payment ID from the request query params of the webhook request, you'll be able to use it to fetch the status of the payemnt.

Prestashop

Konnect is also available as a module for Prestashop websites.

Please contact us to get access to it. Send us an email at:

support@konnect.network

Wordpress

Konnect is also available as a plugin for Woocommerce websites.
Download Wordpress plugin:
https://wordpress.org/plugins/wc-konnect-gateway
Or you can access it from admin dashboard

API Key

An API key is a unique identifier for each organisation used to perform API calls to Konnect API.

The API Key can be generated from the organisation profile in the Dashboard.

It has a specific format as the following example:

'6137ad140c181c5eb44a7f88:Rp2dpHPb0mBpj3_51s86zzp3PXs5w1'