supplierep

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkDeleteSuppliersEndpoint

type BulkDeleteSuppliersEndpoint struct{}

Deletes multiple suppliers in a single atomic operation.

Each supplier's saved addresses and any users belonging to it are deleted along with it. If any supplier ID is not found, no suppliers are deleted.

type BulkDeleteSuppliersRequest

type BulkDeleteSuppliersRequest struct {
	// Supplier IDs to delete.
	SupplierIDs []string `json:"supplier_ids" validate:"required"`
}

Request to delete multiple suppliers.

func (*BulkDeleteSuppliersRequest) SchemaExample

func (*BulkDeleteSuppliersRequest) SchemaExample() any

type CreateSupplierEndpoint

type CreateSupplierEndpoint struct{}

Creates a supplier, optionally with inline bill-to and ship-to addresses.

Returns a conflict error if another supplier in the account already uses the given number.

func (*CreateSupplierEndpoint) Materialize

type CreateSupplierRequest

type CreateSupplierRequest struct {
	// The supplier's name, as shown in the dashboard and on documents.
	Name string `json:"name" validate:"required,max=255"`
	// Human-facing supplier code, such as `SUP-001`.
	//
	// Must be unique per account; creating a supplier with a number already in use returns a conflict error.
	Number string `json:"number" validate:"required,max=255"`
	// Free-form notes about the supplier.
	Note field.Optional[string] `json:"note,omitzero"`
	// Default billing address to create for the supplier.
	//
	// A new address record is created from these values and saved to the supplier; existing addresses cannot be reused here.
	BillToAddress field.Optional[apirequest.AddressInput] `json:"bill_to_address,omitzero"`
	// Default shipping address to create for the supplier.
	//
	// If omitted and `bill_to_address` is provided, the billing address is also used as the default shipping address.
	ShipToAddress field.Optional[apirequest.AddressInput] `json:"ship_to_address,omitzero"`
}

Request to create a supplier.

func (*CreateSupplierRequest) SchemaExample

func (*CreateSupplierRequest) SchemaExample() any

type DeleteSupplierEndpoint

type DeleteSupplierEndpoint struct{}

Deletes a supplier.

The supplier's saved addresses and any users belonging to the supplier are deleted along with it. Returns the supplier as it looked immediately before deletion. Deleting a supplier that has already been deleted returns an error rather than succeeding again.

func (*DeleteSupplierEndpoint) Materialize

type DeleteSupplierRequest

type DeleteSupplierRequest struct {
	// Supplier ID.
	SupplierID string `path:"id" validate:"required"`
}

Request to delete a supplier.

type ListSuppliersEndpoint

type ListSuppliersEndpoint struct{}

Returns a paginated list of suppliers for the current account, newest first.

Filters combine with AND, so an item filter and a date range narrow the list together. The `q` search term matches the supplier name and number.

type ListSuppliersRequest

type ListSuppliersRequest struct {
	apiresource.PaginationRequest
	// Filter to suppliers that can source any of these items.
	//
	// A supplier matches when it provides a material for one of the items, whether or not that material link is active.
	ItemIDs []string `query:"item_ids"`
	// Only return suppliers created at or after this timestamp.
	StartDate *time.Time `query:"starts_at"`
	// Only return suppliers created at or before this timestamp.
	EndDate *time.Time `query:"ends_at"`
}

Request to list suppliers.

type RetrieveSupplierEndpoint

type RetrieveSupplierEndpoint struct{}

Returns a supplier by ID.

type RetrieveSupplierRequest

type RetrieveSupplierRequest struct {
	// Supplier ID.
	SupplierID string `path:"id" validate:"required"`
}

Request to retrieve a supplier by ID.

type SupplierSvcConfig

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

type UpdateSupplierEndpoint

type UpdateSupplierEndpoint struct{}

Partially updates a supplier.

Only provided fields are changed. To update or clear the note, set `update_note` to `true`.

func (*UpdateSupplierEndpoint) Materialize

type UpdateSupplierRequest

type UpdateSupplierRequest struct {
	// Supplier ID.
	SupplierID string `path:"id" validate:"required"`
	// The supplier's name, as shown in the dashboard and on documents.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Human-facing supplier code, such as `SUP-001`.
	//
	// Must be unique per account; updating to a number already used by another supplier returns a conflict error.
	Number field.Optional[string] `json:"number,omitzero" validate:"omitempty,max=255"`
	// New value for the supplier's note.
	//
	// Ignored unless `update_note` is `true`.
	Note field.Optional[string] `json:"note,omitzero"`
	// Whether to apply the `note` field.
	//
	// When `true`, the note is set to the provided `note` value, or cleared if `note` is omitted. When `false`, the note is left unchanged.
	UpdateNote bool `json:"update_note"`
	// ID of an existing address to set as the supplier's default billing address.
	BillToAddressID field.Optional[string] `json:"bill_to_address_id,omitzero" validate:"omitempty"`
	// ID of an existing address to set as the supplier's default shipping address.
	ShipToAddressID field.Optional[string] `json:"ship_to_address_id,omitzero" validate:"omitempty"`
}

Request to update a supplier.

func (*UpdateSupplierRequest) SchemaExample

func (*UpdateSupplierRequest) SchemaExample() any

Jump to

Keyboard shortcuts

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