Introduction
This API is used to deactivate the variants based on the trigger event that the client specifies in their workflow.
If any error occurs during this process, it returns the response object, which contains the status of the operation along with the message.
Use Cases
When a specific event is triggered in the client’s workflow (e.g., product discontinuation, inventory depletion, or campaign completion), the API automatically deactivates the associated variants without manual intervention
API Details
Endpoint
curl --location --request PUT 'https://api.artifi.net/api/4/ProductVariant/DeactivateVariants?skus=5454546565&userEmailId=demo@demo.com' \
--header 'websiteId: 241' \
--header 'webApiClientKey: c961461a-b287-448c-b9ea-e1162bd80b8e5'
Parameters
Header validation
Header Name | Type | Required | Description |
websiteId | int | Yes | Unique identifier of the website. |
webApiClientKey | string | Yes | API client key used for authentication. |
Query Parameters
Name | Type | Required | Description |
skus | string | Yes | This is a unique field to identify any product. In this field, users can send either
Product base SKU/ProductCode or Variant SKU. This field should match the product available in Admin.
If Artifi receives the base product code/SKU and the product has variants, then we are sending back the default SKU details of that product.
|
userEmailId | string | yes | This parameter value contains the Artifi admin login users' email address, who is making the request. |
Success Responses
{
"Response": "Success",
"Message": "Sku 5454546565 is deactivated successfully;",
"Data": null,
"ErrorCode": ""
}
Error Code List (Click Here)
Q&A
Q1. What is the purpose of the Deactivate Variants API?
Answer:
This API is used to deactivate product variants based on specific trigger events defined in the client’s workflow.
Q2. When should this API be used?
Answer:
It should be used when a workflow event occurs, such as product discontinuation, inventory depletion, or campaign completion, where variants need to be deactivated automatically.
Q3. What happens if an error occurs during the API execution?
Answer:
If any error occurs, the API returns a response object containing the operation status along with an error message.
Q4. What HTTP method is used for this DeActivate Variants API?
Answer:
The API uses the PUT HTTP method.
Q8. What headers are required for this API?
Answer:
- websiteId (int) – Unique identifier of the website
- webApiClientKey (string) – API client key used for authentication
Q9. What is the purpose of the skus parameter?
Answer:
The skus parameter is used to identify the product. It can accept either a base product SKU/ProductCode or a variant SKU.
Q10. What happens if a base product SKU is provided instead of a variant SKU?
Answer:
If a base product SKU is provided and the product has variants, the API returns the default SKU details of that product.
Q11. Is the skus parameter mandatory?
Answer:
Yes, it is a required parameter.
Q12. What is the purpose of the userEmailId parameter?
Answer:
It contains the email address of the Artifi admin user who is making the request.
Q13. Is userEmailId a required parameter?
Answer:
Yes, it is mandatory.
Q14. How is authentication handled in this API?
Answer:
Authentication is handled using the webApiClientKey provided in the request (as a header).
Q15. Can this API handle multiple SKUs at once?
Answer:
Based on the documentation, the skus field is a string, but it can be designed to accept multiple values (comma-separated) depending on implementation.
Q16. What type of response does the API return?
Answer:
The API returns a response object that includes the status of the operation and a message indicating success or failure.