The Item Variant object

Attributes

id string

Unique identifier for the object.

idx integer
parent_id string
parent_type string
item_attribute string required
item_attribute_value string required
The Item Variant 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"
}
GET /api/stock/item-variant?parent_id={id}

List item variants by parent

Returns all item variants belonging to the specified parent.

Query parameters

parent_id string required

The ID of the parent to list children for.

Returns

A list of item variant objects belonging to the parent.

GET /api/stock/item-variant?parent_id={id}
curl https://api.overplane.dev/api/stock/item-variant?parent_id=parent_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "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
}
POST /api/stock/item-variant

Create a item variant

Creates a new item variant object.

Body parameters

idx integer
parent_id string
parent_type string
item_attribute string required
item_attribute_value string required

Returns

Returns the newly created item variant object if the call succeeded.

POST /api/stock/item-variant
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"}'
Response
{
  "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"
}
PATCH /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

id string required

The identifier of the item variant to update.

Body parameters

idx integer
parent_id string
parent_type string
item_attribute string
item_attribute_value string

Returns

Returns the updated item variant object.

PATCH /api/stock/item-variant/{id}
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}'
Response
{
  "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"
}
DELETE /api/stock/item-variant/{id}

Delete a item variant

Permanently deletes a item variant. This cannot be undone.

Path parameters

id string required

The identifier of the item variant to delete.

Returns

Returns a confirmation that the item variant has been deleted.

DELETE /api/stock/item-variant/{id}
curl https://api.overplane.dev/api/stock/item-variant/item-variant_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "item-variant_abc123",
  "deleted": true
}
POST /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.

POST /api/stock/item-variant/reorder
curl https://api.overplane.dev/api/stock/item-variant/reorder \
  -H "Authorization: Bearer sk_test_..." \
  -X POST
Response
{
  "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"
}