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
receiverWalletIdstringWallet (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.
amountintegerrequiredAmount in minor units: millimes for TND (
120000is 120.000 TND). A whole number written as a decimal (120000.0, as PHP sends it) is accepted.- min: 100
- max: 30000000
tokenstringCurrency,
TNDby default. Only TND is served by the new platform; another known currency answers 422.- enum: "TND"
descriptionstringShown to the buyer on the payment page. Without it,
messageis shown.- minLength: 3
- maxLength: 280
lifespanintegerMinutes before the payment expires; only for an
immediatepayment. Without it, the payment expires after one day.- min: 1
- max: 60
acceptedPaymentMethodsstring[]bank_cardande-DINARmap to the card providers active on your account,flouci,iziandpluxeeto 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. WithsilentWebhook, called server to server when the payment succeeds; otherwise the buyer's browser is sent to it. Not signed: confirm withGET /api/v2/payments/{paymentId}.silentWebhookbooleanWhen true, Konnect calls
webhookthensuccessUrlserver to server on success (up to five tries in a row, 3 seconds each) and sends the buyer tosuccessUrl.successUrlstring (uri)Where the buyer is sent as soon as the payment succeeds (
payment_refis appended).failUrlstring (uri)Where the buyer goes back from the result page after a refusal (
payment_refis appended).themestringTheme of the payment page.
- enum: "light", "dark"
checkoutFormbooleanAccepted; the new payment page does not ask the buyer for these details yet.
addPaymentFeesToAmountbooleanDeprecated: accepted and ignored (no Konnect fee on the flow).
orderIdstring | integer | nullYour order reference, returned on the payment as a string.
typestringOnly
immediateis served by the new platform (partialanswers 422).- enum: "immediate"
receiverPhoneNumberstringfirstNamestringlastNamestringemailstringBuyer's e-mail; a receipt is sent to it when the payment succeeds.
phoneNumberstringreceiverWalletstringAlias of
receiverWalletId.acceptedMethodsstring[]Older alias of
acceptedPaymentMethods, checked againstwallet,bank_card,e-DINAR,MCOIN,wire_transfer,flouci,Paypal.messagestringFree text (the plugins send the product list); shown when
descriptionis absent.expirationDatestring (date-time)Expiry of the payment when
lifespanis not given.paymentDetailsobjectFree details, echoed in
paymentDetailsof the payment.channelstringSent by the plugins (
Wordpress,Prestashop,WHMCS).pluginVersionstring
Responses
200Payment created.
payUrlstring (uri)requiredHosted payment page: redirect the buyer here.
?theme=is added whenthemeis given.paymentRefstringrequired24 hexadecimal characters; keep it with your order.
401Missing or wrong
x-api-key, or areceiverWalletIdthat 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[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
403The payment account is paused or archived.
errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
404
receiverWallet(alias) names no wallet of your organisation.errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
406
lifespangiven on a payment that is notimmediate(payments.errors.lifespan), or an API key without the scopepayments:write(Insufficient permission to perform this action).errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
422Validation error (one entry per failed rule,
codeis_invalid), or a request the platform does not serve (UNPROCESSABLE_ENTITY: unknown currency, a currency other than TND, a payment type other thanimmediate).errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
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
paymentIdstringpathrequiredThe
paymentRefreturned byinit-payment(24 hexadecimal characters).
Responses
200The payment.
paymentPaymentrequiredtransactionsTransaction[]requiredamountintegerrequiredmethodstringrequiredbank_card,flouci,iziorpluxee.statusstringrequired- enum: "pending_payment", "success", "failed_payment", "expired", "canceled", "refunded"
typestringrequired- enum: "ePayment"
tokenstringrequiredext_payment_refstringReference at the provider.
fromstringrequiredProvider code.
idstringrequired
amountintegerrequiredtokenstringrequiredtypestringrequired- enum: "immediate"
statusstringrequiredcompletedonce paid; only this status means paid. A refused attempt leaves the paymentpending(the buyer may try again) until it expires.- enum: "pending", "completed", "canceled", "expired"
createdAtstring (date-time)requiredupdatedAtstring (date-time)requiredfailedTransactionsintegerrequiredsuccessfulTransactionsintegerrequiredacceptedPaymentMethodsstring[]requiredsuccessUrlstringfailUrlstringwebhookstringorderIdstring | nullpaymentDetailsobjectrequiredidstringrequiredThe
paymentRef.
404No payment with this reference.
errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
500The reference is not an identifier (the current platform answers with its database cast error).
errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
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
paymentIdstringpathrequiredThe
paymentRefreturned byinit-payment(24 hexadecimal characters).
Responses
200The payment.
paymentPaymentrequiredtransactionsTransaction[]requiredamountintegerrequiredmethodstringrequiredbank_card,flouci,iziorpluxee.statusstringrequired- enum: "pending_payment", "success", "failed_payment", "expired", "canceled", "refunded"
typestringrequired- enum: "ePayment"
tokenstringrequiredext_payment_refstringReference at the provider.
fromstringrequiredProvider code.
idstringrequired
amountintegerrequiredtokenstringrequiredtypestringrequired- enum: "immediate"
statusstringrequiredcompletedonce paid; only this status means paid. A refused attempt leaves the paymentpending(the buyer may try again) until it expires.- enum: "pending", "completed", "canceled", "expired"
createdAtstring (date-time)requiredupdatedAtstring (date-time)requiredfailedTransactionsintegerrequiredsuccessfulTransactionsintegerrequiredacceptedPaymentMethodsstring[]requiredsuccessUrlstringfailUrlstringwebhookstringorderIdstring | nullpaymentDetailsobjectrequiredidstringrequiredThe
paymentRef.
404No payment with this reference.
errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
500The reference is not an identifier (the current platform answers with its database cast error).
errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
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
paymentIdstringpathrequiredThe
paymentRefreturned byinit-payment(24 hexadecimal characters).
Responses
200The canceled payment.
transactionsTransaction[]requiredamountintegerrequiredmethodstringrequiredbank_card,flouci,iziorpluxee.statusstringrequired- enum: "pending_payment", "success", "failed_payment", "expired", "canceled", "refunded"
typestringrequired- enum: "ePayment"
tokenstringrequiredext_payment_refstringReference at the provider.
fromstringrequiredProvider code.
idstringrequired
amountintegerrequiredtokenstringrequiredtypestringrequired- enum: "immediate"
statusstringrequiredcompletedonce paid; only this status means paid. A refused attempt leaves the paymentpending(the buyer may try again) until it expires.- enum: "pending", "completed", "canceled", "expired"
createdAtstring (date-time)requiredupdatedAtstring (date-time)requiredfailedTransactionsintegerrequiredsuccessfulTransactionsintegerrequiredacceptedPaymentMethodsstring[]requiredsuccessUrlstringfailUrlstringwebhookstringorderIdstring | nullpaymentDetailsobjectrequiredidstringrequiredThe
paymentRef.
401Missing or wrong
x-api-key.errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
404No payment with this reference.
errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
extrainteger
406The payment belongs to another organisation, the API key lacks the scope
payments:write, or the payment is no longer pending.errorsobject[]requiredcodestringrequiredtargetstringrequired- enum: "common", "field"
messagestringrequiredsourceobjectrequiredfieldstring
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
}
]
}