文档中心 > Miravia Open Platform

API New endpoints: Product management

更新时间:2024/01/23 访问次数:600

This update marks a transformative evolution in our endpoint management, prioritizing a seamless and enriched developer experience. In an effort to enhance efficiency, we have substantially reduced the number of endpoints from an initial 11 to a more streamlined and potent set of 5.


New Endpoints:

  1. CreateAndUpdate: Consolidates product creation and updating functionalities.
  2. UpdatePrice: Facilitates adjustments to product prices.
  3. UpdateQuantity: Enables modifications to product quantities.
  4. UpdateStatus: Manages the status of products.
  5. GetProduct: Retrieves comprehensive information about products.


1. CreateAnd Update:


1.1 Product API Changes Overview:

The significant changes made with these new endpoints are as follows:

  1. Exclusion of itemId and SKU:In the new API, the need to explicitly include itemId and associated SKU has been eliminated. For updates, if the provided SKU already exists, it automatically associates with the existing item, relieving sellers from managing this logic.
  2. Optional "category_id" parameter:The "category_id" parameter is now optional. Utilizing AI, the system will detect the most suitable category for the product if the Category ID is not explicitly provided.
  3. Optional "default_images" parameter:Similarly, the "default_images" parameter is optional. If all SKUs have images, they will be utilized; otherwise, the specified default image will be used.


1.2 Faqs:

1. How to create a product with n skus?

  • Recommended Flow:
  1. Identify the leaf categoryId using "/categoryTree."
  2. Obtain category attributes with "/categoryAttribute."
  3. Call "createUpdateProduct" with the desired category attributes.
  • Easy Flow:
  1. Call "createUpdateProduct" without specifying the categoryId.
  2. Include basic creation attributes such as color and size.
  3. For additional fields, call "/categoryTree" with the assigned "categoryId."
  4. Call "createUpdateProduct" with the extra fields.
  • Easy Flow 2:
  1. Call "createUpdateProduct" instead of sending a product JSON.
  2. If additional fields are required:
    • Call "createUpdateProduct" with the extra fields.


Example


2. How to add sku in an existing product:

Imagine you have a product that already exists and is associated with three Stock Keeping Units (SKUs) - let's call them sku1, sku2, and sku3. Now, if you want to introduce a new SKU, say sku4, to this existing product, you would utilize the "createAndUpdate" endpoint.

Here's the step-by-step breakdown:

  1. Initial Product Configuration:
  • Product: [sku1, sku2, sku3]
  1. Action:
  • Call the "/createUpdateProduct" endpoint with the information for the new SKU:
  • Data: "1 product with [sku4]"
  1. Result:
  • After making the call, the system processes the request, and the product is updated:
  • Updated Product: [sku1, sku2, sku3, sku4]

So, by using the "createAndUpdate" endpoint with the new SKU information, you effectively append sku4 to the existing product configuration, resulting in a product that now includes all four SKUs: sku1, sku2, sku3, and the newly added sku4


Example


3. How to update an existing sku :

Updating an existing SKU using the "/createUpdateProduct" endpoint:

  1. Initial Product Configuration:
  • Product: [sku1, sku2, sku3]
  1. Update Action:
  • You wish to update an existing SKU, let's say sku1.
  1. API Call:
  • You make a call to the "/createUpdateProduct" endpoint with the updated information for sku1.
  • Data: "1 product with [sku1]" (Note: The sellerSku remains the same)
  1. Result:
  • The system processes the request, recognizing that the sellerSku provided corresponds to an existing SKU in the product configuration.
  • The product is updated, and the result is:
  • Updated Product: [sku1, sku2, sku3]

In summary, by making a call to the "/createUpdateProduct" endpoint with the same sellerSku and the updated SKU information, you effectively modify the existing SKU1 in the product configuration. The resulting product now includes the updated SKU1 along with the other existing SKUs, sku2 and sku3.


Example



