Skip to content

Development environment: content is being written, nothing points to production.

Documentation contents

API reference

API v2 (compatibility)

The v2 routes used by the WooCommerce and PrestaShop plugins and by existing integrations. They keep working unchanged: the new platform serves them for migrated organisations, with the same fields, status codes and error envelope as the current platform, and relays them to the current platform for the others (specs 0.5 and 2.4). New integrations should use v3.

Version 2.0.04 operationsGenerated from apps/docs/content/openapi/compat-v2.json (sha256 d026601f778c)

Base URLs

  • https://api.preprod.konnect.networkSandbox: fictitious payments, test cards.
  • https://api.konnect.networkProduction: real payments. Use only after the going-live checklist.

Authentication

  • x-api-key (header)

    Your API key, <organisationId>:<secret>, from the dashboard. Keep it on your server: never in a browser, a mobile app or a URL.

payments

Create a payment, redirect the buyer to the hosted payment page, then read the payment to know its status.

Create a payment and get the payment page URL

POST/api/v2/payments/init-paymentAPI key

Creates a payment for the wallet (payment account) receiverWalletId of your organisation. Redirect the buyer to payUrl. webhook, successUrl and failUrl are stored with payment_ref=<paymentRef> appended. With silentWebhook: true, Konnect calls webhook then successUrl server to server (GET, no body, not signed) when the payment succeeds; otherwise the buyer's browser is sent there. Always confirm the status with GET /api/v2/payments/{paymentId} before delivering the order.

Parameters

No parameters.

Request body application/json

  • receiverWalletIdstring

    Wallet (payment account) that receives the payment: the wallet id of the current platform, or the payment account id of the new platform. Must belong to the organisation of the API key.

  • amountintegerrequired

    Amount in minor units: millimes for TND (120000 is 120.000 TND). A whole number written as a decimal (120000.0, as PHP sends it) is accepted.

    • min: 100
    • max: 30000000
  • tokenstring

    Currency, TND by default. Only TND is served by the new platform; another known currency answers 422.

    • enum: "TND"
  • descriptionstring

    Shown to the buyer on the payment page. Without it, message is shown.

    • minLength: 3
    • maxLength: 280
  • lifespaninteger

    Minutes before the payment expires; only for an immediate payment. Without it, the payment expires after one day.

    • min: 1
    • max: 60
  • acceptedPaymentMethodsstring[]

    bank_card and e-DINAR map to the card providers active on your account, flouci, izi and pluxee to those providers. Other legacy values (wallet, konnect, MCOIN, wire_transfer, Paypal) are ignored. Without the field, every provider active on the account is offered.

  • webhookstring (uri)

    Your URL, stored with ?payment_ref=<paymentRef> (or &payment_ref=) appended. With silentWebhook, called server to server when the payment succeeds; otherwise the buyer's browser is sent to it. Not signed: confirm with GET /api/v2/payments/{paymentId}.

  • silentWebhookboolean

    When true, Konnect calls webhook then successUrl server to server on success (up to five tries in a row, 3 seconds each) and sends the buyer to successUrl.

  • successUrlstring (uri)

    Where the buyer is sent as soon as the payment succeeds (payment_ref is appended).

  • failUrlstring (uri)

    Where the buyer goes back from the result page after a refusal (payment_ref is appended).

  • themestring

    Theme of the payment page.

    • enum: "light", "dark"
  • checkoutFormboolean

    Accepted; the new payment page does not ask the buyer for these details yet.

  • addPaymentFeesToAmountboolean

    Deprecated: accepted and ignored (no Konnect fee on the flow).

  • orderIdstring | integer | null

    Your order reference, returned on the payment as a string.

  • typestring

    Only immediate is served by the new platform (partial answers 422).

    • enum: "immediate"
  • receiverPhoneNumberstring
  • firstNamestring
  • lastNamestring
  • emailstring

    Buyer's e-mail; a receipt is sent to it when the payment succeeds.

  • phoneNumberstring
  • receiverWalletstring

    Alias of receiverWalletId.

  • acceptedMethodsstring[]

    Older alias of acceptedPaymentMethods, checked against wallet, bank_card, e-DINAR, MCOIN, wire_transfer, flouci, Paypal.

  • messagestring

    Free text (the plugins send the product list); shown when description is absent.

  • expirationDatestring (date-time)

    Expiry of the payment when lifespan is not given.

  • paymentDetailsobject

    Free details, echoed in paymentDetails of the payment.

  • channelstring

    Sent by the plugins (Wordpress, Prestashop, WHMCS).

  • pluginVersionstring

