Added

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/trade
  • POST /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)

ruleNameWhen it's returnedExample errorMessage
MANDATORYThe destination requires an IBAN, but none was provided.IBAN is mandatory.
ALLOWED CHARACTER SETThe IBAN contains characters other than letters (A–Z, a–z) and digits (0–9).IBAN can only contain abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
PREFIX VALUEThe IBAN doesn't start with the destination country's code.IBAN must start with ES
FIX LENGTHThe IBAN isn't the right length for the destination country.IBAN must be 24 characters.
FORMAT IBANThe IBAN passes the rules above, but we can't find the bank it belongs to.Invalid IBAN

BIC errors (fieldIdentifier: BankCode)

ruleNameWhen it's returnedExample errorMessage
FORMAT BICThe 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 fxId comes first. On Instruct, if the fxId is invalid, you get INS00001 "Trade cannot be found" before any IBAN or BIC error.

Changed: INS00006 now means a BIC mismatch only

INS00006 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 on fieldIdentifier and ruleName together, because a rule name such as MANDATORY applies to more than one field.
  • Don't match on errorMessage, because the text varies by country. errorCode is empty in invalidRules entries.
  • Check every entry in invalidRules, not just the first.
  • Treat INS00006 as "the BIC doesn't match this IBAN": check the BIC with your beneficiary.

All of these errors still return HTTP 400.