shippingtermep

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateShippingTermEndpoint

type CreateShippingTermEndpoint struct{}

Creates a shipping term owned by your account.

The new term takes effect on freight quoting once it is assigned as a customer's default shipping term.

func (*CreateShippingTermEndpoint) Materialize

type CreateShippingTermRequest

type CreateShippingTermRequest struct {
	// Human-readable name for the shipping term, used to identify it when assigning shipping terms to customers and orders.
	Name string `json:"name" validate:"required,max=255"`
	// Freight pricing model applied by this shipping term.
	//
	// - `free_freight`: the buyer is never charged for shipping.
	// - `flat_rate_freight`: the buyer is charged the fixed amount in `flat_rate`, regardless of what the carrier would have charged.
	// - `carrier_rate_freight`: the buyer is charged the rate the carrier quotes for the order's carrier and service level.
	Type constants.ShippingTermType `json:"type" validate:"required"`
	// Fixed shipping charge applied to orders.
	//
	// Used only when `type` is `flat_rate_freight`. A `flat_rate_freight` term created without a flat rate falls through to the carrier's quoted rate.
	FlatRate field.Optional[apirequest.QuantityInput] `json:"flat_rate,omitzero"`
	// Order total a buyer must exceed for this term's free-shipping rules to apply.
	//
	// Above this total, freight is free for the service levels in `free_shipping_service_level_ids`.
	MinimumOrderValue field.Optional[apirequest.QuantityInput] `json:"minimum_order_value,omitzero"`
	// IDs of the service levels that ship for free once an order exceeds `minimum_order_value`.
	//
	// Leave this empty to let every service level ship free above the threshold. The request is rejected if any ID is not a service level available to your account.
	FreeShippingServiceLevelIDs []string `json:"free_shipping_service_level_ids,omitzero"`
}

Request to create a shipping term.

func (*CreateShippingTermRequest) SchemaExample

func (*CreateShippingTermRequest) SchemaExample() any

type DeleteShippingTermEndpoint

type DeleteShippingTermEndpoint struct{}

Deletes a shipping term owned by your account.

System-provided default shipping terms cannot be deleted. The term's free-shipping service level rules, flat rate and minimum order value go with it, and deleting a term that has already been deleted returns an error rather than succeeding again.

type DeleteShippingTermRequest

type DeleteShippingTermRequest struct {
	// Shipping term ID.
	ShippingTermID string `path:"id" validate:"required"`
}

Request to delete a shipping term.

type ListShippingTermsEndpoint

type ListShippingTermsEndpoint struct{}

Returns a paginated list of shipping terms, newest first.

Both the terms your account has created and the system-provided default terms are returned. The `q` parameter matches on the shipping term name.

type ListShippingTermsRequest

type ListShippingTermsRequest struct {
	apiresource.PaginationRequest
}

Request to list shipping terms.

type RetrieveShippingTermEndpoint

type RetrieveShippingTermEndpoint struct{}

Returns a shipping term by ID.

type RetrieveShippingTermRequest

type RetrieveShippingTermRequest struct {
	// Shipping term ID.
	ShippingTermID string `path:"id" validate:"required"`
}

Request to retrieve a shipping term.

type ShippingTermSvcConfig

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

type UpdateShippingTermEndpoint

type UpdateShippingTermEndpoint struct{}

Partially updates a shipping term owned by your account.

System-provided default shipping terms cannot be updated. Changes affect freight quoted after the update; freight already recorded on existing orders is not recalculated.

func (*UpdateShippingTermEndpoint) Materialize

type UpdateShippingTermRequest

type UpdateShippingTermRequest struct {
	// Shipping term ID.
	ShippingTermID string `path:"id" validate:"required"`
	// Human-readable name for the shipping term, used to identify it when assigning shipping terms to customers and orders.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Freight pricing model applied by this shipping term.
	//
	// - `free_freight`: the buyer is never charged for shipping.
	// - `flat_rate_freight`: the buyer is charged the fixed amount in `flat_rate`, regardless of what the carrier would have charged.
	// - `carrier_rate_freight`: the buyer is charged the rate the carrier quotes for the order's carrier and service level.
	Type field.Optional[constants.ShippingTermType] `json:"type,omitzero"`
	// Fixed shipping charge applied to orders.
	//
	// Used only when `type` is `flat_rate_freight`. Clearing it leaves a `flat_rate_freight` term falling through to the carrier's quoted rate.
	FlatRate field.Clearable[apirequest.QuantityInput] `json:"flat_rate,omitzero"`
	// Order total a buyer must exceed for this term's free-shipping rules to apply.
	//
	// Clearing it removes the free-shipping threshold, so orders are charged according to `type` regardless of their total.
	MinimumOrderValue field.Clearable[apirequest.QuantityInput] `json:"minimum_order_value,omitzero"`
	// IDs of the service levels that ship for free once an order exceeds `minimum_order_value`.
	//
	// Replaces the whole list rather than adding to it, and clearing it lets every service level ship free above the threshold. The request is rejected if any ID is not a service level available to your account.
	FreeShippingServiceLevelIDs field.Clearable[[]string] `json:"free_shipping_service_level_ids,omitzero"`
}

Request to partially update a shipping term.

Fields left out of the request keep their current values. Send an explicit JSON `null` for `flat_rate`, `minimum_order_value`, or `free_shipping_service_level_ids` to clear the stored value.

func (*UpdateShippingTermRequest) SchemaExample

func (*UpdateShippingTermRequest) SchemaExample() any

Jump to

Keyboard shortcuts

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