Responses

  • 200Payment created.

    • payUrlstring (uri)required

      Hosted payment page: redirect the buyer here. ?theme= is added when theme is given.

    • paymentRefstringrequired

      24 hexadecimal characters; keep it with your order.

  • 401Missing or wrong x-api-key, or a receiverWalletId that is not a wallet of your organisation: the message says which (Failed to authenticate token!, Error: Invalid Api Key, Error: Invalid wallet identifier, Error: Wallet not found).

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 403The payment account is paused or archived.

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 404receiverWallet (alias) names no wallet of your organisation.

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 406lifespan given on a payment that is not immediate (payments.errors.lifespan), or an API key without the scope payments:write (Insufficient permission to perform this action).

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 422Validation error (one entry per failed rule, code is_invalid), or a request the platform does not serve (UNPROCESSABLE_ENTITY: unknown currency, a currency other than TND, a payment type other than immediate).

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger

Code samples

curl -X POST "$KONNECT_V2_URL/api/v2/payments/init-payment" \
  -H "x-api-key: $KONNECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "receiverWalletId": "5f7a209aeb3f76490ac4a3d1",
  "token": "TND",
  "amount": 120000,
  "description": "Order 1001",
  "acceptedPaymentMethods": [
    "bank_card",
    "e-DINAR",
    "flouci"
  ],
  "lifespan": 20,
  "checkoutForm": false,
  "webhook": "https://shop.example.com/konnect/webhook",
  "successUrl": "https://shop.example.com/checkout/success",
  "failUrl": "https://shop.example.com/checkout/failure",
  "theme": "light",
  "orderId": "order-1001",
  "firstName": "Salma",
  "lastName": "Example",
  "email": "buyer@example.com",
  "phoneNumber": "22000000"
}'

Example: request body

{
  "receiverWalletId": "5f7a209aeb3f76490ac4a3d1",
  "token": "TND",
  "amount": 120000,
  "description": "Order 1001",
  "acceptedPaymentMethods": [
    "bank_card",
    "e-DINAR",
    "flouci"
  ],
  "lifespan": 20,
  "checkoutForm": false,
  "webhook": "https://shop.example.com/konnect/webhook",
  "successUrl": "https://shop.example.com/checkout/success",
  "failUrl": "https://shop.example.com/checkout/failure",
  "theme": "light",
  "orderId": "order-1001",
  "firstName": "Salma",
  "lastName": "Example",
  "email": "buyer@example.com",
  "phoneNumber": "22000000"
}

Example: 200

{
  "payUrl": "https://pay.konnect.network/pay/665f1c2e8b3a4d0012ab34cd",
  "paymentRef": "665f1c2e8b3a4d0012ab34cd"
}

Example: 401

{
  "errors": [
    {
      "code": "AUTHENTICATE_TOKEN_INVALID",
      "target": "common",
      "message": "Error: Invalid Api Key",
      "source": {},
      "extra": 1
    }
  ]
}

Read a payment and its transactions

GET/api/v2/payments/{paymentId}

Returns the payment created by init-payment. Public, as on the current platform: no API key is needed (the plugins send theirs, it is ignored). Deliver the order only when status is completed and amount matches your order. transactions lists each attempt at a provider.

Parameters

  • paymentIdstringpathrequired

    The paymentRef returned by init-payment (24 hexadecimal characters).

Responses

  • 200The payment.

    • paymentPaymentrequired
      • transactionsTransaction[]required
        • amountintegerrequired
        • methodstringrequired

          bank_card, flouci, izi or pluxee.

        • statusstringrequired
          • enum: "pending_payment", "success", "failed_payment", "expired", "canceled", "refunded"
        • typestringrequired
          • enum: "ePayment"
        • tokenstringrequired
        • ext_payment_refstring

          Reference at the provider.

        • fromstringrequired

          Provider code.

        • idstringrequired
      • amountintegerrequired
      • tokenstringrequired
      • typestringrequired
        • enum: "immediate"
      • statusstringrequired

        completed once paid; only this status means paid. A refused attempt leaves the payment pending (the buyer may try again) until it expires.

        • enum: "pending", "completed", "canceled", "expired"
      • createdAtstring (date-time)required
      • updatedAtstring (date-time)required
      • failedTransactionsintegerrequired
      • successfulTransactionsintegerrequired
      • acceptedPaymentMethodsstring[]required
      • successUrlstring
      • failUrlstring
      • webhookstring
      • orderIdstring | null
      • paymentDetailsobjectrequired
      • idstringrequired

        The paymentRef.

  • 404No payment with this reference.

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 500The reference is not an identifier (the current platform answers with its database cast error).

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger

