ClearBank.TestEndpoints (ClearBank v1.0.0)

Copy Markdown View Source

ClearBank API test endpoints for validating authentication and digital signatures.

Use these endpoints during integration development to verify your:

  • API token (authentication)
  • Digital signature computation (request signing)
  • Webhook subscription (FITestEvent)

These endpoints are available in both simulation and production.

Examples

client = ClearBank.default_client()

# Test auth only (GET — no DigitalSignature required)
{:ok, _} = ClearBank.TestEndpoints.ping(client)

# Test auth + DigitalSignature + trigger FITestEvent webhook
{:ok, %{"Message" => "hello!"}} = ClearBank.TestEndpoints.echo(client, "hello!")

Summary

Functions

POST /v1/Test — verifies authentication and digital signature.

GET /v1/Test — verifies your API token (authentication only).

Functions

echo(client, body \\ "ping")

POST /v1/Test — verifies authentication and digital signature.

Echoes back the body string in the response as %{"Message" => body}. If you are subscribed to the FITestEvent webhook, this also triggers a test webhook delivery to your configured endpoint.

Params

  • body - any string to echo back (default: "ping")

Status codes

CodeMeaning
200Auth + signature valid, body echoed
403Forbidden
409Duplicate X-Request-Id
500Internal server error
503Service unavailable

Examples

{:ok, %{"Message" => "hello world!"}} =
  ClearBank.TestEndpoints.echo(client, "hello world!")

ping(client)

GET /v1/Test — verifies your API token (authentication only).

No DigitalSignature header required. Returns 200 OK on success.

Status codes

CodeMeaning
200Authentication successful
403Forbidden — invalid or expired API token
500Internal server error
503Service unavailable

Examples

{:ok, _} = ClearBank.TestEndpoints.ping(client)