Validate a transaction
Use the validation endpoint to check whether a transaction request is valid before creating it.
Validation runs the same checks that occur during transaction creation but does not create or process a transaction. This allows you to confirm that your request meets all validation rules before submitting the payment.
POST /api/transactionRequests/validate
For the complete request and response schemas, see Validate transaction.
When to validate a transaction
You may want to validate a transaction request when you need to:
- Verify that all required fields are present
- Confirm that the request satisfies country and payment rules
- Check that the selected route is valid
- Preview the calculated FX route and value date
Validation is optional but useful when building or testing an integration.
Example request
{
"SendCurrency": "EUR",
"ReceiveValue": 100.00,
"Recipient": {
"Name": "Victoria Lau",
"RecipientReference": "Claim-51837",
"Country": "GB",
"Currency": "GBP",
"Account": {
"SortCode": "112233",
"AccountNumber": "22233445"
}
}
}Example response
If the request passes validation, the API returns the calculated transaction details.
The response includes the calculated payment route, including:
- Source currency and value
- Destination currency and value
- Exchange rate
- Value date
{
"Merchant": "Transfercorp UK Ltd",
"Recipient": {
"Country": "GB",
"Currency": "GBP",
"Name": "Victoria Lau",
"RecipientReference": "Claim-51837"
},
"Route": {
"DestinationCurrency": {
"Currency": "GBP",
"Value": 100.0
},
"ExchangeRate": 0.8518381869,
"SourceCurrency": {
"Currency": "EUR",
"Value": 117.39
}
},
"Status": "Pending",
"TransactionId": "6d0b145b-ca8f-4611-a21c-9bf3380ad5c9"
}Validation errors
If the request fails validation, the API returns a 400 Bad Request response.
The response includes a ModelState object. Each entry in ModelState identifies the field that failed validation and provides an error message describing the issue.
Example
{
"Code": "ArgumentInvalid",
"Message": "One or more arguments passed to the API call have an invalid value.",
"ModelState": {
"request.Recipient.RecipientReference": {
"Errors": [
{
"ErrorMessage": "This field is required."
}
]
}
}
}Next step
After the request passes validation, send the transaction.
Updated 24 days ago