Resource

Webhooks

Webhook allows you to receive real-time notifications about events in your account. You can subscribe to specific events and receive notifications at your configured endpoint.

Required Events

The following events must be subscribed to:

EventDescriptionPayload Type
Events.Wallet.balanceUpdatedTriggered when wallet balance changesWalletFlow
Events.Card.statusUpdatedTriggered when card status changesCard
Events.Card.tradeReceivedTriggered when card receives a new tradeCardTrade
Events.Trade.statusUpdatedTriggered when trade status changesTrade

Webhook Payload Structure

All webhook notifications follow this structure:

{
    "event": "Events.Wallet.balanceUpdated",
    "payload": {
        // Entity data based on the event type
    }
}

Example Payloads

Wallet Balance Updated

{
    "event": "Events.Wallet.balanceUpdated",
    "payload": {
        "uid": 4,
        "wid": 4,
        "osn": "feeffdc5f2ca763aa9d4055029219ec15fba5b2b423971d0cf77eb5f2374084f",
        "type": 1,
        "cuy": 840,
        "amt": "99.00",
        "balance": "99.00",
        "mark": "recharge fee:1",
        "created_at": "2024-07-12 09:02:00"
    }
}

Card Status Updated

{
    "event": "Events.Card.statusUpdated",
    "payload": {
        "id": 1000,
        "no": "428813******8317",
        "status": 2,
        "token": "xxxxxx", // Optional, exists when the card status is activated
        "pin": "100000", // Optional, exists when the card status is activated
        "expiry": "ciphertext", // Optional, exists when the card status is activated
        "cvv": "ciphertext", // Optional, exists when the card status is activated
        "risk_reason": "Risk " // Optional, when the card is cancelled due to risk control reasons, it exists
    }
}

Card Trade Received

{
    "event": "Events.Card.tradeReceived",
    "payload": {
        "sn": "ct_66f2481b93453",
        "pid": 2,
        "cid": 1105,
        "merchant": "APPLE.COM/BILL",
        "type": 1,
        "no": "4288130025963034",
        "auth_amt": "1.00",
        "auth_cuy": 840,
        "auth_at": "2024-09-24 05:03:20",
        "trade_amt": "1.00",
        "trade_cuy": 840,
        "trade_at": "2024-09-24 05:03:20",
        "settle_amt": "1.00",
        "settle_fee": "0.00",
        "settle_cuy": 840,
        "settle_at": "2024-09-24 05:03:20",
        "result": 40,
        "mark": "This transaction was denied by the system. For more details: support@vccpool.com"
    }
}

Trade Status Updated

{
    "event": "Events.Trade.statusUpdated",
    "payload": {
        "osn": "t_6690f130ee044",
        "type": 2,
        "action": 2,
        "cid": 10000,
        "amt": "11.00",
        "fee": "0.33",
        "cuy": 840,
        "status": 1,
        "complete_at": "2024-07-12 09:02:42",
        "created_at": "2024-07-12 09:02:40",
        "updated_at": "2024-07-12 09:02:42"
    }
}

Implementation Requirements

  1. Your webhook endpoint must be HTTPS
  2. Your endpoint must respond with a 200 status code within 5 seconds
  3. Implement retry logic for failed deliveries
  4. Keep your endpoint secure and validate the webhook signature

Security

For security, we recommend:

  1. Using HTTPS for your webhook endpoint
  2. Validating the webhook signature
  3. Implementing rate limiting on your endpoint
  4. Monitoring webhook delivery status