Webhook Types
There are three types of webhooks available:- Item Listing Payment Completed
- Items Transferred
- Item Creation Order Completed
Webhook Authentication
The signature is passed in thehandcash-signature
header of the webhook request.
To ensure the authenticity of webhook calls, implement the following authentication process:
Webhook Payload Structure
All webhooks share a common base structure:Item Listing Payment Completed
Triggered when a payment for a listed item is completed.Items Transferred
Triggered when items are transferred between users.Item Creation Order Completed
Triggered when an item creation order is completed.Key Types
ItemTransfer
Item
CreateItemsOrder
Handling Webhooks
- Set up an endpoint in your application to receive webhook POST requests.
- Verify the webhook signature using the authentication process above.
- Parse the webhook payload based on the
event
type. - Update your application’s state or trigger relevant actions based on the webhook data.
Best Practices
- Always verify the webhook signature to ensure the request is from HandCash.
- Use the
handcash-signature
header to retrieve the signature for verification. - Implement idempotency to handle potential duplicate webhook deliveries.
- Process webhooks asynchronously to avoid blocking your application.
- Store raw webhook data for debugging and auditing purposes.
- Implement proper error handling and logging for webhook processing.