Big Commerce Delete Product Custom Fields
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Date | Version | Name | Applied changes |
---|---|---|---|
27/08/2023 | v1.0 | Bogomil Pavlov | First Publish |
When we are making Big Commerce Update Product we want to add additional step of deleting custom fields which will allow us to keep the consistency between Hemi and BC. Thus we want to add this step within the actual product update cron.
Delete Custom Field
The deletion of the custom fields are one by one since we are using the custom field id within the url.
API Call: DELETE https://api.bigcommerce.com**/stores/{store_hash}/v3/catalog/products/{product_id}/custom-fields/{custom_field_id}**
Doc: https://developer.bigcommerce.com/docs/rest-catalog/products/custom-fields#delete-a-product-custom-field
Sample Request:
DELETE [https://api.bigcommerce.com/stores/i3kt5xjesl/v3/catalog/products/14537/custom-fields/77496](https://api.bigcommerce.com/stores/i3kt5xjesl/v3/catalog/products/14537/custom-fields/77496)
In the url we need to use the store hash, our Product Account > Channel Item Id and Product Account Big Commerce > Custom Fields (Value)
Sample Response 204:
Once we receive 204 No content it means the Custom Field is deleted successfully on BC and we need to delete it from Hemi Product Account Big Commerce > Custom Fields
Sample Response 404
{
"status": 404,
"title": "A custom field was not found with an id of 77513123",
"type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes"
}
We want to treat error 404 as success as well.
We want to store the all errors excluding 404 into the Product Account > Update Item Error