Skip to content

docs(business): document catalog, collections, orders, and profile writes - #501

Merged
jlucaso1 merged 2 commits into
mainfrom
claude/nifty-bohr-n07dor
Aug 8, 2026
Merged

docs(business): document catalog, collections, orders, and profile writes#501
jlucaso1 merged 2 commits into
mainfrom
claude/nifty-bohr-n07dor

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Documents the API surface added by oxidezap/whatsapp-rust#1252 ("feat(business): add catalog, product and business profile operations"), which added a new client.business() sub-API alongside the pre-existing client.get_business_profile().

  • api/business.mdx — expanded from a profile-read-only page into the full feature reference:
    • New Access section explaining the split: get_business_profile stays direct-on-Client; catalog/collections/orders/profile-writes live on client.business().
    • New method docs: get_catalog, get_collections, get_order (all MEX), update_profile, set_cover_photo, remove_cover_photo (all IQ w:biz), each with signature, parameters, and a runnable example.
    • New type docs: CatalogOptions, CollectionOptions, Catalog, Collections, Collection, Product, Price (thousandths, not hundredths), SalePrice, ProductImage, ProductVideo, ImporterAddress, ProductAvailability, Order, OrderProduct, OrderPriceDetails, VariantProperty, BusinessProfileUpdate, BusinessHoursUpdate, BUSINESS_PROFILE_MAX_WEBSITES, CoverPhotoUpload.
    • New Validation section covering every BusinessProfileUpdateError rejection reason (empty delta, too many websites, out-of-range/non-finite coordinates, invalid business-hour minutes, incomplete hour ranges, mode/range mismatches).
    • New Error handling section for BusinessError.
    • New Not yet supported section: product create/edit/delete, cover-photo image upload (takes a pre-uploaded receipt instead), full single-collection paging, catalog/collection variant data — each with the reason from the source PR.
    • Existing sections (business events, is_business check, automatic <biz> stanza detection) kept as-is.
  • api/client.mdx — added a ### business accessor section (matching the existing mex/newsletter/community accessor sections) right after get_business_profile.
  • api/errors.mdx — added BusinessError to the domain error table and its own ### BusinessError type-definition section, matching the existing per-feature error pattern.

Left untouched per instruction: the changelog/ directory (human-authored only).

