When it runs
The extension acts on thetransaction.received and transaction.resent events. It converts a Transaction when:
- the extension is enabled for your tenant, and
- the Transaction has a
currency, and - that
currencyis not yourbase_currency.
currency_values entry.
Which rate is used
The rate is the market rate from the Transaction’s currency to your base currency on the Transaction’s date, which is the UTC calendar day oftransacted_at. A Transaction with no transacted_at uses today’s rate.
A transacted_at in the future always means the timestamp reached Omneo wrong. The extension then uses the latest available rate instead of failing. Fix the timestamp at its source, because the stand-in rate is only an approximation.
Once a rate has been looked up for a currency and day, it is kept and reused for every later Transaction on that day, so all Transactions for that currency and day convert at the same rate.
What is recorded
The extension updates the Transaction with the pair and rate. Omneo stores them as one entry in the Transaction’scurrency_values:
If your tenant does not hold the currency pair yet, Omneo creates it with this rate. Resending the Transaction (
transaction.resent) replaces the entry rather than adding a second one. The entry appears in the Transaction event context and the Transaction API.
Waiting for conversion before loyalty
A Transaction created withneed_action set to true fires transaction.received instead of transaction.created. That gives the extension time to record the rate before any loyalty Reaction runs. The update fires transaction.updated, and a Reaction on that event releases the Transaction:
transaction.update action sets need_action to 0 and fires transaction.created. Your loyalty Reactions then run on transaction.created as normal, and can read the converted total from currency_values.
When a Transaction is not converted
A Transaction held atneed_action: true with an empty currency_values was not converted. Common causes are a currency the rate service does not price, a temporary rate service failure, or a very large Transaction payload. Ask your Omneo contact to check the cause, then resend the Transaction to convert it.