picnic-api v4.0.0 — Changelog
Highlights
v4 is a full rewrite of picnic-api. The monolithic PicnicClient class has been replaced with a domain-based service architecture — 12 focused services, 62+ methods, comprehensive Fusion/PML type coverage, and many new API routes that weren't available before.
⚠️ Breaking Changes
Domain-based API access
All methods have moved from the flat client.method() pattern into domain namespaces:
- client.login(username, password)
+ client.auth.login(username, password)
- client.getShoppingCart()
+ client.cart.getCart()
- client.search("coffee")
+ client.catalog.search("coffee")
- client.getDeliveries()
+ client.delivery.getDeliveries()
- client.getConsentSettings()
+ client.consent.getConsentSettings()
- client.getPaymentProfile()
+ client.payment.getPaymentProfile()Method renames
| v3 | v4 |
|---|---|
getShoppingCart()
| cart.getCart()
|
addProductToShoppingCart()
| cart.addProductToCart()
|
removeProductFromShoppingCart()
| cart.removeProductFromCart()
|
clearShoppingCart()
| cart.clearCart()
|
getMgmDetails()
| Folded into user.getProfileMenu()
|
getCustomerServiceContactInfo()
| customerService.getContactInfo()
|
getCategories() / getLists()
| Removed (replaced by Fusion page endpoints) |
getArticle()
| Removed (use catalog.getProductDetails())
|
HttpClient extracted
PicnicClient now extends HttpClient. The base client handles request construction, auth headers, and error handling. The public sendRequest() method remains available for custom/undocumented endpoints.
Types reorganized
The single types/picnic-api.ts file has been replaced by:
types/common.ts— Shared types (ApiConfig,CountryCode,ImageSize,Decoratorunion, etc.)types/fusion.ts— 850+ lines of Fusion/PML page rendering typesdomains/*/types.ts— Per-domain request/response types
✨ New Domains
📄 content — Content pages
getFaqContent()— FAQ page (PML format)getSearchEmptyState()— Search empty state content
🍳 recipe — Recipes & cookbook
getRecipesPage()— Browse recipes pagegetRecipeDetailsPage(recipeId)— Recipe detail pagesaveRecipe(recipeId)/unsaveRecipe(recipeId)— Save/unsave recipesaddProductToRecipe()/removeProductFromRecipe()— Cart mutations with recipe context
👋 userOnboarding — Onboarding flows
setHouseholdDetails(details)— Set household infosetBusinessDetails(details)— Set business infosubscribePush(topics)— Subscribe to push notification topics
🆕 New Routes (on existing domains)
app
getBootstrapData()— Tab bar config, feature flags, SDK configsgetPage(pageId)— Generic Fusion page renderer for any page IDresolveDeeplink(url)— Resolve deeplinks to in-app targets
auth
logout()— Logout and invalidate sessiongeneratePhoneVerificationCode(phoneNumber)— Phone verificationverifyPhoneNumber(phoneNumber, code)— Confirm phone number
user
submitSuggestion(suggestion)— Submit product/feature suggestionsregisterPushToken(pushToken, platform)— Register device push tokencheckForUpdates()— App update check
cart
removeGroupFromCart(groupId)— Remove an entire product groupgetMinimumOrderValue()— Get minimum order value for the slotconfirmOrder(orderId)— Confirm a checked-out order
catalog
getProductDetails(productId)— Structured product data (parsed from Fusion page)getProductDetailsPage(productId)— Raw Fusion product detail page
consent
getConsents(topics, strategy)— Filtered consent retrievalgetGeneralConsents()/setGeneralConsents()— General consent management
customerService
getMessages(displayPositions?)— Popup/notification messagesgetReminders()/setReminders()— Reminder managementgetParcels()— External carrier parcel trackinggetUnauthenticatedContactInfo(countryCode)— Public API (no auth required)
🛠️ New Utilities
Product detail parser (catalog/helpers.ts)
getProductDetails() wraps the Fusion product detail page and extracts structured data including: name, brand, unit quantity, unit price, display price, max order count, gallery images, description, highlights, allergens, info sections, promotions, bundle options, and similar products.
Includes helpers: stripColorMarkup(), stripMarkdownFormatting(), findById(), extractMarkdowns(), findBundleContainer().
🧩 Fusion/PML Type System
Comprehensive TypeScript types covering Picnic's entire page rendering system:
- PML primitives —
StackComponent,ContainerComponent,ImageComponent,RichTextComponent,IconComponent - Fusion components (17) —
TOUCHABLE,STEPPER,ACCORDION,MODAL,PRICE,SOCIAL_SHARE,SEARCH_RESULT_ENTITY, and more - Action types (7) —
OPEN,EVENT,ENDPOINT,CALLBACK,RELOAD,ANALYTICS - Page layout —
FusionPage,FlowLayout,BlockComponent,SuspenseComponent,StateBoundaryComponent - Bootstrap data —
BootstrapData, tab configuration, Braze/Datadog SDK configs, feature flags