Webhook Callback
curl --request POST \
--url https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "CARD_OPERATION_TRANSACTION",
"eventId": "evt-12345678",
"timestamp": 1640995200000,
"tenantId": "wsb-12345678",
"accountId": "wsb-account-123",
"cardId": "card-12345678",
"cardholderId": "ch-12345678",
"transactionId": "tx-12345678",
"workOrderId": "wo-12345678",
"status": "COMPLETED",
"result": "SUCCESS",
"data": {},
"errorMessage": "Insufficient funds",
"errorCode": "INSUFFICIENT_FUNDS",
"retryCount": 0,
"maxRetries": 3
}
'import requests
url = "https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback"
payload = {
"eventType": "CARD_OPERATION_TRANSACTION",
"eventId": "evt-12345678",
"timestamp": 1640995200000,
"tenantId": "wsb-12345678",
"accountId": "wsb-account-123",
"cardId": "card-12345678",
"cardholderId": "ch-12345678",
"transactionId": "tx-12345678",
"workOrderId": "wo-12345678",
"status": "COMPLETED",
"result": "SUCCESS",
"data": {},
"errorMessage": "Insufficient funds",
"errorCode": "INSUFFICIENT_FUNDS",
"retryCount": 0,
"maxRetries": 3
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
eventType: 'CARD_OPERATION_TRANSACTION',
eventId: 'evt-12345678',
timestamp: 1640995200000,
tenantId: 'wsb-12345678',
accountId: 'wsb-account-123',
cardId: 'card-12345678',
cardholderId: 'ch-12345678',
transactionId: 'tx-12345678',
workOrderId: 'wo-12345678',
status: 'COMPLETED',
result: 'SUCCESS',
data: {},
errorMessage: 'Insufficient funds',
errorCode: 'INSUFFICIENT_FUNDS',
retryCount: 0,
maxRetries: 3
})
};
fetch('https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'eventType' => 'CARD_OPERATION_TRANSACTION',
'eventId' => 'evt-12345678',
'timestamp' => 1640995200000,
'tenantId' => 'wsb-12345678',
'accountId' => 'wsb-account-123',
'cardId' => 'card-12345678',
'cardholderId' => 'ch-12345678',
'transactionId' => 'tx-12345678',
'workOrderId' => 'wo-12345678',
'status' => 'COMPLETED',
'result' => 'SUCCESS',
'data' => [
],
'errorMessage' => 'Insufficient funds',
'errorCode' => 'INSUFFICIENT_FUNDS',
'retryCount' => 0,
'maxRetries' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback"
payload := strings.NewReader("{\n \"eventType\": \"CARD_OPERATION_TRANSACTION\",\n \"eventId\": \"evt-12345678\",\n \"timestamp\": 1640995200000,\n \"tenantId\": \"wsb-12345678\",\n \"accountId\": \"wsb-account-123\",\n \"cardId\": \"card-12345678\",\n \"cardholderId\": \"ch-12345678\",\n \"transactionId\": \"tx-12345678\",\n \"workOrderId\": \"wo-12345678\",\n \"status\": \"COMPLETED\",\n \"result\": \"SUCCESS\",\n \"data\": {},\n \"errorMessage\": \"Insufficient funds\",\n \"errorCode\": \"INSUFFICIENT_FUNDS\",\n \"retryCount\": 0,\n \"maxRetries\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"CARD_OPERATION_TRANSACTION\",\n \"eventId\": \"evt-12345678\",\n \"timestamp\": 1640995200000,\n \"tenantId\": \"wsb-12345678\",\n \"accountId\": \"wsb-account-123\",\n \"cardId\": \"card-12345678\",\n \"cardholderId\": \"ch-12345678\",\n \"transactionId\": \"tx-12345678\",\n \"workOrderId\": \"wo-12345678\",\n \"status\": \"COMPLETED\",\n \"result\": \"SUCCESS\",\n \"data\": {},\n \"errorMessage\": \"Insufficient funds\",\n \"errorCode\": \"INSUFFICIENT_FUNDS\",\n \"retryCount\": 0,\n \"maxRetries\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventType\": \"CARD_OPERATION_TRANSACTION\",\n \"eventId\": \"evt-12345678\",\n \"timestamp\": 1640995200000,\n \"tenantId\": \"wsb-12345678\",\n \"accountId\": \"wsb-account-123\",\n \"cardId\": \"card-12345678\",\n \"cardholderId\": \"ch-12345678\",\n \"transactionId\": \"tx-12345678\",\n \"workOrderId\": \"wo-12345678\",\n \"status\": \"COMPLETED\",\n \"result\": \"SUCCESS\",\n \"data\": {},\n \"errorMessage\": \"Insufficient funds\",\n \"errorCode\": \"INSUFFICIENT_FUNDS\",\n \"retryCount\": 0,\n \"maxRetries\": 3\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"code": 200,
"msg": "Success",
"eventId": "evt-12345678",
"processingTime": 1640995200000
}Webhooks
Webhook Callback
Receives FinCard webhook events. Verifies platform signature.
POST
/
api
/
v2.1
/
fincard
/
virtual
/
webhook
/
callback
Webhook Callback
curl --request POST \
--url https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback \
--header 'Content-Type: application/json' \
--data '
{
"eventType": "CARD_OPERATION_TRANSACTION",
"eventId": "evt-12345678",
"timestamp": 1640995200000,
"tenantId": "wsb-12345678",
"accountId": "wsb-account-123",
"cardId": "card-12345678",
"cardholderId": "ch-12345678",
"transactionId": "tx-12345678",
"workOrderId": "wo-12345678",
"status": "COMPLETED",
"result": "SUCCESS",
"data": {},
"errorMessage": "Insufficient funds",
"errorCode": "INSUFFICIENT_FUNDS",
"retryCount": 0,
"maxRetries": 3
}
'import requests
url = "https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback"
payload = {
"eventType": "CARD_OPERATION_TRANSACTION",
"eventId": "evt-12345678",
"timestamp": 1640995200000,
"tenantId": "wsb-12345678",
"accountId": "wsb-account-123",
"cardId": "card-12345678",
"cardholderId": "ch-12345678",
"transactionId": "tx-12345678",
"workOrderId": "wo-12345678",
"status": "COMPLETED",
"result": "SUCCESS",
"data": {},
"errorMessage": "Insufficient funds",
"errorCode": "INSUFFICIENT_FUNDS",
"retryCount": 0,
"maxRetries": 3
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
eventType: 'CARD_OPERATION_TRANSACTION',
eventId: 'evt-12345678',
timestamp: 1640995200000,
tenantId: 'wsb-12345678',
accountId: 'wsb-account-123',
cardId: 'card-12345678',
cardholderId: 'ch-12345678',
transactionId: 'tx-12345678',
workOrderId: 'wo-12345678',
status: 'COMPLETED',
result: 'SUCCESS',
data: {},
errorMessage: 'Insufficient funds',
errorCode: 'INSUFFICIENT_FUNDS',
retryCount: 0,
maxRetries: 3
})
};
fetch('https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'eventType' => 'CARD_OPERATION_TRANSACTION',
'eventId' => 'evt-12345678',
'timestamp' => 1640995200000,
'tenantId' => 'wsb-12345678',
'accountId' => 'wsb-account-123',
'cardId' => 'card-12345678',
'cardholderId' => 'ch-12345678',
'transactionId' => 'tx-12345678',
'workOrderId' => 'wo-12345678',
'status' => 'COMPLETED',
'result' => 'SUCCESS',
'data' => [
],
'errorMessage' => 'Insufficient funds',
'errorCode' => 'INSUFFICIENT_FUNDS',
'retryCount' => 0,
'maxRetries' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback"
payload := strings.NewReader("{\n \"eventType\": \"CARD_OPERATION_TRANSACTION\",\n \"eventId\": \"evt-12345678\",\n \"timestamp\": 1640995200000,\n \"tenantId\": \"wsb-12345678\",\n \"accountId\": \"wsb-account-123\",\n \"cardId\": \"card-12345678\",\n \"cardholderId\": \"ch-12345678\",\n \"transactionId\": \"tx-12345678\",\n \"workOrderId\": \"wo-12345678\",\n \"status\": \"COMPLETED\",\n \"result\": \"SUCCESS\",\n \"data\": {},\n \"errorMessage\": \"Insufficient funds\",\n \"errorCode\": \"INSUFFICIENT_FUNDS\",\n \"retryCount\": 0,\n \"maxRetries\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback")
.header("Content-Type", "application/json")
.body("{\n \"eventType\": \"CARD_OPERATION_TRANSACTION\",\n \"eventId\": \"evt-12345678\",\n \"timestamp\": 1640995200000,\n \"tenantId\": \"wsb-12345678\",\n \"accountId\": \"wsb-account-123\",\n \"cardId\": \"card-12345678\",\n \"cardholderId\": \"ch-12345678\",\n \"transactionId\": \"tx-12345678\",\n \"workOrderId\": \"wo-12345678\",\n \"status\": \"COMPLETED\",\n \"result\": \"SUCCESS\",\n \"data\": {},\n \"errorMessage\": \"Insufficient funds\",\n \"errorCode\": \"INSUFFICIENT_FUNDS\",\n \"retryCount\": 0,\n \"maxRetries\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.finhub.cloud/api/v2.1/fincard/virtual/webhook/callback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventType\": \"CARD_OPERATION_TRANSACTION\",\n \"eventId\": \"evt-12345678\",\n \"timestamp\": 1640995200000,\n \"tenantId\": \"wsb-12345678\",\n \"accountId\": \"wsb-account-123\",\n \"cardId\": \"card-12345678\",\n \"cardholderId\": \"ch-12345678\",\n \"transactionId\": \"tx-12345678\",\n \"workOrderId\": \"wo-12345678\",\n \"status\": \"COMPLETED\",\n \"result\": \"SUCCESS\",\n \"data\": {},\n \"errorMessage\": \"Insufficient funds\",\n \"errorCode\": \"INSUFFICIENT_FUNDS\",\n \"retryCount\": 0,\n \"maxRetries\": 3\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"code": 200,
"msg": "Success",
"eventId": "evt-12345678",
"processingTime": 1640995200000
}Headers
FinCard platform signature
Body
application/json
Webhook event data
Webhook event data
Event type
Example:
"CARD_OPERATION_TRANSACTION"
Event ID
Example:
"evt-12345678"
Timestamp
Example:
1640995200000
Tenant ID
Example:
"wsb-12345678"
Account ID
Example:
"wsb-account-123"
Card ID (for card events)
Example:
"card-12345678"
Cardholder ID (for cardholder events)
Example:
"ch-12345678"
Transaction ID (for transaction events)
Example:
"tx-12345678"
Work order ID (for work order events)
Example:
"wo-12345678"
Event status
Example:
"COMPLETED"
Event result
Example:
"SUCCESS"
Event data payload
Show child attributes
Show child attributes
Error message (if any)
Example:
"Insufficient funds"
Error code (if any)
Example:
"INSUFFICIENT_FUNDS"
Retry count
Example:
0
Max retries
Example:
3
Response
Webhook processed successfully
⌘I