Test plan

  • Verified every new method signature, struct field list, and doc-comment-derived explanation against the actual source at commit 64adf5b (the merge commit for #1252) in src/features/business.rs and wacore/src/iq/business.rs.
  • Confirmed code-fence balance in all three edited files.
  • Confirmed anchor links (#get_catalog, #catalogoptions, #validation, #coverphotoupload, etc.) match their heading text under Mintlify's slug convention.
  • mint broken-links — not run (CLI unavailable in this sandbox); recommend running before merge.

Generated by Claude Code


Summary by cubic

Expands Business API docs to cover catalog, collections, and order lookup over MEX, plus business profile and cover photo writes over IQ. Adds client.business() with get_catalog, get_collections, get_order, update_profile, set_cover_photo, remove_cover_photo; documents types, validation, and BusinessError; and clarifies hours behavior (no closed mode), collection paging ("may exist"), update semantics, and order_id/token naming.

Written for commit 6a77bec. Summary will update on new commits.

…ites

whatsapp-rust#1252 added client.business() with get_catalog/get_collections/
get_order (MEX) and update_profile/set_cover_photo/remove_cover_photo (IQ
w:biz), plus the BusinessError, BusinessProfileUpdate, and catalog/order
types backing them. Expands the business API page with the new methods,
types, and validation rules, adds the client.business() accessor to the
client reference, and adds BusinessError to the error type reference.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyDYg23Kh9PKoFGDof4Dxa
@mintlify

mintlify Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
whatsapp-rust 🟢 Ready View Preview Aug 8, 2026, 12:23 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jlucaso1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 474b3e62-1f18-4685-92c1-a25b92cc0440

📥 Commits

Reviewing files that changed from the base of the PR and between 7e01c0d and 6a77bec.

📒 Files selected for processing (3)
  • api/business.mdx
  • api/client.mdx
  • api/errors.mdx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR expands the Business API documentation to cover catalog and collection browsing, order lookup, profile mutations, and cover-photo management.

  • Documents the split between direct Client::get_business_profile access and the new client.business() sub-API.
  • Adds method signatures, examples, data types, validation behavior, error handling, and unsupported-operation notes.
  • Adds the business() accessor to the Client reference and BusinessError to the shared error reference.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
api/business.mdx Expands the feature reference with Business sub-API methods, associated models, validation rules, errors, examples, and support limitations.
api/client.mdx Adds the Client::business() accessor and summarizes its catalog, order, profile, and cover-photo operations.
api/errors.mdx Adds BusinessError to the domain-error table and documents its MEX, IQ, validation, and malformed-response variants.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Client[Client] --> Read[get_business_profile]
    Client --> Business[client.business]
    Business --> MEX[MEX operations]
    Business --> IQ[IQ w:biz operations]
    MEX --> Catalog[get_catalog]
    MEX --> Collections[get_collections]
    MEX --> Order[get_order]
    IQ --> Update[update_profile]
    IQ --> SetCover[set_cover_photo]
    IQ --> RemoveCover[remove_cover_photo]
Loading

Reviews (2): Last reviewed commit: "docs(business): address review feedback ..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 920417e4d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread api/business.mdx Outdated

**Parameters:**
- `jid` - the business the order was placed with
- `order_id` / `token` - taken from the order message itself (`OrderMessage.orderId` / `OrderMessage.token`); the token is a per-order capability, so an order cannot be read without the message that announced it

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the Rust field name for order IDs

When readers extract these values in Rust, OrderMessage.orderId does not exist: the generated API converts protobuf camelCase fields to snake_case Rust identifiers, as documented in api/waproto.mdx. Refer to OrderMessage.order_id instead; otherwise the documented access path fails to compile.

Useful? React with 👍 / 👎.

Comment thread api/business.mdx Outdated
```

<Note>
`Collection::products` is a possibly-truncated prefix — the collections query returns no per-collection cursor, so `products.len() == item_limit` is the only signal that more products exist in that collection.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe the collection length check as inconclusive

When a collection contains exactly item_limit products, this equality holds even though no additional products exist. The length is therefore only a signal that the collection may be truncated, as the example above correctly says, not a signal that more products exist; the same overstatement is repeated in the later warning and can make consumers report nonexistent additional items.

Useful? React with 👍 / 👎.

Comment thread api/business.mdx

`BusinessHoursConfig` is `#[non_exhaustive]`: struct-literal construction and exhaustive struct destructuring from outside the crate are both disallowed. Field reads are unaffected; add `..` to any exhaustive destructuring patterns.

**Constructors:**

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Explain that closed days are omitted

For users trying to mark a day as closed, this constructor description is not actionable: BusinessHoursConfig::new still requires a BusinessHourMode, but the documented enum has no closed variant. Since the configuration contains one entry per opening range, document that a closed day is represented by omitting that day's entry rather than implying that new can construct one.

Useful? React with 👍 / 👎.

Comment thread api/business.mdx Outdated

### BusinessProfileUpdate

A delta mutation of the business profile, passed to [`update_profile`](#update_profile). Every field is `None` by default and a `None` field is left untouched — this is a delta, not a replacement. The distinction that matters is between "leave alone" and "clear": clearing is `Some` of an empty value (`Some(String::new())` for text, `Some(Vec::new())` for `websites`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Split the profile-delta explanation by concept

This paragraph compresses default-field behavior, delta-versus-replacement semantics, and the syntax for clearing two different field shapes into dense compound sentences. Split these concepts into concise sentences so readers do not miss the operationally important distinction between None and an empty Some value.

AGENTS.md reference: AGENTS.md:L24-L25

Useful? React with 👍 / 👎.

- Note there's no "closed" mode/constructor for BusinessHoursConfig — a
  day is closed by omitting its entry from `config`.
- Hedge the collection-truncation signal as "may exist" rather than
  "exist": products.len() == item_limit doesn't prove more are available.
- Split the dense BusinessProfileUpdate delta-semantics paragraph into
  separate sentences.
- Point get_order's order_id/token doc at the Rust struct field name
  (order_id), not the wire/proto name (orderId).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyDYg23Kh9PKoFGDof4Dxa
@greptile-apps
greptile-apps Bot dismissed their stale review August 8, 2026 12:31

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@jlucaso1
jlucaso1 merged commit 8d93595 into main Aug 8, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a77bec7ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread api/business.mdx
- `BusinessHoursConfig::new(day_of_week, mode)` — a day whose mode carries no explicit range (`Open24H` or `AppointmentOnly`)
- `BusinessHoursConfig::with_hours(day_of_week, mode, open_time, close_time)` — a single opening range, in minutes past local midnight. A day with two ranges is two entries sharing a `day_of_week`.

<Note>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe config entries as opening ranges

For a business with two opening ranges on the same day, this sentence incorrectly says config holds one entry per day, contradicting the constructor guidance immediately above that requires two entries sharing a day_of_week. Readers following this wording can omit a valid interval; clarify that closed days have no entries and open days have one entry per opening range.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants