itemcategoryep

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddItemCategoryPropertyEndpoint

type AddItemCategoryPropertyEndpoint struct{}

Attaches one of your account's properties to an item category.

The property then appears among the category's properties, including in the customer-facing catalog, describing a dimension along which the category's items vary. Each property name can appear only once per category, so attaching a property whose name duplicates one already there returns a conflict error.

type AddItemCategoryPropertyRequest

type AddItemCategoryPropertyRequest struct {
	// Item category ID.
	ItemCategoryID string `path:"id" validate:"required"`
	// ID of the property to add to the category.
	PropertyID string `path:"property_id" validate:"required"`
}

Request to add a property to an item category.

type BulkUpsertItemCategoriesEndpoint

type BulkUpsertItemCategoriesEndpoint struct{}

Creates or updates multiple item categories for the account, matched by name (case-insensitive), then writes asynchronously — 202 with a job to poll.

func (*BulkUpsertItemCategoriesEndpoint) Materialize

type BulkUpsertItemCategoriesRequest

type BulkUpsertItemCategoriesRequest struct {
	// Item categories to create or update, matched by name within the account.
	ItemCategories []UpsertItemCategoryInput `json:"item_categories" validate:"required,min=1,max=1000,dive"`
}

BulkUpsertItemCategoriesRequest is the request to bulk upsert item categories.

func (*BulkUpsertItemCategoriesRequest) SchemaExample

func (*BulkUpsertItemCategoriesRequest) SchemaExample() any

type ChangeItemCategoryUnitGroupEndpoint

type ChangeItemCategoryUnitGroupEndpoint struct{}

Changes the unit group of an item category, and with it the units its items can be ordered in.

The new unit group must have the same unit type as the current one — for example, a category measured in `mass` units can only switch to another `mass` unit group. System-owned categories cannot be modified.

type ChangeItemCategoryUnitGroupRequest

type ChangeItemCategoryUnitGroupRequest struct {
	// Item category ID.
	ItemCategoryID string `path:"id" validate:"required"`
	// ID of the unit group to associate with the category.
	//
	// Must have the same unit type as the category's current unit group; otherwise the request fails with a validation error.
	UnitGroupID string `path:"unit_group_id" validate:"required"`
}

Request to change the unit group of an item category.

type CreateItemCategoryEndpoint

type CreateItemCategoryEndpoint struct{}

Creates an item category owned by your account.

The new category starts with no properties; attach them afterwards with the Add Item Category Property endpoint.

func (*CreateItemCategoryEndpoint) Materialize

type CreateItemCategoryRequest

type CreateItemCategoryRequest struct {
	// Display name of the item category.
	Name string `json:"name" validate:"required,max=255"`
	// What kind of items this category groups.
	//
	// - `material_category`: groups raw materials and components (items of type `material`).
	// - `product_category`: groups finished products and parts (items of type `product` or `part`).
	//
	// The type is fixed once the category is created.
	Type constants.ItemCategoryType `json:"type" validate:"required"`
	// ID of the unit group that determines the units of measure available to items in this category.
	//
	// Must be one of your account's unit groups or a platform-provided one. After creation the unit group can only be replaced by another unit group of the same unit type, through the Change Item Category Unit Group endpoint.
	UnitGroupID string `json:"unit_group_id" validate:"required"`
}

Request to create an item category.

func (*CreateItemCategoryRequest) SchemaExample

func (*CreateItemCategoryRequest) SchemaExample() any

type DeleteItemCategoryEndpoint

type DeleteItemCategoryEndpoint struct{}

Deletes an item category owned by your account.

System-owned categories cannot be deleted. Deleting a category that was already deleted returns an already-deleted error rather than a not-found error.

type DeleteItemCategoryRequest

type DeleteItemCategoryRequest struct {
	// Item category ID.
	ItemCategoryID string `path:"id" validate:"required"`
}

Request to delete an item category.

type ExportItemCategoriesEndpoint

type ExportItemCategoriesEndpoint struct{}

Starts an export of every matching item category and returns the job that tracks it.

func (*ExportItemCategoriesEndpoint) Materialize

type ExportItemCategoriesRequest

type ExportItemCategoriesRequest struct {
	// Free-text search term matched against category names.
	Query *string `json:"q"`
}

Filters which item categories land in the exported file.

func (*ExportItemCategoriesRequest) SchemaExample

func (*ExportItemCategoriesRequest) SchemaExample() any

type ItemCategorySvcConfig

type ItemCategorySvcConfig struct {
	// CoreClient (required) is the core-service gRPC client.
	CoreClient pb.CoreServiceClient
}

type ListItemCategoriesEndpoint

type ListItemCategoriesEndpoint struct{}

Returns a paginated list of the item categories available to the current account, newest first.

Both the account's own categories and the platform-provided system categories are included. The `q` search term is matched against the category name.

type ListItemCategoriesRequest

type ListItemCategoriesRequest struct {
	apiresource.PaginationRequest
	// Filter by item category type.
	Type *constants.ItemCategoryType `query:"type"`
}

Request to list item categories.

type RemoveItemCategoryPropertyEndpoint

type RemoveItemCategoryPropertyEndpoint struct{}

Detaches a property from an item category.

Only the link between the property and the category is removed; the property itself and its attributes are left intact and stay available to other categories. The property must belong to your account.

type RemoveItemCategoryPropertyRequest

type RemoveItemCategoryPropertyRequest struct {
	// Item category ID.
	ItemCategoryID string `path:"id" validate:"required"`
	// ID of the property to remove from the category.
	PropertyID string `path:"property_id" validate:"required"`
}

Request to remove a property from an item category.

type RetrieveItemCategoryEndpoint

type RetrieveItemCategoryEndpoint struct{}

Returns an item category by ID.

Both account-owned categories and global system categories can be retrieved.

type RetrieveItemCategoryRequest

type RetrieveItemCategoryRequest struct {
	// Item category ID.
	ItemCategoryID string `path:"id" validate:"required"`
}

Request to retrieve an item category.

type UpdateItemCategoryEndpoint

type UpdateItemCategoryEndpoint struct{}

Updates the name or notes of an item category owned by your account.

Only the fields present in the request body are changed. A category's type is fixed at creation, and its unit group is changed through the Change Item Category Unit Group endpoint. System-owned categories cannot be updated.

func (*UpdateItemCategoryEndpoint) Materialize

type UpdateItemCategoryRequest

type UpdateItemCategoryRequest struct {
	// Item category ID.
	ItemCategoryID string `path:"id" validate:"required"`
	// Display name of the item category.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Free-form notes about the item category.
	Notes field.Optional[string] `json:"notes,omitzero"`
}

Request to partially update an item category.

func (*UpdateItemCategoryRequest) SchemaExample

func (*UpdateItemCategoryRequest) SchemaExample() any

type UpsertItemCategoryInput

type UpsertItemCategoryInput struct {
	// Display name of the item category, used to match existing categories.
	Name string `json:"name" validate:"required,max=255"`
	// Item category type code. Create-only.
	Type constants.ItemCategoryType `json:"type" validate:"required"`
	// Unit group to associate with this item category, referenced by `id` or `name`.
	UnitGroup apirequest.ObjectIdentifier `json:"unit_group" validate:"required"`
	// Optional list of property names to attach to this category. Properties are matched
	// by name (case-insensitive) within the account; names not found are created automatically.
	// Relations are additive — existing relations are not removed.
	PropertyNames []string `json:"property_names" default:"[]"`
	// Optional notes.
	Notes *string `json:"notes" default:"null" nullable:"true"`
}

UpsertItemCategoryInput is the input for a single item category in a bulk upsert operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL