The Item Variant object
Attributes
Unique identifier for the object.
{
"id": "item-variant_abc123",
"idx": 1,
"parent_id": null,
"parent_type": "parent_type_example",
"item_attribute": "item_attribute_example",
"item_attribute_value": "item_attribute_value_example"
} /api/stock/item-variant?parent_id={id} List item variants by parent
Returns all item variants belonging to the specified parent.
Query parameters
The ID of the parent to list children for.
Returns
A list of item variant objects belonging to the parent.
curl https://api.overplane.dev/api/stock/item-variant?parent_id=parent_abc123 \
-H "Authorization: Bearer sk_test_..." {
"data": [
{
"id": "item-variant_abc123",
"idx": 1,
"parent_id": null,
"parent_type": "parent_type_example",
"item_attribute": "item_attribute_example",
"item_attribute_value": "item_attribute_value_example"
}
],
"has_more": false,
"total": 1
} /api/stock/item-variant Create a item variant
Creates a new item variant object.
Body parameters
Returns
Returns the newly created item variant object if the call succeeded.
curl https://api.overplane.dev/api/stock/item-variant \
-H "Authorization: Bearer sk_test_..." \
-X POST \
-H "Content-Type: application/json" \
-d '{"item_attribute":"item_attribute_example","item_attribute_value":"item_attribute_value_example"}' {
"id": "item-variant_abc123",
"idx": 1,
"parent_id": null,
"parent_type": "parent_type_example",
"item_attribute": "item_attribute_example",
"item_attribute_value": "item_attribute_value_example"
} /api/stock/item-variant/{id} Update a item variant
Updates the specified item variant by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Path parameters
The identifier of the item variant to update.
Body parameters
Returns
Returns the updated item variant object.
curl https://api.overplane.dev/api/stock/item-variant/item-variant_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"idx":1,"parent_id":null}' {
"id": "item-variant_abc123",
"idx": 1,
"parent_id": null,
"parent_type": "parent_type_example",
"item_attribute": "item_attribute_example",
"item_attribute_value": "item_attribute_value_example"
} /api/stock/item-variant/{id} Delete a item variant
Permanently deletes a item variant. This cannot be undone.
Path parameters
The identifier of the item variant to delete.
Returns
Returns a confirmation that the item variant has been deleted.
curl https://api.overplane.dev/api/stock/item-variant/item-variant_abc123 \
-H "Authorization: Bearer sk_test_..." \
-X DELETE {
"id": "item-variant_abc123",
"deleted": true
} /api/stock/item-variant/reorder Reorder item variants
Updates the sort order of item variants within their parent by setting new index values.
Returns
Returns the reordered list.
curl https://api.overplane.dev/api/stock/item-variant/reorder \
-H "Authorization: Bearer sk_test_..." \
-X POST {
"id": "item-variant_abc123",
"idx": 1,
"parent_id": null,
"parent_type": "parent_type_example",
"item_attribute": "item_attribute_example",
"item_attribute_value": "item_attribute_value_example"
}