adobe / adobe/commerce-events

In Place Order Event : Order ID Type: String or Integer?

Open
#202 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10
Forks
7
PR merge metrics
No merged PRs in 30d

Description

I noticed that in the storefront-events-sdk schema for place-order, the orderId is defined as an integer:

https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/types/schemas/order.ts#L5

```
export type Order = {
...
orderId: string;
...
```

https://github.com/adobe/commerce-events/blob/v1.15.0/examples/events/example-contexts/mock-order-context.md
```
const mockOrder = {
...
orderId: 111111,
...
```

And in the Snowplow example event payload (v1.15.0), it is also defined as:
https://github.com/adobe/commerce-events/blob/v1.15.0/examples/events/snowplow-debugger/order.json
```
"orderId": {
"type": "integer"
},
```

**Questions**

1. Should orderId strictly remain an integer, or should it support string as well?
3. If the type changes (e.g., from integer to string or to a union type), could this impact the Live Search Dashboard, specifically the Conversion Rate metric?

To avoid potential integration or validation issues, it would be helpful to align the schema with the example (or vice versa) to ensure consistency and prevent issues if any.

Thanks

Contributor guide

Open the contributing guide

Research direction

Compare the orderId definition in packages/storefront-events-sdk/src/types/schemas/order.ts with examples/events/example-contexts/mock-order-context.md and examples/events/snowplow-debugger/order.json at v1.15.0. First determine the intended accepted type and check the potential Live Search Dashboard Conversion Rate impact. Done means the schema and examples consistently document and validate the decided behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.