Skip to content

Conversation

@gigitux
Copy link
Contributor

@gigitux gigitux commented Aug 5, 2025

This PR updates the documentation, adding details for the brands property:

  • Introduced brands attribute in the product API, allowing for an array of brand objects with id, name, and slug.
  • Updated examples to include brands in both request and response formats.
  • Added a new section detailing Brands Properties for clarity.

Testing Instructions:

  • Fetch a product with brands assigned -> GET /wp-json/wc/v3/products/:productId
  • Ensure that the brands fields have this structure:
brands: [{
    "id": number,
    "name" string,
    "slug": string
}]
  • Ensure that you can update brands assigned to the product via POST /wp-json/wc/v3/products/:productId passing:
brands: [{id:number}]

- Introduced `brands` attribute in the product API, allowing for an array of brand objects with `id`, `name`, and `slug`.
- Updated examples to include `brands` in both request and response formats.
- Added a new section detailing Brands Properties for clarity.
Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for noticing and fixing this, @gigitux! I left one small suggestion about capitalizing the name property, but not a blocker. 🚢

"brands": [
{
"id": 99,
"name": "test",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big deal, but I see in the attributes, the name property is capitalized:

imatge

I think it's nice to make it clear it's a formatted text instead of a slug in snake-case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes sense! Thanks for the review! Fixed with da0cdb0

@gigitux gigitux merged commit 820f0dc into trunk Aug 5, 2025
@gigitux gigitux deleted the fix/update-brand-documentation branch August 5, 2025 15:16
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.

3 participants