For the complete documentation index, see llms.txt. This page is also available as Markdown.

Webhook Setup

For Liquidity Partners to communicate status updates with the Client during workflows like KYB/KYC, Swap, Onramp, and Offramp, the Client must furnish the API endpoint for webhook notifications. Additionally, the client must configure or update their webhook URL for receiving webhooks in both the Sandbox and Production environments using the Set/Update Webhook URL.

  • eventType will determine which workflow the status update belongs to.

  • referenceId will allow Client to determine which object to connect the status update to. The reference ID is different depending on the eventType.

  • metadata will contain additional information to help Client process webhook notifications.

{
 "referenceId": string | number,  (transactionId for onramp,offramp. clientCustomerId/submissionId for kyc/kyb)
 "eventType": string,    (onramp, offramp, kyc, kyb, fiatAccount, swap, virtual_account)
 "status": string,
 "metadata": json,
}

AUTHENTICATION

Ensure the webhook is authentic and untampered using HMAC SHA512.


  • Verifies Onramp webhook authenticity using HMAC-SHA512.

  • The request body is JSON-stringified and base64-encoded to generate the X-ONRAMP-PAYLOAD.

  • This encoded payload is signed using HMAC-SHA512 with the YOUR_API_SECRET, forming the X-ONRAMP-SIGNATURE.

  • Verification succeeds only if the generated signature matches the one provided in the headers.

  • Compact JSON formatting is required to ensure consistency with Onramp’s encoding.

  • Handle both lowercase and uppercase header keys to ensure compatibility (e.g., headers['x-onramp-signature'] || headers['X-ONRAMP-SIGNATURE'])

  • A unique eventId is included in metadata.eventId to identify each webhook event.

  • Included eventCreatedAt timestamp to ensure accurate tracking and processing of the event.

  • If a 200 OK response is not received, the webhook is retried up to 5 times with the same eventId, ensuring reliable and idempotent delivery.

Sample KYC response with eventId and eventCreatedAt
{
    "status": "FAILED",
    "metadata": {
        "customerId": "cM3qZo3J_1019",
        "eventId": 22,
        "eventCreatedAt": "2023-11-17T13:33:14.000Z"
    },
    "referenceId": "b8225c3a-0d96-4bd8-bd3c-e7d8e82ebcbb",
    "eventType": "KYC"
}

HEADERS

NAME
TYPE
DESCRIPTION

X-ONRAMP-PAYLOAD

String

payload generated for the request

X-ONRAMP-SIGNATURE

String

signature generated for the request

Sample implementation for authenticating WhiteLabel webhooks:

Last updated