upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf_ <fiatjaf@gmail.com>2023-08-14 17:39:34 -0300
committerGitHub <noreply@github.com>2023-08-14 17:39:34 -0300
commita4666e8b2a2e74678c7668e52efc037da8deb884 (patch)
treed731eaacda643f70739ae6be927fc6851939c27e
parent72bb8a128b2d7d3c2c654644cd68d0d0fe58a3b1 (diff)
parentbb66504d745dbb22a6c727b3857e99dd184c4332 (diff)
Merge pull request #711 from ktecho/nip15_shipping_cost_per_product
-rw-r--r--15.md32
1 files changed, 24 insertions, 8 deletions
diff --git a/15.md b/15.md
index f9e4b79..5e3164e 100644
--- a/15.md
+++ b/15.md
@@ -8,7 +8,7 @@ Nostr Marketplace (for resilient marketplaces)
8 8
9> Based on https://github.com/lnbits/Diagon-Alley 9> Based on https://github.com/lnbits/Diagon-Alley
10 10
11> Implemented here https://github.com/lnbits/nostrmarket 11> Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market)
12 12
13## Terms 13## Terms
14 14
@@ -54,7 +54,7 @@ A merchant can publish these events:
54 { 54 {
55 "id": <String, UUID of the shipping zone, generated by the merchant>, 55 "id": <String, UUID of the shipping zone, generated by the merchant>,
56 "name": <String (optional), zone name>, 56 "name": <String (optional), zone name>,
57 "cost": <float, cost for shipping. The currency is defined at the stall level>, 57 "cost": <float, base cost for shipping. The currency is defined at the stall level>,
58 "countries": [<String, countries included in this zone>], 58 "countries": [<String, countries included in this zone>],
59 } 59 }
60 ] 60 ]
@@ -63,9 +63,12 @@ A merchant can publish these events:
63 63
64Fields that are not self-explanatory: 64Fields that are not self-explanatory:
65 - `shipping`: 65 - `shipping`:
66 - an array with possible shipping zones for this stall. The customer MUST choose exactly one shipping zone. 66 - an array with possible shipping zones for this stall.
67 - the customer MUST choose exactly one of those shipping zones.
67 - shipping to different zones can have different costs. For some goods (digital for example) the cost can be zero. 68 - shipping to different zones can have different costs. For some goods (digital for example) the cost can be zero.
68 - the `id` is an internal value used by the merchant. This value must be sent back as the customer selection. 69 - the `id` is an internal value used by the merchant. This value must be sent back as the customer selection.
70 - each shipping zone contains the base cost for orders made to that shipping zone, but a specific shipping cost per
71 product can also be specified if the shipping cost for that product is higher than what's specified by the base cost.
69 72
70**Event Tags**: 73**Event Tags**:
71```json 74```json
@@ -87,17 +90,30 @@ Fields that are not self-explanatory:
87 "price": <float, cost of product>, 90 "price": <float, cost of product>,
88 "quantity": <int, available items>, 91 "quantity": <int, available items>,
89 "specs": [ 92 "specs": [
90 [ <String, spec key>, <String, spec value>] 93 [<String, spec key>, <String, spec value>]
91 ] 94 ],
95 "shipping": [
96 {
97 "id": <String, UUID of the shipping zone. Must match one of the zones defined for the stall>,
98 "cost": <float, extra cost for shipping. The currency is defined at the stall level>,
99 }
100 ]
92} 101}
93``` 102```
94 103
95Fields that are not self-explanatory: 104Fields that are not self-explanatory:
96 - `specs`: 105 - `specs`:
97 - an array of key pair values. It allows for the Customer UI to present present product specifications in a structure mode. It also allows comparison between products 106 - an optional array of key pair values. It allows for the Customer UI to present product specifications in a structure mode. It also allows comparison between products
98 - eg: `[["operating_system", "Android 12.0"], ["screen_size", "6.4 inches"], ["connector_type", "USB Type C"]]` 107 - eg: `[["operating_system", "Android 12.0"], ["screen_size", "6.4 inches"], ["connector_type", "USB Type C"]]`
99 108
100_Open_: better to move `spec` in the `tags` section of the event? 109 _Open_: better to move `spec` in the `tags` section of the event?
110
111- `shipping`:
112 - an _optional_ array of extra costs to be used per shipping zone, only for products that require special shipping costs to be added to the base shipping cost defined in the stall
113 - the `id` should match the id of the shipping zone, as defined in the `shipping` field of the stall
114 - to calculate the total cost of shipping for an order, the user will choose a shipping option during checkout, and then the client must consider this costs:
115 - the `base cost from the stall` for the chosen shipping option
116 - the result of multiplying the product units by the `shipping costs specified in the product`, if any.
101 117
102**Event Tags**: 118**Event Tags**:
103```json 119```json
@@ -211,4 +227,4 @@ Customer support is handled over whatever communication method was specified. If
211 227
212## Additional 228## Additional
213 229
214Standard data models can be found here <a href="https://raw.githubusercontent.com/lnbits/nostrmarket/main/models.py">here</a> 230Standard data models can be found <a href="https://raw.githubusercontent.com/lnbits/nostrmarket/main/models.py">here</a>