Introduction#
You can configure webhooks to monitor events on your account, enabling your system to receive notifications.CAMP relies on webhooks to notify you whenever an event occurred on your account, such as the completion of transactions. This is useful for handling asynchronous operation in real time.To use webhooks with your CAMP integration:1.
Create a webhook endpoint in your system.
2.
Configure the webhook endpoint on the API Integration page. For details, please refer to the Account Setup page. 3.
Simulate an event to test your webhook endpoint.
4.
Implement validation of webhook signatures. (Optional)
Webhook Retry Logic#
To acknowledge receipt of an event, your endpoint must return a 2xx HTTP status code to CAMP and the response format should be application/json. Otherwise CAMP will assume the event was not received and it will retry the webhook for up to 24 hours using an exponential backoff strategy.Webhook Verification#
About verifying webhook#
Once your system is configured to receive payloads, it will listen for any delivery that is sent to the configured endpoint. To ensure that your system only processess webhook deliveries that were sent by CAMP and ensure that the delivery was not tampered, you should verify the webhook signature before processing them.To verify webhook signature#
There will be X-Signature header included in all webhooks that contains a timestamp and a signature that you need to verify. The timestamp has a t= prefix, and signature has a v0= prefix.X-Signature:
t=1758867971711,
v0=b2468f1bc285eb64be242ee6d02e3c959dfb61482abe47ddb50da4b6be55997e
Steps to verify webhook signature#
Step 1: Get the webhook secret#
Login CAMP platform, and get the Webhook Secret in the API Integration page.Step 2: Extract timestamp and signature#
Split the header using , character as the delimiter and get the values for timestamp t and signature v0.Step 3: Prepare the to_sign_message string#
Sort the entire content of the webhook (including eventType, notificationId, and data) alphabetically, then concatenate it with the timestamp t using an underscore _, forming a Alphabetically Sorted Data_Timestamp structure for subsequent encryption.Step 4: Compute the expected signature#
Use the secret key as private key and use hash-based message authentication code (HMAC) with SHA-256 algorithm to encrypt the data_timestamp to generate the expected signature.Step 5: Compare the signature#
Compare the signature in the webhook request payload with the expected signature.Preventing replay attacks#
To prevent replay attacks, you may like to check the timestamp t against the current time and reject events that are too old. It is recommended to have a tolerance of 3 minutes between the timestamp and current time.Sample Code#
JSON Property Ordering Rules#
Modified at 2026-01-26 02:04:55