Code samples

curl -X GET "$KONNECT_V2_URL/api/v2/payments/665f1c2e8b3a4d0012ab34cd"

Example: 200

{
  "payment": {
    "transactions": [
      {
        "amount": 120000,
        "method": "bank_card",
        "status": "success",
        "type": "ePayment",
        "token": "TND",
        "ext_payment_ref": "TEST-000001",
        "from": "clictopay",
        "id": "4b1f7c2e-0000-4000-8000-000000000001"
      }
    ],
    "amount": 120000,
    "token": "TND",
    "type": "immediate",
    "status": "completed",
    "createdAt": "2026-10-01T09:30:00.000Z",
    "updatedAt": "2026-10-01T09:32:00.000Z",
    "failedTransactions": 0,
    "successfulTransactions": 1,
    "acceptedPaymentMethods": [
      "bank_card",
      "e-DINAR"
    ],
    "successUrl": "https://shop.example.com/checkout/success?payment_ref=665f1c2e8b3a4d0012ab34cd",
    "failUrl": "https://shop.example.com/checkout/failure?payment_ref=665f1c2e8b3a4d0012ab34cd",
    "webhook": "https://shop.example.com/konnect/webhook?payment_ref=665f1c2e8b3a4d0012ab34cd",
    "orderId": "order-1001",
    "paymentDetails": {
      "phoneNumber": "22000000",
      "email": "buyer@example.com",
      "name": "Salma Example"
    },
    "id": "665f1c2e8b3a4d0012ab34cd"
  }
}

Example: 404

{
  "errors": [
    {
      "code": "NOT_FOUND",
      "target": "common",
      "message": "Payment not found",
      "source": {},
      "extra": 1
    }
  ]
}

Read a payment (extended variant)

GET/api/v2/payments/{paymentId}/extended

Same answer as GET /api/v2/payments/{paymentId}, kept for the SDK that calls it.

Parameters

  • paymentIdstringpathrequired

    The paymentRef returned by init-payment (24 hexadecimal characters).

Responses

  • 200The payment.

    • paymentPaymentrequired
      • transactionsTransaction[]required
        • amountintegerrequired
        • methodstringrequired

          bank_card, flouci, izi or pluxee.

        • statusstringrequired
          • enum: "pending_payment", "success", "failed_payment", "expired", "canceled", "refunded"
        • typestringrequired
          • enum: "ePayment"
        • tokenstringrequired
        • ext_payment_refstring

          Reference at the provider.

        • fromstringrequired

          Provider code.

        • idstringrequired
      • amountintegerrequired
      • tokenstringrequired
      • typestringrequired
        • enum: "immediate"
      • statusstringrequired

        completed once paid; only this status means paid. A refused attempt leaves the payment pending (the buyer may try again) until it expires.

        • enum: "pending", "completed", "canceled", "expired"
      • createdAtstring (date-time)required
      • updatedAtstring (date-time)required
      • failedTransactionsintegerrequired
      • successfulTransactionsintegerrequired
      • acceptedPaymentMethodsstring[]required
      • successUrlstring
      • failUrlstring
      • webhookstring
      • orderIdstring | null
      • paymentDetailsobjectrequired
      • idstringrequired

        The paymentRef.

  • 404No payment with this reference.

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 500The reference is not an identifier (the current platform answers with its database cast error).

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger

Code samples

curl -X GET "$KONNECT_V2_URL/api/v2/payments/665f1c2e8b3a4d0012ab34cd/extended"

Example: 200

