Skip to content

feat!: Update the Order schema to make currency a required field#283

Open
deinck6 wants to merge 6 commits intoUniversal-Commerce-Protocol:mainfrom
deinck6:main
Open

feat!: Update the Order schema to make currency a required field#283
deinck6 wants to merge 6 commits intoUniversal-Commerce-Protocol:mainfrom
deinck6:main

Conversation

@deinck6
Copy link
Copy Markdown
Contributor

@deinck6 deinck6 commented Mar 20, 2026

Description

This PR is making the currency field in Order required. This is a followup change from PR 210. When adding the currency field to the Order schema the intention was to make it required during the next version update / breaking change.

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing
    functionality to not work as expected, including removal of schema files
    or fields
    )

Is this a Breaking Change or Removal?

If you checked "Breaking change" above, or if you are removing any schema
files or fields:

  • I have added ! to my PR title (e.g., feat!: remove field).
  • I have added justification below.
## Breaking Changes / Removal Justification

The total values within the Order capability are only represented by an amount and rely on platforms having context of the currency established during Checkout. Currency has sense been added to the Order schema but as an optional field to avoid a breaking change. The intention was to make this required during the next version update / breaking change. Currency should be a required field because capabilities are meant to function independently of one another and the monetary values contained within Order are incomplete without this context. 

@deinck6 deinck6 marked this pull request as ready for review March 20, 2026 17:22
@deinck6 deinck6 requested review from a team as code owners March 20, 2026 17:22
"permalink_url",
"line_items",
"fulfillment",
"currency",
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.

For future reference: you can also use the transition schema attribute to avoid an immediate breaking change (example:

"update": {"transition": {"from": "required", "to": "omit", "description": "ID is provided as argument on the request, this ID is redundant."}},
).

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.

+1 please add a transition annotation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this needed if I am making the field required immediately for the new version? My understanding was this annotation signals a future change

@sinhanurag sinhanurag added the TC review Ready for TC review label Mar 29, 2026
Copy link
Copy Markdown

@sinhanurag sinhanurag left a comment

Choose a reason for hiding this comment

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

We should get this in before the next version cut.

Copy link
Copy Markdown
Contributor

@igrigorik igrigorik left a comment

Choose a reason for hiding this comment

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

LGTM, modulo missing transition annotation: please add, and we can land this.

"permalink_url",
"line_items",
"fulfillment",
"currency",
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.

+1 please add a transition annotation.

"type": "string",
"description": "ISO 4217 currency code. MUST match the currency from the originating checkout session."
"description": "ISO 4217 currency code. MUST match the currency from the originating checkout session.",
"ucp_request": {
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.

shouldn't it be request: omit? currency is a response only attribute, the caller does not provide currency.

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.

A fly-by comment: I think we need to revisit Order capability schema more holistically on top of the currency field - given it currently doesn't have any associated operations (besides webhook support - of which currency will be required in the "request" body or webhook payload that business sends to platform), none of the required attributes are actually marked as response-only..

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.

@jingyli yes, that's #276 -- let's tackle that there. cc @richmolj

@igrigorik igrigorik added this to the Working Draft milestone Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TC review Ready for TC review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants