API Update - Nov 2026
We've introduced safe retries for trade bookings. If you get a gateway timeout, you can now resubmit the booking without creating a duplicate. We've also made IBAN validation error messages clearer, so issues are quicker to spot and fix.
New: Safe retries with idempotency keys
You can now retry Book Trade and Submit Payment Order requests without the risk of creating a duplicate trade or payment.
Send a unique value in the optional x-idempotency-key header. If a request times out or your connection drops, retry it with the same key and the same request body. If the original request already succeeded, the API returns the original response instead of creating a new trade or payment.
Supported endpoints:
POST /api/v1/tradePOST /api/v1/paymentorder
This change is backward compatible. If you don't send the header, requests and responses work exactly as before.
For how retries work and the new IDM error codes, see Retry requests safely with idempotency keys.
Improved: Specific IBAN validation errors
The Validate, Instruct and Payment Order APIs now tell you exactly what's wrong with an IBAN.
Previously, an IBAN problem often returned 400 INS00006 with the message "Invalid BIC", even when the BIC was correct. IBAN problems now come back in the invalidRules array, in the same format as other validation errors.
IBAN errors (fieldIdentifier: IBAN)
ruleName | When it's returned | Example errorMessage |
|---|---|---|
MANDATORY | The destination requires an IBAN, but none was provided. | IBAN is mandatory. |
ALLOWED CHARACTER SET | The IBAN contains characters other than letters (A–Z, a–z) and digits (0–9). | IBAN can only contain abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 |
PREFIX VALUE | The IBAN doesn't start with the destination country's code. | IBAN must start with ES |
FIX LENGTH | The IBAN isn't the right length for the destination country. | IBAN must be 24 characters. |
FORMAT IBAN | The IBAN passes the rules above, but we can't find the bank it belongs to. | Invalid IBAN |
BIC errors (fieldIdentifier: BankCode)
ruleName | When it's returned | Example errorMessage |
|---|---|---|
FORMAT BIC | The SWIFT BIC isn't in a valid format. | Swift BIC Code must have a valid Swift BIC format |
Example response for an IBAN that's too short and a badly formatted BIC:
{
"status": "Incomplete",
"invalidRules": [
{
"fieldIdentifier": "IBAN",
"ruleName": "FIX LENGTH",
"fieldValue": "ES12345678912345678914",
"errorMessage": "IBAN must be 24 characters.",
"validationStatus": "Invalid"
},
{
"fieldIdentifier": "BankCode",
"ruleName": "FORMAT BIC",
"fieldValue": "123456",
"errorMessage": "Swift BIC Code must have a valid Swift BIC format",
"validationStatus": "Invalid"
}
]
}Things to know:
- One rule per field. Each field lists only the first rule it fails. Rules are checked in the order shown in the table, so an IBAN with the wrong prefix and the wrong length returns only
PREFIX VALUE. Fix it and validate again to see any further errors. - Unrecognised IBAN with no BIC. If we can't find the IBAN's bank and you didn't send a BIC, the response also includes an entry saying the BIC is mandatory. We can only work out the BIC from an IBAN we recognise.
- Invalid
fxIdcomes first. On Instruct, if thefxIdis invalid, you getINS00001"Trade cannot be found" before any IBAN or BIC error.
Changed: INS00006 now means a BIC mismatch only
INS00006 now means a BIC mismatch onlyINS00006 is now returned only when the IBAN passes all the checks above and we recognise its bank, but the BIC you sent doesn't belong to that bank.
{
"type": "https://docs.payments.stonex.io/reference/error-codes",
"title": "Bad Input",
"status": 400,
"detail": "Invalid BIC",
"traceId": "00-4c829cc4ab279577eac4c0e5a3ddf60d-106c1c5ad24f9ccd-01",
"errorCode": "INS00006"
}Action may be required. If your integration treats INS00006 as a general IBAN or BIC error, update it:
- Handle IBAN problems from
invalidRules. Match onfieldIdentifierandruleNametogether, because a rule name such asMANDATORYapplies to more than one field. - Don't match on
errorMessage, because the text varies by country.errorCodeis empty ininvalidRulesentries. - Check every entry in
invalidRules, not just the first. - Treat
INS00006as "the BIC doesn't match this IBAN": check the BIC with your beneficiary.
All of these errors still return HTTP 400.