{
  "payment": {
    "transactions": [
      {
        "amount": 120000,
        "method": "bank_card",
        "status": "success",
        "type": "ePayment",
        "token": "TND",
        "ext_payment_ref": "TEST-000001",
        "from": "clictopay",
        "id": "4b1f7c2e-0000-4000-8000-000000000001"
      }
    ],
    "amount": 120000,
    "token": "TND",
    "type": "immediate",
    "status": "completed",
    "createdAt": "2026-10-01T09:30:00.000Z",
    "updatedAt": "2026-10-01T09:32:00.000Z",
    "failedTransactions": 0,
    "successfulTransactions": 1,
    "acceptedPaymentMethods": [
      "bank_card",
      "e-DINAR"
    ],
    "successUrl": "https://shop.example.com/checkout/success?payment_ref=665f1c2e8b3a4d0012ab34cd",
    "failUrl": "https://shop.example.com/checkout/failure?payment_ref=665f1c2e8b3a4d0012ab34cd",
    "webhook": "https://shop.example.com/konnect/webhook?payment_ref=665f1c2e8b3a4d0012ab34cd",
    "orderId": "order-1001",
    "paymentDetails": {
      "phoneNumber": "22000000",
      "email": "buyer@example.com",
      "name": "Salma Example"
    },
    "id": "665f1c2e8b3a4d0012ab34cd"
  }
}

Example: 404

{
  "errors": [
    {
      "code": "NOT_FOUND",
      "target": "common",
      "message": "Payment not found",
      "source": {},
      "extra": 1
    }
  ]
}

Cancel a pending payment

POST/api/v2/payments/{paymentId}/cancelAPI key

Cancels a pending payment of your organisation: the payment page stops accepting attempts. Answers the payment itself (not wrapped in payment). A payment already canceled is answered as it is.

Parameters

  • paymentIdstringpathrequired

    The paymentRef returned by init-payment (24 hexadecimal characters).

Responses

  • 200The canceled payment.

    • transactionsTransaction[]required
      • amountintegerrequired
      • methodstringrequired

        bank_card, flouci, izi or pluxee.

      • statusstringrequired
        • enum: "pending_payment", "success", "failed_payment", "expired", "canceled", "refunded"
      • typestringrequired
        • enum: "ePayment"
      • tokenstringrequired
      • ext_payment_refstring

        Reference at the provider.

      • fromstringrequired

        Provider code.

      • idstringrequired
    • amountintegerrequired
    • tokenstringrequired
    • typestringrequired
      • enum: "immediate"
    • statusstringrequired

      completed once paid; only this status means paid. A refused attempt leaves the payment pending (the buyer may try again) until it expires.

      • enum: "pending", "completed", "canceled", "expired"
    • createdAtstring (date-time)required
    • updatedAtstring (date-time)required
    • failedTransactionsintegerrequired
    • successfulTransactionsintegerrequired
    • acceptedPaymentMethodsstring[]required
    • successUrlstring
    • failUrlstring
    • webhookstring
    • orderIdstring | null
    • paymentDetailsobjectrequired
    • idstringrequired

      The paymentRef.

  • 401Missing or wrong x-api-key.

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 404No payment with this reference.

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger
  • 406The payment belongs to another organisation, the API key lacks the scope payments:write, or the payment is no longer pending.

    • errorsobject[]required
      • codestringrequired
      • targetstringrequired
        • enum: "common", "field"
      • messagestringrequired
      • sourceobjectrequired
        • fieldstring
      • extrainteger

Code samples

curl -X POST "$KONNECT_V2_URL/api/v2/payments/665f1c2e8b3a4d0012ab34cd/cancel" \
  -H "x-api-key: $KONNECT_API_KEY"

Example: 200

{
  "transactions": [
    {
      "amount": 1,
      "method": "method",
      "status": "pending_payment",
      "type": "ePayment",
      "token": "token",
      "ext_payment_ref": "ext_payment_ref",
      "from": "from",
      "id": "id"
    }
  ],
  "amount": 1,
  "token": "token",
  "type": "immediate",
  "status": "pending",
  "createdAt": "2026-10-01T09:30:00.000Z",
  "updatedAt": "2026-10-01T09:30:00.000Z",
  "failedTransactions": 1,
  "successfulTransactions": 1,
  "acceptedPaymentMethods": [
    "string"
  ],
  "successUrl": "successUrl",
  "failUrl": "failUrl",
  "webhook": "webhook",
  "orderId": "order-1001",
  "paymentDetails": {},
  "id": "id"
}

Example: 401

{
  "errors": [
    {
      "code": "AUTHENTICATE_TOKEN_INVALID",
      "target": "common",
      "message": "Failed to authenticate token!",
      "source": {},
      "extra": 1
    }
  ]
}