Update Product
Request
PUT:/{accountBookId}/product
caution
Important Note
When a product is used in transactions, the following cannot be done:
- Updating a product with variants to a product without variants and vice versa.
- Updating product code.
- Updating product type. List of product types can be found here.
Request Parameters
Parameter | Description | Type | |
---|---|---|---|
code | Product code. | string | required |
Request Body
object: Product Input Model
Example Request Body
Example: Add another product variant to record created in Create Product.
{
"product": {
"productCode": "P-00001",
"productName": "Hoodie",
"productName2": "",
"productType": "I",
"unit": "hoodies",
"price": 350,
"minPrice": 350,
"cost": 200,
"productCategoryName": "Apparel",
"postingGroup": "Default",
"supplyTaxCode": "S-5",
"purchaseTaxCode": "P-5",
"tariffCode": "40159000",
"status": "A",
"image": null,
"furtherDescription": "",
"note": "",
"supplier": "400-0001",
"variant1Name": "Colour",
"variant2Name": "Size",
"barCode": null
},
"productVariant1Options": [
{
"variantOption": "Blue",
"image": null
},
{
"variantOption": "Green",
"image": null
},
{
"variantOption": "Red",
"image": null
},
{
"variantOption": "Orange",
"image": null
}
],
"productVariant2Options": [
{
"variantOption": "Large",
"image": null
},
{
"variantOption": "Medium",
"image": null
},
{
"variantOption": "Small",
"image": null
}
],
"productVariants": [
{
"productVariant1OptionName": "Blue",
"productVariant2OptionName": "Large",
"price": 400,
"minPrice": 350,
"stockCode": "P-00001-Blue-Large",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Blue",
"productVariant2OptionName": "Medium",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Blue-Medium",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Blue",
"productVariant2OptionName": "Small",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Blue-Small",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Green",
"productVariant2OptionName": "Large",
"price": 400,
"minPrice": 350,
"stockCode": "P-00001-Green-Large",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Green",
"productVariant2OptionName": "Medium",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Green-Medium",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Green",
"productVariant2OptionName": "Small",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Green-Small",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Red",
"productVariant2OptionName": "Large",
"price": 400,
"minPrice": 350,
"stockCode": "P-00001-Red-Large",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Red",
"productVariant2OptionName": "Medium",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Red-Medium",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Red",
"productVariant2OptionName": "Small",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Red-Small",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Orange",
"productVariant2OptionName": "Large",
"price": 400,
"minPrice": 350,
"stockCode": "P-00001-Orange-Large",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Orange",
"productVariant2OptionName": "Medium",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Orange-Medium",
"barCode": null,
"image": null
},
{
"productVariant1OptionName": "Orange",
"productVariant2OptionName": "Small",
"price": 350,
"minPrice": 350,
"stockCode": "P-00001-Orange-Small",
"barCode": null,
"image": null
}
]
}
Example Request URL:
Parameters:accountBookId
= 1 code
= P-00001 URL:
PUT: https://accounting-api.autocountcloud.com/1/product?code=P-00001
Response
Success Response
Code: 204
Error Response
Response Body
object: Error Response Model
Example Error Response Body
{
"statusCode": 401,
"message": "401 Unauthorized."
}