POST
/trancodes/{id}/validate-paramsValidate 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
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string uuid | Transaction Code UUID |
Request bodyrequired
| Field | Type | Description |
|---|---|---|
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"
}
}' use Ledga\Api\LedgaClient;
$ledga = new LedgaClient('sk_xxxxxxxx_your_secret');
$ledga->transactionCodes->validateParams('01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a', [
'amount' => '100.00', 'from_account' => '1000', 'to_account' => '4000',
]);