Ledga
POST/trancodes/{id}/validate-params

Validate a parameter payload against a transaction code's params_schema

Dry-run check of a params payload against the transaction code's params_schema. Returns 200 with valid: true when all required parameters are supplied and types match, or 422 with a per-field errors map otherwise. Useful before invoking the trancode to surface validation errors without creating a transaction.

Parameters

NameInTypeDescription
idrequired path string
uuid
Transaction Code UUID

Request bodyrequired

FieldTypeDescription
params object Parameter payload to validate against the trancode's params_schema. Map of parameter name → value.

Responses

200Parameters are valid
{
  "success": true,
  "data": {
    "valid": true,
    "message": "Parameters are valid"
  }
}
401Unauthenticated
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
403Forbidden
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
404Transaction code not found
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
422Parameter validation failed
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}

Examples

curl -X POST https://ledga.io/api/v1/trancodes/{id}/validate-params \
  -H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "amount": "100.00",
    "from_account": "1000",
    "to_account": "4000"
  }
}'

← All endpoints