Skip to main content
POST
https://sandbox.finhub.cloud
/
api
/
v2.1
/
test
/
webhook-receiver
Testing
curl --request POST \
  --url https://sandbox.finhub.cloud/api/v2.1/test/webhook-receiver
{
  "success": true,
  "message": "Webhook received successfully",
  "receivedAt": "2024-01-15T10:30:00Z"
}

Testing

Testing utilities and mock endpoints for development and webhook testing.
Base URL: https://sandbox.finhub.cloud/api/v2.1/test

Webhook Test Endpoints

Success Receiver

POST /webhook-receiver

Failure Receiver

POST /webhook-receiver/fail

Slow Receiver

POST /webhook-receiver/slow

Webhook Receiver (Success)

Mock webhook receiver that always returns success. Use for testing webhook delivery.

Request

Any JSON payload will be accepted and logged.

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/test/webhook-receiver" \
  -H "Content-Type: application/json" \
  -H "X-FinHub-Signature: sha256=..." \
  -d '{
    "id": "evt_12345",
    "type": "customer.created",
    "timestamp": "2024-01-15T10:30:00Z",
    "data": {
      "customerId": "cust_12345"
    }
  }'
{
  "success": true,
  "message": "Webhook received successfully",
  "receivedAt": "2024-01-15T10:30:00Z"
}

Webhook Receiver (Failure)

Mock webhook receiver that always returns failure. Use for testing retry logic.

Request

Any JSON payload will be accepted but will return an error.

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/test/webhook-receiver/fail" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "evt_12345",
    "type": "customer.created"
  }'
{
  "success": false,
  "error": {
    "code": "SIMULATED_FAILURE",
    "message": "This endpoint always fails for testing purposes"
  }
}

Webhook Receiver (Slow)

Mock webhook receiver with delayed response. Use for testing timeout handling.

Request

delay
integer
Response delay in milliseconds (default: 5000, max: 30000)

Code Examples

curl -X POST "https://sandbox.finhub.cloud/api/v2.1/test/webhook-receiver/slow?delay=10000" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "evt_12345",
    "type": "customer.created"
  }'
{
  "success": true,
  "message": "Webhook received after delay",
  "delayMs": 10000,
  "receivedAt": "2024-01-15T10:30:10Z"
}

Test Data

Test Card Numbers

Card NumberTypeResult
4111111111111111VisaSuccess
5500000000000004MastercardSuccess
4000000000000002VisaDeclined
4000000000009995VisaInsufficient Funds

Test IBANs

IBANCountryResult
DE89370400440532013000GermanyValid
FR7630006000011234567890189FranceValid
GB82WEST12345698765432UKValid
INVALID123456789-Invalid

Test Customers

Customer IDStatusUse Case
cust_test_activeACTIVENormal operations
cust_test_pendingPENDING_VERIFICATIONVerification flows
cust_test_suspendedSUSPENDEDError handling

Sandbox Features

Simulated Responses

Control API responses with special headers

Forced Errors

Trigger specific error scenarios

Time Manipulation

Test time-sensitive operations

Rate Limit Testing

Test rate limit handling

Forcing Specific Responses

Use the X-Sandbox-Scenario header to trigger specific scenarios:
curl -X POST "https://sandbox.finhub.cloud/api/v2.1/..." \
  -H "X-Sandbox-Scenario: INSUFFICIENT_FUNDS"
ScenarioDescription
SUCCESSNormal success response
INSUFFICIENT_FUNDSSimulate insufficient funds
RATE_LIMITEDSimulate rate limit
TIMEOUTSimulate timeout
VALIDATION_ERRORSimulate validation error

Response Codes

CodeDescription
200Test endpoint success
500Simulated failure (fail endpoint)
504Timeout (slow endpoint with very long delay)