Product Options in Venddor IO

Introduction

When it comes to selling products on online platforms like Venddor IO, the flexibility to offer variations is crucial. Such variations can be attributes like color, size, or additional accessories. In Venddor IO, these attributes are referred to as "options."

Understanding Product Options

Listing Options for a Product

To understand the various options associated with a product, you can retrieve a list of options specific to a product. The request requires you to target the /api/options/?product_id=:id endpoint. For instance, if you wish to see options related to a product with ID 12:

GET /api/options/?product_id=12

Upon a successful request, a 200 OK response will be returned, containing a JSON representation of the product's options.

Response Structure

The response structure includes various attributes detailing the option. For example:

Within each variant, you'll find:

For instance, for the option "Size," there might be variants like Small, Medium, and Large. For the option "Color," variants can be specific colors such as "Black/White/White" or "Dark Navy/White/White."

Additional Functionalities

Beyond just listing product options, Venddor IO's API offers functionalities to:

Each of these actions has its respective API endpoint and parameters, providing a holistic and flexible approach to manage product variations, enhancing the overall shopping experience for customers.

Accessing Specific Product Options

In the world of e-commerce, it's paramount for products to be displayed with all their variations. Venddor IO makes this easy with its options management system. These options might refer to different sizes, colors, materials, or any other attribute that a product might possess.

Retrieving a Specific Option

To access the details of a particular product option in Venddor IO, a simple GET request to /api/options/<option_id> is needed. As an example:

GET /api/options/3

A successful request will fetch you the desired details of the option in a JSON format.

Diving into Option Details

When you pull the details of an option, you're presented with a plethora of attributes. Here's a breakdown of these fields:

Understanding Option Variants

For options that offer multiple choices, such as sizes or colors, variants come into play. Here's what each variant field signifies:

Managing Product Options

The versatility of a product often hinges on its options. In the digital marketplace, it's pivotal to delineate these options in detail. Venddor IO provides a comprehensive system to manage, update, and remove product options with ease.

Creating a New Product Option

To add a fresh option for a product in Venddor IO, initiate a POST request to /api/options/.

You'll need to provide specific details in the request body, with certain fields being mandatory. Key fields include:

For example, consider the following JSON representation:

{
  "product_id": "12",
  "option_name": "Packaging",
  "option_type": "R",
  ...
}

This defines an option named 'Packaging' for a product with ID '12'. The option type is 'Radiogroup'. On successful creation, Venddor IO will respond with the new option's ID:

{
  "option_id": 27
}

Updating an Existing Product Option

Over time, you may need to modify an option's attributes or values. Use a PUT request to /api/options/<option_id>/ for this. For instance:

PUT /api/options/27

Provide the updated details in the request body. For instance:

{
  "option_type": "S",
  ...
}

This example modifies the 'Packaging' option, changing its type to a Select box and updating its variants. Remember, when updating variants, it's crucial to specify all the existing and new variants to prevent any unintentional deletions.

Deleting a Product Option

There might be instances where a particular option is no longer relevant or needed. In such cases, you can remove it by sending a DELETE request to /api/options/<option_id>. E.g.:

DELETE /api/options/27

A successful deletion will return an HTTP/1.1 204 No Content response, while unsuccessful attempts might return HTTP/1.1 400 Bad Request or HTTP/1.1 404 Not Found if the option doesn't exist.

Conclusion

Venddor IO offers a flexible framework to manage product options efficiently. Whether you're adding new choices, updating existing ones, or clearing out obsolete options, Venddor IO's modules ensure a seamless experience.