Skip to content

Software Development at Program Tom LTD

Place for coding, programming, development and software in general.

Menu
  • Blog
  • PDF Booklets
  • Dev Utils & Content
  • Java Spring Boot Or Web Apps
  • English
    • български
    • English
    • Español
    • Português
    • हिन्दी
    • Русский
    • Deutsch
    • Français
    • Italiano
    • العربية
  • About Us
Menu
WordPress JSON Products

How to read WordPress Products JSON API and show them with Flutter Web

Posted on January 21, 2021January 21, 2021 by Toma Velev

The WordPress Products API returns JSON that contains all data. In the result are included the tags, the categories, the images and all fields. You could display the product info with one API call.
The URL is formed like this: https://<wp>/wp-json/wc/store/products.

blankWordPress Product JSON 1

The fields here are:

  • id: Integer
  • name: String
  • description: String (HTML) – the explanation of the product
  • short_description: String (HTML) – a short version. In the admin interface – it is usually located below the main content.
  • tags and categories arrays with objects containing:
    • id: Integer
    • slug: String – URL friendly variation of the name
    • name: String
    • link: String – the URL that will filter the products by tags or categories (the browser version, not the JSON). To filter the products in the JSON, you must append request parameters category or tag with value – the id.
  • images array containing objects with fields:
    • thumbnail: String – small version of the image
    • sizes: String – a CSS description of the size. Something like  “(max-width: 250px) 100vw, 250px“
    • src – the URL pointing to the image.
    • alt- the accessibility string
    • id: Integer – the id of the image
    • srcset: Useful for rending images in the browser. This property will let the it pick the most appropriate image depending on the screen size.
  • prices object with several fields related to money like – currency information, promotional and several others:
    • regular_price – the original price of the product
    • price – The price that the product sells in the current moment.
    • currency_code – the ISO standard currency code
    • currency_minor_unit: Integer – the number of decimal numbers. Usually you may need to divide the price to 10 powered to this number.
    • currency_symbol – the ISO standard – currency symbol
  • reviews_count: Integer – number of reviews
  • average_rating: Double – the average of the reviews
  • on_sale: Boolean – is the product available for sell
  • is_in_stock – is the product in stock
  • attributes – attributes of the product – entered in the admin interface
  • quantity_limit – limit to the number of quantities in a single order
  • variation: String – the current variation of the product
  • variations: Array – some products may have variations – by color, by size, by many more characteristics that the user may pick from.

An example usage of the WordPress Products API is available at the following address: https://programtom.com/dev_examples/wp_products/ – implemented using Flutter – build for the Web Browser.

By default the Items for sell are global – there is no user association. If you want to convert WordPress to Marketplace, you should search for Plugin or extend it on your own.

 

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Prompt-to-Production: How AI is Forcing Us to Build Higher Quality Software
  • Debug Web View Flutter App
  • Skipping AI? You’re a Relic – Time to Evolve or Perish!
  • 2026 Flutter Launch Blueprint: Your 10-Step Checklist to App Store Domination
  • Product Requirements Document – for different software development levels

Categories

  • Apps (25)
  • ChatGPT (27)
  • Choosing a Framework (38)
  • Flutter (281)
  • Graphical User Interface (14)
  • Marketing (119)
  • Software Development (292)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (16)

Tags

Algorithms (9) crypto (29) flutterdev (39) General (86) Java (7) QR & Bar Codes (3) Software Dev Choices (33) Spring Boot (1) standards (1) Theme (3) User Authentication & Authorization (9) User Experience (10) Utilities (19) WordPress (11)

Product categories

  • All Technologies (87)
    • Flutter Apps (26)
    • GPT (4)
    • Java (39)
    • Native Android (3)
    • PHP (9)
    • Spring (Boot) / Quarkus (36)
    • Utils (15)
    • Vaadin 24+ (28)
    • Vaadin 8 (1)
  • Apps (18)
    • Employees DB (1)
    • Notes (6)
    • Personal Budget (1)
    • Recipes Book (1)
    • Stuff Organizer (1)
    • To-Do (2)
  • PDF Books (3)
  • Source Code Generators (8)

Recent Posts

  • Prompt-to-Production: How AI is Forcing Us to Build Higher Quality Software
  • Debug Web View Flutter App
  • Skipping AI? You’re a Relic – Time to Evolve or Perish!
  • 2026 Flutter Launch Blueprint: Your 10-Step Checklist to App Store Domination
  • Product Requirements Document – for different software development levels

Post Categories

  • Apps (25)
  • ChatGPT (27)
  • Choosing a Framework (38)
  • Flutter (281)
  • Graphical User Interface (14)
  • Marketing (119)
  • Software Development (292)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (16)