Create or update Shopify product variants from API
API toolEcommerceSales EnablementRecipe Tools
What it does
When there is a new API request, this automation creates or updates a product variant in Shopify. If an error occurs, the job stops and logs the issue to the Job report.
Who it's for
Engineering teams who need to sync product variants to Shopify through a custom API without manual intervention.
How teams use this
Sync variants from an external system
Push product variants from an inventory management system into Shopify through this API endpoint. The automation handles both new variants and updates to existing ones in real-time.
Expose variant operations to partners
Let resellers or distributors create and update Shopify variants through a branded API without direct store access. The same automation logic applies to all callers.
Add variant image sync to the flow
Extend the automation to include product images when creating variants so the Shopify record is complete with visual assets from the API payload.
Route variants by product type
Add a condition to check the product type in the API request and route variants to different Shopify collections based on category. Only variants matching certain types proceed to creation.
How it works
- Receive the API request. Define the request and response parameters for this API endpoint so Shopify variant data can flow in real-time.
- Create the product variant. Create a new product variant in Shopify with the display name, price, and inventory data from the API request payload.
- Update the product variant. Update an existing product variant in Shopify if the variant already exists based on the incoming API data and identifiers.
- Return the variant to the caller. Send the created or updated variant details back through the API response so the caller sees the result and confirmation.
- Log errors and stop. If an error occurs during variant creation or update, log the message to the Job report and stop the job without retrying.