POST | /Product/ProductUpdate | Inserts a product or updates an existing one. | Uses your API Key and applies a mvRecordAction value on an mvProduct object. We can insert the mvProduct object
we specified using "Insert" as our mvRecordAction. We can update a current one using "Update", we can insert it if it doesn't
already exist, update it if it does using "InsertOrUpdate" and we can insert new fields or update non-empty fields of the
object using "InsertOrUpdateNonEmptyFields". Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external
application ( eg WooCommerce ) is the one that triggers the ProductUpdate call. ProductId cannot be updated.
A. Insert a new product. The ProductUpdate call was triggered by WooCommerce.
Value: {
"mvProduct": {
"ProductType": "TimeRestrictedService",
"ProductSKU": "newproductsku",
"ProductDescription": "newproductdescription"
},
"mvRecordAction": "Insert",
"mvInsertUpdateDeleteSourceApplication": "WooCommerce"
}
Response: {
"mvProduct": {
"ProductID": 55,
"ProductType": "TimeRestrictedService",
"ProductSKU": "newproductsku",
"ProductEAN": "",
"ProductDescription": "newproductdescription",
"ProductVersion": "",
"ProductLongDescription": "",
"ProductCategoryID": 0,
"ProductUnitOfMeasurement": "",
"ProductSellingPrice": 0,
"ProductPurchasePrice": 0,
"ProductWeight": 0,
"ProductLength": 0,
"ProductBreadth": 0,
"ProductHeight": 0,
"ProductImageURL": "",
"ProductComments": "",
"ProductCustomField1": "",
"ProductCustomField2": "",
"ProductCustomField3": "",
"ProductCustomField4": "",
"ProductCustomField5": "",
"ProductCustomField6": "",
"ProductCustomField7": "",
"ProductCustomField8": "",
"ProductCustomField9": "",
"ProductCustomField10": "",
"ProductCustomField11": "",
"ProductCustomField12": "",
"ProductCustomField13": "",
"ProductCustomField14": "",
"ProductCustomField15": "",
"ProductCustomField16": "",
"ProductCustomField17": "",
"ProductCustomField18": "",
"ProductCustomField19": "",
"ProductCustomField20": "",
"ProductOption1": "",
"ProductOption2": "",
"ProductOption3": "",
"ProductOption4": "",
"ProductOption5": "",
"ProductOption6": "",
"ProductOption7": "",
"ProductOption8": "",
"ProductOption9": "",
"ProductOption10": "",
"ProductMainSupplierID": 0,
"ProductMainSupplierPrice": 0,
"ProductMainSupplierSKU": "",
"ProductMainSupplierDescription": "",
"ProductCreationDate": "/Date(1507650714280+0300)/",
"IsInventorySerialised": false,
"IsBatchNumbersEnabled": false,
"SerialNumberPrefix": "",
"SerialNumberLength": 11,
"IsPurchasable": true,
"PurchasableStartDate": "/Date(1519499361953-0000)/",
"PurchasableEndDate": "/Date(1519499361953-0000)/",
"IsSellable": true,
"SellableStartDate": "/Date(1519499361953-0000)/",
"SellableEndDate": "/Date(1519499361953-0000)/",
"DefaultSalesQuantity": 1,
"DefaultPurchaseQuantity": 1,
"MinimumSalesQuantity": 1,
"MinimumPurchaseQuantity": 1,
"MaximumSalesQuantity": 10,
"MaximumPurchaseQuantity": 100
},
"ResponseStatus": {
"ErrorCode": "0"
},
"entityID": 55
}
B. Update information on the product above. ProductID is mandatory and cannot be updated.
Value: {
"mvProduct": {
"ProductID": "55",
"ProductSKU": "newproductsku",
"ProductDescription": "newproductdescription -Updated!",
"ProductSellingPrice": "1.16",
"ProductPurchasePrice": "0.98",
"mvProductMainSupplier": {
"SupplierClientName": "A4 Paper Supplier"
}
},
"mvRecordAction": "Update"
}
Response: {
"mvProduct": {
"ProductID": 55,
"ProductType": "BuyFromSupplier",
"ProductSKU": "newproductsku",
"ProductEAN": "",
"ProductDescription": "newproductdescription -Updated!",
"ProductVersion": "",
"ProductLongDescription": "",
"ProductCategoryID": 0,
"ProductUnitOfMeasurement": "",
"ProductSellingPrice": 1.16,
"ProductPurchasePrice": 0.98,
"ProductUnitCost": 0,
"ProductWeight": 0,
"ProductLength": 0,
"ProductBreadth": 0,
"ProductHeight": 0,
"ProductImageURL": "",
"ProductComments": "",
"ProductCustomField1": "",
"ProductCustomField2": "",
"ProductCustomField3": "",
"ProductCustomField4": "",
"ProductCustomField5": "",
"ProductCustomField6": "",
"ProductCustomField7": "",
"ProductCustomField8": "",
"ProductCustomField9": "",
"ProductCustomField10": "",
"ProductCustomField11": "",
"ProductCustomField12": "",
"ProductCustomField13": "",
"ProductCustomField14": "",
"ProductCustomField15": "",
"ProductCustomField16": "",
"ProductCustomField17": "",
"ProductCustomField18": "",
"ProductCustomField19": "",
"ProductCustomField20": "",
"ProductOption1": "",
"ProductOption2": "",
"ProductOption3": "",
"ProductOption4": "",
"ProductOption5": "",
"ProductOption6": "",
"ProductOption7": "",
"ProductOption8": "",
"ProductOption9": "",
"ProductOption10": "",
"ProductMainSupplierID": 0,
"ProductMainSupplierPrice": 0,
"ProductMainSupplierSKU": "",
"ProductMainSupplierDescription": "",
"ProductCreationDate": "/Date(1507650714280-0000)/",
"IsInventorySerialised": false,
"IsBatchNumbersEnabled": false,
"SerialNumberPrefix": "",
"SerialNumberLength": 11,
"IsPurchasable": true,
"PurchasableStartDate": "/Date(1519499361953-0000)/",
"PurchasableEndDate": "/Date(1519499361953-0000)/",
"IsSellable": true,
"SellableStartDate": "/Date(1519499361953-0000)/",
"SellableEndDate": "/Date(1519499361953-0000)/",
"DefaultSalesQuantity": 1,
"DefaultPurchaseQuantity": 1,
"MinimumSalesQuantity": 1,
"MinimumPurchaseQuantity": 1,
"MaximumSalesQuantity": 10,
"MaximumPurchaseQuantity": 100
},
"ResponseStatus": {
"ErrorCode": "0"
},
"entityID": 55
}
|
---|