Webhook structure

Togggle sends the KYC results to your registered webhook URL using a POST request with JSON payload.

  • Set Up a Listener Endpoint: Your server needs to have an endpoint ready to listen for incoming POST requests from Togggle. This endpoint is the webhook URL you registered with Togggle.

    For example, if your registered webhook URL is https://yourdomain.com/webhook/kyc, your server should have an endpoint set up to handle requests at /webhook/kyc.

  • Handle JSON Payloads: Ensure your server can parse JSON payloads sent by Togggle. The KYC results will be sent as a JSON object in the body of the POST request.

  • Secure Your Endpoint: It’s a good practice to secure your webhook endpoint. Consider using HTTPS and implementing security measures such as verifying the source of incoming requests.

Process KYC Results

  • Success and Failure Responses: Your endpoint needs to handle both success and failure scenarios. The structure of these payloads is detailed in the documentation, with keys for result_id, event, data, and possibly custom fields.

  • Parse and Use the Data: Extract and use the KYC data as per your application's requirements. This might involve updating the user's verification status in your database or triggering other processes based on the KYC result.

Last updated