You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add pickupSlotInterval and uncouple leadTime from time slot generation (#1329)
* Add pickupSlotInterval and uncouple leadTime from time slot generation
* use store tz for timeslot validation
* use leadTime in asap display
* extract asap and leadtime display into helpers
* update readme
* adjust express click handler ref to avoid stale closure
* single use effect on gd express payments
-**`shipping`** (CheckoutSessionShippingOptionsInput): Shipping configuration — primarily used to set an `originAddress` for shipping rate calculations and an optional `fulfillmentLocationId`
52
+
-**`sourceApp`** (string): The source application that created this checkout session
53
+
-**`storeName`** (string): The name of the store this checkout session belongs to
54
+
-**`taxes`** (CheckoutSessionTaxesOptionsInput): Tax configuration — used to set an `originAddress` for tax calculations (e.g. the store or warehouse address that taxes are calculated from)
55
+
-**`url`** (string): Custom URL for the checkout session
49
56
50
57
### Checkout Session Options
51
58
@@ -76,12 +83,106 @@ The checkout session supports multiple environments through the input parameter:
76
83
77
84
### API Scopes
78
85
79
-
The checkout session automatically requests the following OAuth2 scopes:
86
+
The checkout session automatically requests the following OAuth2 scope:
80
87
81
88
-`commerce.product:read`
82
-
-`commerce.order:read`
83
-
-`commerce.order:update`
84
-
-`location.address-verification:execute`
89
+
90
+
### Operating Hours
91
+
92
+
The `operatingHours` field configures local pickup scheduling — time zones, lead times, pickup windows, and slot intervals.
|`timeZone`| string | Yes | IANA timezone for the store (e.g. `America/New_York`). All slot times are displayed in this timezone. |
119
+
|`leadTime`| number | Yes | Minimum advance notice in minutes before a pickup can be scheduled. Controls the earliest available slot (now + leadTime). |
120
+
|`pickupWindowInDays`| number | Yes | Number of days ahead customers can schedule pickup. Set to `0` for ASAP-only mode (no date/time picker). |
121
+
|`pickupSlotInterval`| number | No | Minutes between selectable time slots (e.g. `30` → 10:00, 10:30, 11:00…). Defaults to 30 if omitted. Separate from `leadTime` — the interval controls slot spacing, while leadTime controls advance notice. |
122
+
|`hours`| object | Yes | Per-day operating hours. Each day has `enabled` (boolean), `openTime` (HH:mm or null), and `closeTime` (HH:mm or null). |
123
+
124
+
#### Behavior Notes
125
+
126
+
-**ASAP option** — Shown for today only, when the store can fulfill an order (now + leadTime) before closing time.
127
+
-**Lead time vs slot interval** — A store with `leadTime: 1440` (24 hours) and `pickupSlotInterval: 15` shows 15-minute slots starting tomorrow, not 24-hour gaps.
128
+
-**Timezone handling** — All date/time logic uses the store's `timeZone`, not the customer's browser timezone. A store in Phoenix shows Phoenix hours regardless of where the customer is browsing from.
129
+
-**No available slots** — When leadTime exceeds the entire pickup window, or no days are enabled, a "No available time slots" banner is shown.
130
+
131
+
### Appearance
132
+
133
+
The `appearance` field customizes the checkout's look and feel.
134
+
135
+
```typescript
136
+
appearance: {
137
+
theme: 'base',
138
+
variables: {
139
+
primary: '#4f46e5',
140
+
background: '#ffffff',
141
+
foreground: '#111827',
142
+
radius: '0.5rem',
143
+
},
144
+
}
145
+
```
146
+
147
+
#### Theme
148
+
149
+
| Value | Description |
150
+
|-------|-------------|
151
+
|`base`| Default theme |
152
+
|`orange`| Orange accent theme |
153
+
|`purple`| Purple accent theme |
154
+
155
+
#### CSS Variables
156
+
157
+
All fields are optional strings. Pass any subset to override the defaults.
158
+
159
+
| Variable | Description |
160
+
|----------|-------------|
161
+
|`accent`| Accent color |
162
+
|`accentForeground`| Text on accent backgrounds |
163
+
|`background`| Page background |
164
+
|`border`| Border color |
165
+
|`card`| Card background |
166
+
|`cardForeground`| Text on cards |
167
+
|`defaultFontFamily`| Default font family |
168
+
|`destructive`| Destructive action color (errors, delete) |
169
+
|`destructiveForeground`| Text on destructive backgrounds |
170
+
|`fontMono`| Monospace font family |
171
+
|`fontSans`| Sans-serif font family |
172
+
|`fontSerif`| Serif font family |
173
+
|`foreground`| Primary text color |
174
+
|`input`| Input field background |
175
+
|`muted`| Muted/subtle background |
176
+
|`mutedForeground`| Text on muted backgrounds |
177
+
|`popover`| Popover background |
178
+
|`popoverForeground`| Text in popovers |
179
+
|`primary`| Primary brand color |
180
+
|`primaryForeground`| Text on primary backgrounds |
181
+
|`radius`| Border radius (e.g. `0.5rem`) |
182
+
|`ring`| Focus ring color |
183
+
|`secondary`| Secondary color |
184
+
|`secondaryBackground`| Secondary background |
185
+
|`secondaryForeground`| Text on secondary backgrounds |
0 commit comments