@spree/docs 0.1.263 → 0.1.265
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1615,6 +1615,8 @@ paths:
|
|
|
1615
1615
|
default: true
|
|
1616
1616
|
country_codes:
|
|
1617
1617
|
- US
|
|
1618
|
+
country_isos:
|
|
1619
|
+
- US
|
|
1618
1620
|
supported_locales:
|
|
1619
1621
|
- en
|
|
1620
1622
|
- id: cart_gbHJdmfrXB
|
|
@@ -1734,6 +1736,8 @@ paths:
|
|
|
1734
1736
|
default: true
|
|
1735
1737
|
country_codes:
|
|
1736
1738
|
- US
|
|
1739
|
+
country_isos:
|
|
1740
|
+
- US
|
|
1737
1741
|
supported_locales:
|
|
1738
1742
|
- en
|
|
1739
1743
|
meta:
|
|
@@ -1885,6 +1889,8 @@ paths:
|
|
|
1885
1889
|
default: true
|
|
1886
1890
|
country_codes:
|
|
1887
1891
|
- US
|
|
1892
|
+
country_isos:
|
|
1893
|
+
- US
|
|
1888
1894
|
supported_locales:
|
|
1889
1895
|
- en
|
|
1890
1896
|
schema:
|
|
@@ -2085,6 +2091,8 @@ paths:
|
|
|
2085
2091
|
default: true
|
|
2086
2092
|
country_codes:
|
|
2087
2093
|
- US
|
|
2094
|
+
country_isos:
|
|
2095
|
+
- US
|
|
2088
2096
|
supported_locales:
|
|
2089
2097
|
- en
|
|
2090
2098
|
schema:
|
|
@@ -2283,6 +2291,8 @@ paths:
|
|
|
2283
2291
|
default: true
|
|
2284
2292
|
country_codes:
|
|
2285
2293
|
- US
|
|
2294
|
+
country_isos:
|
|
2295
|
+
- US
|
|
2286
2296
|
supported_locales:
|
|
2287
2297
|
- en
|
|
2288
2298
|
schema:
|
|
@@ -2611,6 +2621,8 @@ paths:
|
|
|
2611
2621
|
default: true
|
|
2612
2622
|
country_codes:
|
|
2613
2623
|
- US
|
|
2624
|
+
country_isos:
|
|
2625
|
+
- US
|
|
2614
2626
|
supported_locales:
|
|
2615
2627
|
- en
|
|
2616
2628
|
schema:
|
|
@@ -2926,6 +2938,8 @@ paths:
|
|
|
2926
2938
|
default: true
|
|
2927
2939
|
country_codes:
|
|
2928
2940
|
- US
|
|
2941
|
+
country_isos:
|
|
2942
|
+
- US
|
|
2929
2943
|
supported_locales:
|
|
2930
2944
|
- en
|
|
2931
2945
|
schema:
|
|
@@ -3122,6 +3136,8 @@ paths:
|
|
|
3122
3136
|
default: true
|
|
3123
3137
|
country_codes:
|
|
3124
3138
|
- US
|
|
3139
|
+
country_isos:
|
|
3140
|
+
- US
|
|
3125
3141
|
supported_locales:
|
|
3126
3142
|
- en
|
|
3127
3143
|
schema:
|
|
@@ -3321,6 +3337,8 @@ paths:
|
|
|
3321
3337
|
default: true
|
|
3322
3338
|
country_codes:
|
|
3323
3339
|
- US
|
|
3340
|
+
country_isos:
|
|
3341
|
+
- US
|
|
3324
3342
|
supported_locales:
|
|
3325
3343
|
- en
|
|
3326
3344
|
schema:
|
|
@@ -3607,6 +3625,8 @@ paths:
|
|
|
3607
3625
|
default: true
|
|
3608
3626
|
country_codes:
|
|
3609
3627
|
- US
|
|
3628
|
+
country_isos:
|
|
3629
|
+
- US
|
|
3610
3630
|
supported_locales:
|
|
3611
3631
|
- en
|
|
3612
3632
|
schema:
|
|
@@ -3851,6 +3871,8 @@ paths:
|
|
|
3851
3871
|
default: true
|
|
3852
3872
|
country_codes:
|
|
3853
3873
|
- US
|
|
3874
|
+
country_isos:
|
|
3875
|
+
- US
|
|
3854
3876
|
supported_locales:
|
|
3855
3877
|
- en
|
|
3856
3878
|
schema:
|
|
@@ -4084,6 +4106,8 @@ paths:
|
|
|
4084
4106
|
default: true
|
|
4085
4107
|
country_codes:
|
|
4086
4108
|
- US
|
|
4109
|
+
country_isos:
|
|
4110
|
+
- US
|
|
4087
4111
|
supported_locales:
|
|
4088
4112
|
- en
|
|
4089
4113
|
schema:
|
|
@@ -4305,6 +4329,8 @@ paths:
|
|
|
4305
4329
|
default: true
|
|
4306
4330
|
country_codes:
|
|
4307
4331
|
- US
|
|
4332
|
+
country_isos:
|
|
4333
|
+
- US
|
|
4308
4334
|
supported_locales:
|
|
4309
4335
|
- en
|
|
4310
4336
|
schema:
|
|
@@ -4535,6 +4561,8 @@ paths:
|
|
|
4535
4561
|
default: true
|
|
4536
4562
|
country_codes:
|
|
4537
4563
|
- US
|
|
4564
|
+
country_isos:
|
|
4565
|
+
- US
|
|
4538
4566
|
supported_locales:
|
|
4539
4567
|
- en
|
|
4540
4568
|
schema:
|
|
@@ -4688,6 +4716,8 @@ paths:
|
|
|
4688
4716
|
default: true
|
|
4689
4717
|
country_codes:
|
|
4690
4718
|
- US
|
|
4719
|
+
country_isos:
|
|
4720
|
+
- US
|
|
4691
4721
|
supported_locales:
|
|
4692
4722
|
- en
|
|
4693
4723
|
schema:
|
|
@@ -5396,6 +5426,8 @@ paths:
|
|
|
5396
5426
|
default: true
|
|
5397
5427
|
country_codes:
|
|
5398
5428
|
- US
|
|
5429
|
+
country_isos:
|
|
5430
|
+
- US
|
|
5399
5431
|
supported_locales:
|
|
5400
5432
|
- en
|
|
5401
5433
|
schema:
|
|
@@ -5583,6 +5615,8 @@ paths:
|
|
|
5583
5615
|
default: true
|
|
5584
5616
|
country_codes:
|
|
5585
5617
|
- US
|
|
5618
|
+
country_isos:
|
|
5619
|
+
- US
|
|
5586
5620
|
supported_locales:
|
|
5587
5621
|
- en
|
|
5588
5622
|
schema:
|
|
@@ -5890,6 +5924,8 @@ paths:
|
|
|
5890
5924
|
default: true
|
|
5891
5925
|
country_codes:
|
|
5892
5926
|
- US
|
|
5927
|
+
country_isos:
|
|
5928
|
+
- US
|
|
5893
5929
|
supported_locales:
|
|
5894
5930
|
- en
|
|
5895
5931
|
schema:
|
|
@@ -7014,6 +7050,8 @@ paths:
|
|
|
7014
7050
|
default: true
|
|
7015
7051
|
country_codes:
|
|
7016
7052
|
- US
|
|
7053
|
+
country_isos:
|
|
7054
|
+
- US
|
|
7017
7055
|
supported_locales:
|
|
7018
7056
|
- en
|
|
7019
7057
|
meta:
|
|
@@ -7336,6 +7374,8 @@ paths:
|
|
|
7336
7374
|
default: true
|
|
7337
7375
|
country_codes:
|
|
7338
7376
|
- US
|
|
7377
|
+
country_isos:
|
|
7378
|
+
- US
|
|
7339
7379
|
supported_locales:
|
|
7340
7380
|
- en
|
|
7341
7381
|
schema:
|
|
@@ -8955,6 +8995,8 @@ paths:
|
|
|
8955
8995
|
default: true
|
|
8956
8996
|
country_codes:
|
|
8957
8997
|
- US
|
|
8998
|
+
country_isos:
|
|
8999
|
+
- US
|
|
8958
9000
|
supported_locales:
|
|
8959
9001
|
- en
|
|
8960
9002
|
- es
|
|
@@ -8973,6 +9015,9 @@ paths:
|
|
|
8973
9015
|
country_codes:
|
|
8974
9016
|
- DE
|
|
8975
9017
|
- FR
|
|
9018
|
+
country_isos:
|
|
9019
|
+
- DE
|
|
9020
|
+
- FR
|
|
8976
9021
|
supported_locales:
|
|
8977
9022
|
- de
|
|
8978
9023
|
- en
|
|
@@ -9060,6 +9105,9 @@ paths:
|
|
|
9060
9105
|
country_codes:
|
|
9061
9106
|
- DE
|
|
9062
9107
|
- FR
|
|
9108
|
+
country_isos:
|
|
9109
|
+
- DE
|
|
9110
|
+
- FR
|
|
9063
9111
|
supported_locales:
|
|
9064
9112
|
- de
|
|
9065
9113
|
- en
|
|
@@ -9143,6 +9191,9 @@ paths:
|
|
|
9143
9191
|
country_codes:
|
|
9144
9192
|
- DE
|
|
9145
9193
|
- FR
|
|
9194
|
+
country_isos:
|
|
9195
|
+
- DE
|
|
9196
|
+
- FR
|
|
9146
9197
|
supported_locales:
|
|
9147
9198
|
- de
|
|
9148
9199
|
- en
|
|
@@ -10570,9 +10621,11 @@ paths:
|
|
|
10570
10621
|
- api_key: []
|
|
10571
10622
|
bearer_auth: []
|
|
10572
10623
|
description: |
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10624
|
+
Invites a person to the node by email (a `cinv_...` id) and sends the invite email.
|
|
10625
|
+
This is an invitation even when the email already belongs to a customer: they join
|
|
10626
|
+
by accepting the emailed token, which proves they own the address and agree to join.
|
|
10627
|
+
The response is the same either way, so it does not reveal whether the email has an
|
|
10628
|
+
account.
|
|
10576
10629
|
x-codeSamples:
|
|
10577
10630
|
- lang: javascript
|
|
10578
10631
|
label: Spree SDK
|
|
@@ -10584,9 +10637,8 @@ paths:
|
|
|
10584
10637
|
publishableKey: '<api-key>',
|
|
10585
10638
|
})
|
|
10586
10639
|
|
|
10587
|
-
//
|
|
10588
|
-
|
|
10589
|
-
const member = await client.companies.members.create(
|
|
10640
|
+
// Always an emailed invitation (cinv_…), even for an existing customer.
|
|
10641
|
+
const invitation = await client.companies.members.create(
|
|
10590
10642
|
'comp_86Rf07xd4z',
|
|
10591
10643
|
{ customer_email: 'colleague@acme.test' },
|
|
10592
10644
|
{ token: '<token>' },
|
|
@@ -10604,14 +10656,15 @@ paths:
|
|
|
10604
10656
|
type: string
|
|
10605
10657
|
responses:
|
|
10606
10658
|
'201':
|
|
10607
|
-
description:
|
|
10659
|
+
description: invitation sent
|
|
10608
10660
|
content:
|
|
10609
10661
|
application/json:
|
|
10610
10662
|
example:
|
|
10611
|
-
id:
|
|
10612
|
-
company_id: comp_UkLWZg9DAJ
|
|
10613
|
-
customer_id: cust_gbHJdmfrXB
|
|
10663
|
+
id: cinv_UkLWZg9DAJ
|
|
10614
10664
|
email: colleague@acme.test
|
|
10665
|
+
expires_at: '2026-02-14T12:00:00.000Z'
|
|
10666
|
+
company_id: comp_UkLWZg9DAJ
|
|
10667
|
+
status: pending
|
|
10615
10668
|
requestBody:
|
|
10616
10669
|
content:
|
|
10617
10670
|
application/json:
|
|
@@ -10936,7 +10989,6 @@ paths:
|
|
|
10936
10989
|
compare_at_amount:
|
|
10937
10990
|
thumbnail_url:
|
|
10938
10991
|
option_values: []
|
|
10939
|
-
digital_links: []
|
|
10940
10992
|
fulfillments:
|
|
10941
10993
|
- id: ful_UkLWZg9DAJ
|
|
10942
10994
|
number: R1001-F1
|
|
@@ -11080,6 +11132,8 @@ paths:
|
|
|
11080
11132
|
default: true
|
|
11081
11133
|
country_codes:
|
|
11082
11134
|
- US
|
|
11135
|
+
country_isos:
|
|
11136
|
+
- US
|
|
11083
11137
|
supported_locales:
|
|
11084
11138
|
- en
|
|
11085
11139
|
meta:
|
|
@@ -13668,7 +13722,6 @@ components:
|
|
|
13668
13722
|
- compare_at_amount
|
|
13669
13723
|
- thumbnail_url
|
|
13670
13724
|
- option_values
|
|
13671
|
-
- digital_links
|
|
13672
13725
|
x-typelizer: true
|
|
13673
13726
|
Locale:
|
|
13674
13727
|
type: object
|
|
@@ -13706,6 +13759,10 @@ components:
|
|
|
13706
13759
|
type: array
|
|
13707
13760
|
items:
|
|
13708
13761
|
type: string
|
|
13762
|
+
country_isos:
|
|
13763
|
+
type: array
|
|
13764
|
+
items:
|
|
13765
|
+
type: string
|
|
13709
13766
|
supported_locales:
|
|
13710
13767
|
type: array
|
|
13711
13768
|
items:
|
|
@@ -13722,6 +13779,7 @@ components:
|
|
|
13722
13779
|
- tax_inclusive
|
|
13723
13780
|
- default
|
|
13724
13781
|
- country_codes
|
|
13782
|
+
- country_isos
|
|
13725
13783
|
- supported_locales
|
|
13726
13784
|
x-typelizer: true
|
|
13727
13785
|
MediaEvent:
|
|
@@ -12,7 +12,7 @@ Webhooks are built on top of Spree's [event system](events.md), providing:
|
|
|
12
12
|
- **Multi-store support** - Each store has its own webhook endpoints
|
|
13
13
|
- **Event filtering** - Subscribe to specific events or patterns with wildcards
|
|
14
14
|
- **Secure delivery** - HMAC-SHA256 signatures for payload verification
|
|
15
|
-
- **Failure handling** - Failed deliveries are
|
|
15
|
+
- **Failure handling** - Failed deliveries are retried automatically and can be re-sent by hand, and an endpoint that keeps failing is disabled
|
|
16
16
|
- **Full audit trail** - Track every delivery attempt with response codes and timing
|
|
17
17
|
|
|
18
18
|
## How Webhooks Work
|
|
@@ -269,7 +269,9 @@ end
|
|
|
269
269
|
|
|
270
270
|
### Failed Deliveries
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
Any response other than 2xx — including a timeout or a connection error — marks the delivery as failed. Spree then sends it again, waiting longer before each try, up to 5 attempts in total over about six minutes. The delivery log shows the outcome of the latest attempt. Retries stop as soon as the endpoint is turned off.
|
|
273
|
+
|
|
274
|
+
Every attempt carries the same event `id`, so use it to ignore an event your receiver has already processed. To send a delivery again after the retries run out, re-send it from the delivery log (see below).
|
|
273
275
|
|
|
274
276
|
If an endpoint fails 15 deliveries in a row, Spree disables it and emails the store staff. Fix the endpoint, then turn it back on by marking it active again.
|
|
275
277
|
|
|
@@ -125,7 +125,9 @@ A delivery site is an address, not a node. Ten warehouses do not mean ten compan
|
|
|
125
125
|
|
|
126
126
|
### Add the buyers
|
|
127
127
|
|
|
128
|
-
People join a company by email.
|
|
128
|
+
People join a company by email. When staff add someone through the Admin API, an existing customer becomes a member immediately, and an unknown email receives an invitation. The ID prefix tells you which happened: `cmem_` for a membership, `cinv_` for an invitation.
|
|
129
|
+
|
|
130
|
+
When a member adds a colleague from the storefront, the colleague always receives an invitation, even if they already have an account. Anyone can type an email address, so joining requires accepting the emailed invitation, which proves the person owns that address. An invitation is valid for 30 days. Accepting it creates the account and the membership in one step, or links an existing signed-in customer whose email matches.
|
|
129
131
|
|
|
130
132
|
|
|
131
133
|
```typescript Admin SDK
|
|
@@ -135,8 +137,8 @@ const result = await adminClient.companies.memberships.create('comp_xxx', {
|
|
|
135
137
|
```
|
|
136
138
|
|
|
137
139
|
```typescript Store SDK
|
|
138
|
-
// A member
|
|
139
|
-
const
|
|
140
|
+
// A member invites colleagues from the storefront; they join by accepting
|
|
141
|
+
const invitation = await client.companies.members.create('comp_xxx', {
|
|
140
142
|
customer_email: 'colleague@acme.example',
|
|
141
143
|
})
|
|
142
144
|
```
|
|
@@ -63,7 +63,7 @@ When the consumer is a system you do not deploy your own code into, use a webhoo
|
|
|
63
63
|
|
|
64
64
|
Each delivery is an HTTP POST carrying the event name and the same serialized payload. The endpoint's **signing secret is shown once when you create it**: store it in the receiving system and verify every request against it, so the receiver can prove the call came from your store.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Failed deliveries are retried with increasing delays, and the dashboard shows the delivery history per endpoint, which is where to look when a third party says they never received something.
|
|
67
67
|
|
|
68
68
|
> **TIP:** Webhooks need no code in your app at all. Reach for a subscriber only when the reaction needs application context or credentials you would rather not hand to a third party. See [events](../core-concepts/events.md) and [webhooks](../core-concepts/webhooks.md).
|
|
69
69
|
|