Skip to content

Commit 882da37

Browse files
Merge pull request #10 from wegift/wenbhook-denom-changes
Add denomination support documentation to product.update webhook
2 parents b4e4a74 + a712e73 commit 882da37

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

reference/2024-02-05/webhook/product.update.mdx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,54 @@ Use the `product_code` to identify the product that was updated, then refer to t
2424
You should store the `timestamp` and discard any events that are older than
2525
the last event you received.
2626
</Info>
27+
28+
## Denomination Structure
29+
30+
The `denominations` object within both `old_state` and `new_state` represents the available purchase amounts for a product. It has the following structure:
31+
32+
### Properties
33+
34+
- `type` - The denomination type, either:
35+
- `"fixed"` - Product has predetermined fixed denominations
36+
- `"open"` - Product accepts any amount within specified range
37+
38+
- `available_list` - Array of strings representing available denomination amounts (only for `"fixed"` type)
39+
40+
- `minimum_value` - String representing the minimum purchase amount (only for `"open"` type)
41+
42+
- `maximum_value` - String representing the maximum purchase amount (only for `"open"` type)
43+
44+
### Usage Examples
45+
46+
#### Fixed Denominations
47+
```json
48+
{
49+
"denominations": {
50+
"type": "fixed",
51+
"available_list": ["10", "25", "50", "100"]
52+
}
53+
}
54+
```
55+
56+
#### Open Denominations
57+
```json
58+
{
59+
"denominations": {
60+
"type": "open",
61+
"minimum_value": "5",
62+
"maximum_value": "500"
63+
}
64+
}
65+
```
66+
67+
#### Product Becomes Non-Orderable
68+
```json
69+
{
70+
"denominations": {
71+
"type": "fixed",
72+
"available_list": ["10", "25", "50"]
73+
}
74+
}
75+
```
76+
77+
When a product becomes non-orderable (`is_orderable: false`), the `denominations.available_list` continues to contain the same denomination values that were available when the product was orderable.

0 commit comments

Comments
 (0)