Skip to content

UpdateMasterProduct

Use this api to update the specified product information.

POST /openapi/product/master/v1/update

Request Parameters

Parameter Type Required Description
id string true product ID
name string true product name,less than 300
fullCategoryId array(string) false The full Category Id is required when status is REVIEW APPROVED
saleStatus string false Product sale status,please refer to Product Status for details
condition string true NEW or USED
shortDescription string false When the status is REVIEW APPROVED, the short Description is required and the length is less than 3000
description string false Product description,less than 60000
variantOptions array(VariantOption) true Variant option, less than 3
variations array(MasterVariationDetail) true variation, less than 400
images array(string) false images
delivery Delivery false delivery info
costInfo CostInfo false Cost Info
status MasterProductStatusEnum true Master product status (PENDING_REVIEW,PAY_NO_ATTENTION)
extraInfo ProductExtraInfo false Extra Info
minPurchase integer false Min purchase,between 1 and 1000

VariantOption

Parameter Type Required Description
name string true Specification type name, such as color, size
values array(string) true The value of the specification type, such as red and yellow and size

MasterVariationDetail

Parameter Type Required Description
id string true variation ID
optionValues array(string) false Specifications type value, such as red code and L code
sellingPrice Price true The sellingPrice is required and less than 1000000000
averageCostPrice Price false
sku string true Sku is required and less than 200
images array(string) false Picture of the SKU
stock StockDetail true
purchasePrice Price false The purchase Price is required when type is not a BUNDLE and is less than 1000000000
bundleVariations BundleVariationDetail false If it is a combination of goods, information about the SKUS bundled with the combination SKUS is displayed
barcode string false Barcode only supports letters, numbers and -_

Delivery

Parameter Type Required Description
length integer false Length between 1 and 999999
width integer false Width between 1 and 999999
height integer false Height between 1 and 999999
lengthUnit string false Length Unit,cm
weight integer false The weight is required when status is REVIEW_APPROVED and is less than 5000000
weightUnit string false Weight Unit,g

CostInfo

Parameter Type Required Description
sourceUrl string false Source url,less than 500
purchasingTime integer false Purchasing time, less than 365
purchasingTimeUnit string false Purchasing time unit(HOUR,DAY,WORK_DAY,WEEK,MONTH)
salesTax Price false Sales tax amount

ProductExtraInfo

Parameter Type Required Description
preOrder PreOrder false Pre Order
hasShelfLife boolean false Has Shelf Life
shelfLifePeriod integer false Shelf Life Period
storageRestriction bigDecimal false Storage Restriction
deliveryRestriction bigDecimal false Delivery Restriction

Price

Parameter Type Required Description
amount bigDecimal true Amount,less than 1000000000
currencyCode string true Currency code,For example: ID,please refer to Country Abbreviation for details

StockDetail

Parameter Type Required Description
availableStock integer true Available stock,between 1 and 999999
safetyStock integer false Safety Stock
safetyAlert boolean false Safety Alert

BundleVariationDetail

Parameter Type Required Description
quantity integer true Variation quantity
bundleVariationId string true Bundle Variation Id

PreOrder

Parameter Type Required Description
settingType string false Pre order setting type (PRODUCT_ON,INHERIT_SHOP,PRODUCT_OFF)
timeToShip integer false
timeUnit string false Purchasing time unit (HOUR,DAY,WORK_DAY,WEEK,MONTH)

Response Parameters

Name Type Description
success boolean Create state,true or false
productId string The product id in Ginee
variationId array(string) The variation id in Ginee
invalidFields InvalidField Invalid Field

InvalidField

Name Type Description
fieldPath array(FieldPathNode) Create state,true or false
fieldValue string field Value
message string message

FieldPathNode

Name Type Description
nodeName string Node name
errorType string Save product error type(EMPTY,FORMAT,REPEAT)
message string Message

Request Example

Example

curl --location --request POST '{Ginee Host}/openapi/product/master/v1/update' \
--header 'Content-Type: application/json' \
--header 'X-Advai-Country: ID' \
--header 'Authorization: 2aedf7919e5e6cb4:n0IECNXloTKCTSSxeBEYhzmeVClHmgvw4ruI3W2f9eY=' \
--data-raw '{
"id": "MP61ED3452E21B840001BBDE33",
"name": "测试0123001",
"type": "BUNDLE",
"fullCategoryId": ["100534", "100577"],
"images": [],
"delivery": {
    "lengthUnit": "cm",
    "weightUnit": "g"
},
"costInfo": {
    "purchasingTimeUnit": "HOUR",
    "salesTax": {
        "amount": 0,
        "currencyCode": "CNY"
    }
},
"shortDescription": "这是短描述",
"description": "<p>这是长描述-update003</p>",
"brand": "",
"saleStatus": "FOR_SALE",
"status": "PENDING_REVIEW",
"condition": "NEW",
"variantOptions": [],
"variations": [{
    "id": "MV61ED3452E21B840001BBDE34",
    "productName": "测试0123001",
    "optionValues": ["-"],
    "sellingPrice": {
        "amount": 10,
        "currencyCode": "CNY"
    },
    "averageCostPrice": {
        "amount": 0,
        "currencyCode": "CNY"
     },
    "sku": "0123001-002",
    "images": [],
    "status": "ACTIVE",
    "variationSkusToBind": [],
    "stock": {
        "warehouseStock": 0,
        "spareStock": 0,
        "availableStock": 10,
        "safetyStock": 0,
        "safetyAlert": false
    },
    "type": "BUNDLE",
    "bundleVariations": [{
        "quantity": 1,
        "bundleVariationId": "MV617F907C69D50015D11C4C40"
    }],
    "inventoryStatus": "UN_INBOUND",
    "stockTagStatus": {
        "warehouseStatus": false,
        "stockSyncStatus": true
    },
    "boundChannelVariationCount": 0
}],
"minPurchase": 10,
"skusDeletable": true,
"extraInfo": {
    "preOrder": {
        "settingType": "PRODUCT_OFF",
        "timeUnit": "DAY"
    }
}
}'

Success

{
    "code": "SUCCESS",
    "message": "成功",
    "data": {
        "success": true,
        "productId": "MP61F006ABE21B840001BBDE36",
        "variationIds": null,
        "invalidFields": null
    },
    "extra": null,
    "pricingStrategy": "PAY"
}

Update Failed

{
    "code": "SUCCESS",
    "message": "成功",
    "data": {
        "success": false,
        "productId": null,
        "variationIds": null,
        "invalidFields": null
    },
    "extra": null,
    "pricingStrategy": "PAY"
}

Note

You need to check the code to see if the operation was successful. If failed, see message for detail reason.