paymentRequest object as
TRANSACTION_INITIATED, plus a reason
saying what changed and what the values were before.
One event name for every kind of change. Read reason to learn which. Add a
case for a new reason rather than subscribing to a new event each time there
is another way for a transaction to move.
All deliveries share the common envelope
(eventId, eventName, timestamp, customerId), plus payloadVersion (2).
Reasons
A status change outranks an amount change. When a single update both moves
the status and changes the amount, you receive the status reason —
COMPLETED,
CANCELLED, EXPIRED or FAILED — and never AMOUNT_*. The new total is in
paymentRequest.amount either way, so nothing is lost.Card programmes on the settlement model
On the settlement model a card purchase is createdPENDING at authorisation and
the money moves when the merchant settles;
TRANSACTION_INITIATED says which card
purchases follow it. On top of the reasons above:
A declined authorisation, a card check and a refund create no payment request on
the settlement model, so none of them sends this event. Nor does an increase or
an advice after the purchase has settled, or been cancelled or expired: it
changes nothing.
Amounts are always the new total
paymentRequest.amount is what the transaction is worth now — never a
delta, in every case including AMOUNT_INCREASED and AMOUNT_REDUCED.
previousAmount is what it was, so the change is amount - previousAmount if
you need it.
Amounts are decimal strings.
amount and previousAmount are major-unit
decimal strings of paymentRequest.currency ("57.00"), so use a decimal type
to take the difference rather than a floating-point number. Either is omitted if
it can’t be stated exactly.Older format (no payloadVersion)
Older format (no payloadVersion)
Integrations created before this format was introduced receive the original payload: there is
no
payloadVersion field and amount is a number in major units, passed through as the transaction stores it, and previousAmount is a number. Coerce with Number() before comparing. We recommend moving to the format above, and we will contact
you before anything changes for your programme. Ask us
which format you receive.billing_purchase_total carries the total and amount carries the individual
leg.
Fields
Beyond thepaymentRequest object documented on
TRANSACTION_INITIATED:
Payment request statuses
Any of these can appear aspaymentRequest.status or previousStatus, and all
six are returned by the payment requests API.
A move into or out of
PENDING_TM or PENDING_CANCELLATION does not send an
event on its own. You see those statuses on an event only when the same update
also changed the amount, which reports AMOUNT_INCREASED or AMOUNT_REDUCED
with the monitoring status attached.Examples
One perreason, for the same £57 fuel purchase. Keys arrive sorted — see
verifying the signature.
- AMOUNT_INCREASED
- AMOUNT_REDUCED
- COMPLETED
- CANCELLED
- EXPIRED
- FAILED
2xx within 10 seconds. The body is ignored. See delivery behaviour for retries.
Test vector
Secrettest_secret_do_not_use and the AMOUNT_INCREASED body above, sent
exactly as this single line with no whitespace:
Orenda-Payload-Signature
7954d89e58e81f34797838536b318ad30f35fc52f5804c41046e5c4c7929fd54.
What does not send one
Deliberately silent, because none of these is a change to the transaction:- Internal bookkeeping. Monitoring states, and identifiers stamped on the row after the fact — see the statuses above.
- A cancellation you have only requested. It can still be reverted, so
CANCELLEDis sent when the cancellation is confirmed, not when it is asked for. - A retry of a failed payment. Re-posting with an idempotency key whose
first attempt failed reopens the same request; the
FAILEDtoPENDINGmove is not announced. - A re-write of the row that does not change it.
- An unconfirmed card hold released after 7 days. No payment request was
ever created, so there is nothing to update.
EXPIREDis a different case — an authorisation that was confirmed and then completed at zero.
AMOUNT_INCREASED
events and then a COMPLETED, so size for more of these than
TRANSACTION_INITIATED.
Not only cards
This fires for every transaction type you already receiveTRANSACTION_INITIATED for, not just card purchases. Bank transfers, direct
debits and batch items change status but not amount, so they send COMPLETED,
FAILED and CANCELLED only.
Duplicates and ordering
A change can be delivered more than once (retries and replays), so
see delivery behaviour. Dedupe on
eventId, which is distinct per change and is repeated rather than reissued
if the same change is delivered again.Do not build a key out of reason and the amounts. A purchase that goes
50 → 60 → 50 → 60 sends two AMOUNT_INCREASED events identical in every field
but eventId and timestamp, and the second one is a real increase you need.Arrival order is not delivery order. Events for one account are normally
delivered in order, but a redelivery can place an earlier change after a later
one. Order on the payload rather than on arrival:
previousStatus and
previousAmount say what state the change started from.So an event whose previousAmount does not match the total you are holding is
one of three things — one you have already applied, one that arrived early, or
one whose predecessor you never received. We attempt delivery; we do not
guarantee it. Treat a mismatch as “my state is stale” rather than as a sequence
you can always reassemble, and re-read the payment request, which is
authoritative.paymentRequest.amount is the total as of this event, not necessarily the
current one: a later change may already have happened by the time you process
it.COMPLETED and TRANSACTION_CREATED race.
A settled card purchase produces both, from two independent processors, so
either can arrive first. Do not wait for one before handling the other, and do
not treat their order as meaningful.