Skip to main content

Event Types

Card2Crypto sends webhooks for these events:

Event Payloads

All webhooks follow the same structure with event-specific differences in the payment.status field.

Common Structure

payment.completed

Sent when a payment is successfully processed and the seller’s balance is credited.

When It’s Triggered

  1. Customer completes checkout on your white-labeled page
  2. Stripe successfully processes the payment
  3. Card2Crypto credits seller’s balance (amount - 15% fee)
  4. 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

  1. Customer attempts checkout
  2. Stripe declines the payment (insufficient funds, fraud detection, etc.)
  3. 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

  1. Admin approves a refund request in the dashboard
  2. Card2Crypto processes the refund
  3. Seller’s balance is debited
  4. 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

The metadata 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 are payment.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 test payment.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