You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: separation of concerns between pos and management services - #12
TL;DR - Separates the concerns between the services provided to POS devices on untrusted networks, and those for management purposes typically on trusted networks.
What this PR does
API is now split by responsibility
merchant-pos-api.yaml (new): what POS terminals call
onboarding
POST /v1/transactions/authorize. Public, with X-API-Key on authorize.
merchant-api.yaml (no authentication)
management of merchants
locations
terminals
models
Paths and operations do not change.
Contract changes to review
requestId is generated by the terminal, not the server. It is sent on as cardAuthorization.requestId.
The incoming payment requires walletAddress, instead of the nonexistent paymentPointerUrl.
The incoming payment id and walletAddress are format: uri, and walletAddress drops minLength: 1.
data is required in the authorization response.
Onboarding uses wallet address URLs, not payment pointers.
Onboarding declares 409, and authorize declares 401.
Also
Tags are kebab-case, as in Open Payments. AuthorizeTransaction is now authorizeTransaction.
Stale onboarding paths and the LINKED example are fixed.
Impact on merchant-api
Generate from both files.
WalletAddress and Data are no longer pointers, so remove the & in the authorization handler.
merchant-pos-api.yaml holds the endpoints that POS terminals call:
terminal onboarding and transaction authorization. merchant-api.yaml
keeps the management of merchants, locations, terminals and
manufacturer models.
- Authorization declares the X-API-Key scheme; onboarding is public.
- The management API declares no scheme yet and must not be exposed
publicly.
- Tags are PascalCase and the authorize operationId is camelCase.
- Fix stale onboarding paths and the onboarding status example.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
A critical unsatisfiable-schema defect requires paymentPointerUrl on AuthorizationIncomingPayment despite it being undefined and blocked by additionalProperties: false, guaranteeing validation failure on every successful authorize response, alongside unresolved documentation mismatches.
This PR implements separation of concerns by splitting the single Merchant API spec into two OpenAPI 3.0.3 documents: a new merchant-pos-api.yaml that contains the POS-device-facing endpoints (terminal onboarding + transaction authorization) and their supporting schemas, and the existing merchant-api.yaml which is trimmed down to merchant/location/terminal/manufacturer-model management. The POS spec adds an X-API-Key security scheme (with the onboarding endpoints marked public), while the management spec documents that it currently has no auth scheme. Tags in the management spec are renamed (Point of Sale (POS) → Terminal, POS Manufacturer Models → ManufacturerModel) and the POS onboarding tag/endpoints are removed, with cross-references pointing to the new file.
Changes:
Added merchant-pos-api.yaml containing the onboarding and /v1/transactions/authorize endpoints plus all Onboarding*, Authorization*, Field*, WrappedKeys and Problem schemas.
Removed those endpoints/schemas from merchant-api.yaml and updated its intro/onboarding docs to reference the new file.
Renamed tags and normalized the authorize operationId (AuthorizeTransaction → authorizeTransaction).
File
Description
merchant-pos-api.yaml
New POS-facing spec with onboarding + authorization paths, schemas, examples, and API-key security.
merchant-api.yaml
Removed POS endpoints/schemas, renamed tags consistently, and updated cross-references/auth notes.
Notes from the review:
I verified all internal $refs in the new POS spec resolve, confirmed no dangling references to the removed schemas remain in merchant-api.yaml, and confirmed the tag renames are applied consistently across all operations.
I flagged one functional bug (AuthorizationIncomingPayment requires a paymentPointerUrl property that doesn't exist with additionalProperties: false, making it unsatisfiable) and two documentation/example inconsistencies (an undocumented 409 status in the onboarding token description, and a non-UUID requestId example that conflicts with the declared format: uuid and stated conventions).
- requestId is generated by the terminal and is sent on as
cardAuthorization.requestId.
- The incoming payment id and walletAddress are URIs.
- Onboarding uses wallet address URLs instead of payment pointers.
- data is required in the authorization response.
- Tags are kebab-case.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
An unresolved active finding remains, flagging that the documented issuer-result path omits the transactionResponse wrapper and should be corrected before approval.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Incorrect authorization response path in POS docs
merchant-pos-api.yaml:131
Minor documentation inaccuracy: the response body is wrapped in transactionResponse, so the issuer result lives at transactionResponse.data.authorization (AuthorizationResponse → transactionResponse → data → authorization), not data.authorization. Consider updating the path so consumers of this standalone POS spec can locate the result correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR - Separates the concerns between the services provided to POS devices on untrusted networks, and those for management purposes typically on trusted networks.
What this PR does
API is now split by responsibility
merchant-pos-api.yaml(new): what POS terminals callPOST /v1/transactions/authorize. Public, withX-API-Keyon authorize.merchant-api.yaml(no authentication)Paths and operations do not change.
Contract changes to review
requestIdis generated by the terminal, not the server. It is sent on ascardAuthorization.requestId.walletAddress, instead of the nonexistentpaymentPointerUrl.idandwalletAddressareformat: uri, andwalletAddressdropsminLength: 1.datais required in the authorization response.409, and authorize declares401.Also
AuthorizeTransactionis nowauthorizeTransaction.LINKEDexample are fixed.Impact on merchant-api
WalletAddressandDataare no longer pointers, so remove the&in the authorization handler.