Active Variants

Introduction  
This API is used to Activate Variants based on the trigger event that the client specifies in their workflow.

If any deactivated variant is to be made active, this api will get triggered and the variant status will change to active in the Arifi admin.


This API requires the SKU to be passed in the ‘skus’ parameter, whose order status is to be changed and the ID of the associated website.


It returns the response object, which contains the status of the operation along with the message if any error occurs during this process.

Use Cases

  • Product Re-activation After Temporary Deactivation 
    When a product variant was previously deactivated (e.g., due to maintenance, pricing updates, or temporary unavailability), this API is triggered to reactivate the variant once it is ready to go live again. 
  • Inventory Restock Scenario 
    If a variant was deactivated due to being out of stock, the API can be triggered automatically when inventory is replenished to make the variant active again in the system. 
  • Campaign or Promotion Restart 
    When a marketing campaign or promotion is resumed, previously deactivated variants associated with the campaign can be reactivated using this API. 

 
API Details 
Endpoint

--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 be matched with 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 activated successfully;",

    "Data": null,

    "ErrorCode": ""

}

Error Code List (Click Here)


Q&A

Q1. What is the purpose of the Activate Variants API? 
The API is used to activate product variants based on a trigger event defined in the client’s workflow. It updates the variant status to active in the Artifi admin.

Q2. When is this API typically triggered? 
This API is triggered when a previously deactivated variant needs to be reactivated, such as after restocking, campaign restart, or manual/admin workflow actions.

Q3. What are the mandatory parameters required to call this API? 
The required parameters are:

  • skus (Query Parameter) – SKU(s) of the product/variant to be activated 
  • userEmailId (Query Parameter) – Email ID of the admin making the request 
  • websiteId (Header) – Website identifier 
  • webApiClientKey (Header) – API authentication key 

Q4. Can multiple SKUs be passed on a single request? 
Yes, multiple SKUs can be passed in the skus parameter (comma-separated), allowing bulk activation of variants.

Q5. What happens if a base product SKU is passed instead of a variant SKU? 
If a base product SKU is provided and the product has variants, the API will return the default SKU details associated with that product.

Q6. What type of request method is used for this API? 
The API uses the PUT HTTP method to update the status of product variants.

Q7. What does a successful response look like? 
A successful response contains:

{

    "Response": "Success",

    "Message": "Sku 5454546565 is activated successfully;",

    "Data": null,

    "ErrorCode": ""

}

Q8. How does the API handle errors? 
If an error occurs (e.g., invalid SKU, authentication failure), the API returns a response with an appropriate error message and error code for troubleshooting.

Q9. What kind of validation is performed on the SKU? 
The SKU provided is validated against the records available in the Artifi admin. If no matching product or variant is found, an error response is returned. 
{

    "Response": "Error",

    "Message": "Invalid SKU or product code.",

    "Data": null,

    "ErrorCode": ""

}

Q10. Why is user Email Id required? 
The userEmailId identifies the Artifi admin user who is making the request, ensuring traceability and audit tracking.

Q11. Is authentication required for this API? 
Yes, authentication is required using the webApiClientKey, which must be passed in the request.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.