accountgroupep

package
v1.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountGroupSvcConfig

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

type CreateAccountGroupEndpoint

type CreateAccountGroupEndpoint struct{}

Creates an account group.

Returns a conflict error if an account group with the same name already exists.

func (*CreateAccountGroupEndpoint) Materialize

type CreateAccountGroupRequest

type CreateAccountGroupRequest struct {
	// Display name of the account group.
	//
	// Must be unique within your account.
	Name string `json:"name" validate:"required,max=255"`
	// How this account group will be used.
	//
	// - `pricing_group`: used for pricing rules, such as a "Preferred" group that receives a special discount.
	// - `type_group`: used to categorize accounts, such as "Consumers" or "Distributors".
	//
	// The type cannot be changed after creation.
	Type constants.AccountGroupType `json:"type" validate:"required"`
	// How sales commission applies to accounts in this group.
	//
	// - `commission_applied`: sales commission is calculated on orders from accounts in this group.
	// - `commission_exempt`: orders from accounts in this group are exempt from commission.
	//
	// Leave this out and the group is created commission-exempt, so orders from its accounts earn no sales commission until you change it.
	CommissionPolicy field.Optional[constants.CommissionPolicy] `json:"commission_policy,omitzero" default:"commission_exempt"`
	// How freight charges apply to orders from accounts in this group.
	//
	// - `free_freight`: customers within this group will not have to pay for freight.
	// - `billed_freight`: freight will be applied to any order within this account group, unless overridden elsewhere.
	FreightPolicy field.Optional[constants.FreightPolicy] `json:"freight_policy,omitzero" default:"billed_freight"`
	// Calendar days between an order being issued and it being due to ship, inherited by every customer in this group that has not set its own.
	DefaultLeadTimeDays field.Optional[int32] `json:"default_lead_time_days,omitzero" validate:"omitempty,gte=0,lte=3650"`
	// Free-form description of the account group.
	Description field.Optional[string] `json:"description,omitzero"`
}

Request to create an account group.

func (*CreateAccountGroupRequest) SchemaExample

func (*CreateAccountGroupRequest) SchemaExample() any

type DeleteAccountGroupEndpoint

type DeleteAccountGroupEndpoint struct{}

Deletes an account group.

Deletion fails with a validation error while the group is still in use: a `type_group` that is set as a customer's type cannot be deleted, and no group can be deleted while it grants product line access, backs a volume discount, or is attached to a customer registration flow.

Deleting a `pricing_group` first unassigns it from every customer it was applied to, so those customers immediately stop receiving its pricing.

type DeleteAccountGroupRequest

type DeleteAccountGroupRequest struct {
	// Account group ID.
	AccountGroupID string `path:"id" validate:"required"`
}

Request to delete an account group.

type ListAccountGroupsEndpoint

type ListAccountGroupsEndpoint struct{}

Returns a paginated list of account groups, newest first.

The `q` search term matches the group's name and description.

type ListAccountGroupsRequest

type ListAccountGroupsRequest struct {
	apiresource.PaginationRequest
	// Filters results to account groups of the given type.
	Type *constants.AccountGroupType `query:"type"`
}

Request to list account groups.

type RetrieveAccountGroupEndpoint

type RetrieveAccountGroupEndpoint struct{}

Returns an account group by ID.

type RetrieveAccountGroupRequest

type RetrieveAccountGroupRequest struct {
	// Account group ID.
	AccountGroupID string `path:"id" validate:"required"`
}

Request to retrieve an account group.

type UpdateAccountGroupEndpoint

type UpdateAccountGroupEndpoint struct{}

Partially updates an account group.

Only the provided fields are changed. The account group's `type` cannot be changed after creation, and renaming the group to a name another group in your account already uses returns a conflict error.

A new commission or freight policy takes effect for every account already in the group, not just accounts added afterwards.

func (*UpdateAccountGroupEndpoint) Materialize

type UpdateAccountGroupRequest

type UpdateAccountGroupRequest struct {
	// Account group ID.
	AccountGroupID string `path:"id" validate:"required"`
	// Display name of the account group.
	//
	// Must be unique within your account.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Free-form description of the account group.
	Description field.Clearable[string] `json:"description,omitzero"`
	// How sales commission applies to accounts in this group.
	//
	// - `commission_applied`: sales commission is calculated on orders from accounts in this group.
	// - `commission_exempt`: orders from accounts in this group are exempt from commission.
	CommissionPolicy field.Optional[constants.CommissionPolicy] `json:"commission_policy,omitzero"`
	// How freight charges apply to orders from accounts in this group.
	//
	// - `free_freight`: customers within this group will not have to pay for freight.
	// - `billed_freight`: freight will be applied to any order within this account group, unless overridden elsewhere.
	FreightPolicy field.Optional[constants.FreightPolicy] `json:"freight_policy,omitzero"`
	// Calendar days between an order being issued and it being due to ship, inherited by every customer in this group that has not set its own. Clearing it returns the group's customers to the account default.
	DefaultLeadTimeDays field.Clearable[int32] `json:"default_lead_time_days,omitzero" validate:"omitempty,gte=0,lte=3650"`
}

Request to partially update an account group.

func (*UpdateAccountGroupRequest) SchemaExample

func (*UpdateAccountGroupRequest) SchemaExample() any

Jump to

Keyboard shortcuts

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