2. UpdateQuantity


2.1 Description:

In order to update the stock of the items listed in Miravia we have created an specific endpoint in order to manage the changes. There is a minor to update the stock between using only one warehouse or multi warehouses. In this guide, we are going to explain how to update the stock with only one warehouse.

Use this API to update the total inventory of the corresponding warehouse for an product.


2.2 How to update the quantity?

  • update without multiwarehouse: call /updateQuantity with "quantity" and "seller_sku".
  • udpate with multiwarehouse. call /updateQuantity with "warehouse_quantity" and "seller_sku".


2.3 Json example


Please take into consideration:

1. When updating the quantity, if you provide the SPU along with the SKU, all SKUs under the specified SPU will have their quantity updated.

2. If you only provide the SKU, only that specific SKU's quantity will be changed.

4 No more than 20 SKU per call.



3. UpdatePrice

Description:

The "UpdatePrice" endpoint is designed to facilitate modifications to the pricing structure of products on the platform.


Please take into consideration:

1. If the discount price field is empty, the value from the price field will be taken.

2. If a discount price is added, the final price will reflect this discount.

3. If the price field is empty and the discount price is not, an error will occur.

4 No more than 20 SKU per call.

5 The price cannot exceed 2 decimals place



3.1 Json example


4. UpdateStatus


4.1 Description

The "UpdateStatus" endpoint manages the status of products, influencing their availability and visibility on the platform. Here's a breakdown of the different status:

Active: Description: Products in the "Active" status are ready and poised for publication. They are visible to users, and transactions can occur.

Inactive: Description: Products marked as "Inactive" are in a state of temporary suspension or hold. They are not currently available for purchase or display. This status is typically used when a product requires further attention or adjustments before being made available again.

Delete: Description: Products in the "Delete" status are no longer available on the platform. This status implies a more permanent removal from the system, and the product is no longer visible or accessible. Deleted products are usually archived or removed from the database.


4.2. How to delete an existing product :

For example if the product is already created, we have two ways of delete the product:

1 Product with [sku1,sku2,sku3]

    1. call "updateStatus" with productId and empty sku.
    2. delete all skus in the product:

2 product with [sku1,sku2,sku3]

a. call "updateStatus" with productId and sku1, sku2 ,sku3.

Ongoing Features (Delete status)

1. In the current development phase, if an erroneous SKU, not present in our database, is deleted, no error message will be generated; the deletion will simply not take place. Consequently, it is imperative to exercise caution when entering SKUs and to verify their status post-deletion.

2. Product restoration is presently unavailable. Following deletion, should you wish to re-publish a product, it will necessitate creating it anew.


Please take into consideration:

1. If both item ID and SKU are passed, an error will be reported.

2. If you provide the item ID alone, the status of all SKUs associated with that item ID will be updated.

3. If only the SKU is provided, only that SKU's status will be modified.


4.3 Json example


5. GetProduct

Description:

We've made enhancements to the getProduct endpoint to provide you with more flexibility and control when searching for products. This modification introduces additional parameters that allow for a more refined search.


Name

Type

Required or not

Description

product_id

Number

No

item id. Example:1357296984086901

seller_skus

String[]

No

sellerSku list. Example:["TESTING_PRODUCT_DECEMBER_467d4d03-4efc-4d78-9569-78971ab02c18"]

max_created_at

Number

No

Latest creation time of the product.Please use a millisecond timestamp. Example: 1704884033000

page_size

Number

No

page size

page

Number

No

page num

extraInfo_filter

String[]

No

only quality_control_log is the extraInfo available

status

String

No

the product status, ALL("all"), LIVE("live"), ACTIVE("live"), INACTIVE("inactive"), DELETED("deleted"), PENDING("pending"), REJECTED("rejected"), SOLD_OUT("sold-out");



5.1 Json example


FAQ

关于此文档暂时还没有FAQ
文档标签:
x
返回
顶部