Event Types
Card2Crypto sends webhooks for these events:Event Payloads
All webhooks follow the same structure with event-specific differences in thepayment.status field.
Common Structure
payment.completed
Sent when a payment is successfully processed and the seller’s balance is credited.When It’s Triggered
- Customer completes checkout on your white-labeled page
- Stripe successfully processes the payment
- Card2Crypto credits seller’s balance (amount - 15% fee)
- Webhook is sent to your endpoint
Example Payload
How to Handle
payment.failed
Sent when a payment fails or is declined.When It’s Triggered
- Customer attempts checkout
- Stripe declines the payment (insufficient funds, fraud detection, etc.)
- Webhook is sent to your endpoint
Example Payload
How to Handle
payment.refunded
Sent when an admin processes a refund for a completed payment.When It’s Triggered
- Admin approves a refund request in the dashboard
- Card2Crypto processes the refund
- Seller’s balance is debited
- Webhook is sent to your endpoint
Example Payload
How to Handle
Field Reference
payment object
shop object
Root fields
Handling Multiple Events
Use a switch statement to handle different event types:Metadata Usage
Themetadata object contains any custom data you provided when creating the payment. This is useful for linking webhooks to your internal systems.
When Creating Payment
In Webhook
Best Practices
1. Always Check Event Type
Don’t assume all webhooks arepayment.completed:
2. Handle Missing Fields
Not all fields are guaranteed to be present:3. Use Metadata Wisely
Store identifiers in metadata to link payments to your system:4. Log All Events
Keep records of all webhooks for debugging:Testing Events
Use the “Test Webhook” button in your shop settings to testpayment.completed events.
For testing other event types in development, you can manually create test payloads:
Next Steps
Webhook Security
Learn how to verify webhook signatures
Testing Webhooks
Test webhooks in development