For up-to-date API endpoints, request and response examples, and more, visit our API docs.
API Description
The Quality Control (QC) API enables integration with Swap's QC system to record and update the condition of returned items.
This version introduces support for identifying items using the Shopify line item ID in addition to SKU. This ensures accurate QC updates when multiple variants share the same SKU.
The API complements existing CSV and Mintsoft integrations, allowing compatibility with a wider range of warehouse management systems (WMS).
API Logic
When called, the API updates QC information for one or more returned items.
If both sku and shopify_line_item_id are provided, the shopify_line_item_id will take priority.
If only sku is provided, behaviour remains the same as before.
If a SKU or line item ID does not match an existing order, the item is recorded in the Unexpected tab in the RMA list for administrative review.
Order lookup behaviour
The API can resolve the return using either the Shopify internal order ID (shopify_order_id) or the Shopify order name (shopify_order_name).
If both are provided, the API will use the available identifier to locate the return.
If neither identifier matches an existing order, the item will be handled according to the Unexpected item logic.
Authentication
All requests require an API token in the x-api-key header.
How to generate an API key
Go to Returns → Quality Control Settings in the Swap dashboard.
Enable Quality Control.
Click Generate API Key.
Copy the token from the popup (it will not be shown again).
Note: Once generated, the Generate API Key button is disabled to prevent duplicates.
How to rotate your API key
Go to Returns → Quality Control Settings in the Swap dashboard.
In the API key panel, click the refresh icon.
Rotating deactivates the old key immediately and issues a new one, so update your integration with the new key before rotating to avoid dropped requests.