Skip to content

feat(MER-155): finalize endpoint for the terminal's final say - #17

Merged
beniaminmunteanu merged 6 commits into
mainfrom
beniamin/mer-155
Nov 20, 2026
Merged

beniaminmunteanu merged 6 commits into
mainfrom
beniamin/mer-155

Conversation

@beniaminmunteanu

@beniaminmunteanu beniaminmunteanu commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What

Adds POST /v1/transactions/{requestId}/finalize to the POS API, so the terminal has the final say on a transaction (MER-155).

After an approving /authorize, no money moves until the terminal sends its decision to /finalize.

The endpoint

Body: { "terminalId": "…", "outcome": "approve" | "reject" }.

Case Status
Approve, payment completed 200, data.status: completed, outgoingPaymentId
Reject, transaction cancelled 200, data.status: rejected
Same outcome repeated on a finalized transaction 200, same body
Approve accepted, payment not completed yet 202, data.status: pending (the terminal can approve again to check)
Unknown requestId, or another terminal's 404
Another /finalize for the transaction is running 409
The transaction's state doesn't allow this outcome 409
Payment or cancellation failed upstream 502 (the terminal can then reject)

The 200 and 202 bodies use the same transactionResponse envelope as /authorize. Authentication is the same API key as /authorize.

/authorize request and response shapes are unchanged. It gains a 409 for a reused requestId.

Problem types

New problems carry their own type, so the terminal branches on it instead of parsing detail:

Status type Terminal does
404 tag:interledger.org,2026:problems/transaction-not-found stops
409 tag:interledger.org,2026:problems/request-id-used uses a new requestId (/authorize)
409 tag:interledger.org,2026:problems/transaction-finalizing retries later
409 tag:interledger.org,2026:problems/outcome-not-allowed stops
502 tag:interledger.org,2026:problems/upstream-failed can send reject

@beniaminmunteanu
beniaminmunteanu marked this pull request as ready for review November 19, 2026 19:44
@beniaminmunteanu beniaminmunteanu self-assigned this Nov 19, 2026

@koekiebox koekiebox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment @beniaminmunteanu , but I am going to approve. 👍

Comment thread merchant-pos-api.yaml Resolved
@beniaminmunteanu
beniaminmunteanu merged commit 800cdb2 into main Nov 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants