๐Ÿ”— API Integration

Konnect Payment Webhook Documentation

Endpoint Overview

When a payment is processed through Konnect, a webhook is triggered to notify your system about the payment status.

Webhook Request Details

Request Type

  • Method: GET
  • Endpoint: https://your_webhook.com

Parameters

ParameterTypeDescriptionRequired
payment_refStringUnique payment reference IDYes

Example of your endpoint

https://www.monsite.tn/module/konnect/webhook?payment_ref=5f9498735289e405fc7c18ac

Handling the Webhook

Step 1: Retrieve Payment Reference

Extract the payment_ref from the query parameters of the webhook request.

Step 2: Check Payment Status

Use the retrieved payment_ref to fetch the payment status:

Common Errors

ErrorPossible CauseSolution
Invalid Payment ReferenceIncorrect or expired payment_refVerify the reference ID, ensure it's valid and recent
Webhook Not ReceivedNetwork issues, firewall blockingCheck network configuration, ensure webhook endpoint is accessible
Authentication FailureIncorrect API credentialsVerify API keys and permissions
TimeoutSlow server responseImplement proper timeout handling, check server performance

Debugging Tips

  • Log all incoming webhook requests
  • Implement robust error handling
  • Verify webhook endpoint accessibility
  • Check network and firewall configurations

Best Practices

  • Always validate the payment_ref
  • Implement idempotency to handle duplicate webhooks
  • Use secure HTTPS for webhook endpoint
  • Log and monitor webhook interactions