carrierep

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 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 CarrierSvcConfig

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

type CreateCarrierEndpoint

type CreateCarrierEndpoint struct{}

Creates a shipping carrier your account can ship orders with.

Supplying a Shippo-supported code (`fedex`, `ups`, `usps`) connects a Shippo carrier account and creates a service level for every service that carrier offers, each hidden from the customer portal until you make it visible. This requires an active Shippo integration on the account and is skipped entirely for sandbox accounts, which get a carrier record with no service levels and no live rating.

func (*CreateCarrierEndpoint) Materialize

type CreateCarrierRequest

type CreateCarrierRequest struct {
	// Human-readable name for the carrier.
	//
	// Must not match another carrier already visible to your account, including the system-provided ones.
	Name string `json:"name" validate:"required,max=255"`
	// Well-known carrier code.
	//
	// Providing a Shippo-supported code (`fedex`, `ups`, `usps`) connects the carrier through Shippo and syncs its service levels; the other codes, such as `will_call` and `delivery`, simply describe a self-managed shipping method. Omit the code entirely when none of them fit. The code cannot be changed after the carrier is created.
	Code field.Optional[constants.CarrierCode] `json:"code,omitzero"`
	// Your account number with this carrier.
	//
	// Required when `code` is `ups` or `usps`, whose carrier accounts are connected to Shippo using this number; FedEx authorizes through OAuth instead, so no account number is needed.
	AccountNumber field.Optional[string] `json:"account_number,omitzero" validate:"omitempty,max=255"`
	// Whether customers can see and select this carrier at checkout in the customer portal.
	CustomerPortalVisibility field.Optional[constants.CustomerPortalVisibility] `json:"customer_portal_visibility,omitzero" default:"visible"`
}

Request to create a carrier.

func (*CreateCarrierRequest) SchemaExample

func (*CreateCarrierRequest) SchemaExample() any

type DeleteCarrierEndpoint

type DeleteCarrierEndpoint struct{}

Deletes a carrier and all of its service levels.

If the carrier is connected through Shippo, its Shippo carrier account is deactivated. System-owned carriers cannot be deleted.

func (*DeleteCarrierEndpoint) Materialize

type DeleteCarrierRequest

type DeleteCarrierRequest struct {
	// Carrier ID.
	CarrierID string `path:"id" validate:"required"`
}

Request to delete a carrier.

type GetOAuthStatusEndpoint

type GetOAuthStatusEndpoint struct{}

Reports whether a carrier's account has been authorized for live rating and label purchase.

Only carriers connected through Shippo have an account to authorize; every other carrier reports `disconnected`, as do sandbox accounts and carriers whose account cannot be reached.

type GetOAuthStatusRequest

type GetOAuthStatusRequest struct {
	// Carrier ID.
	CarrierID string `path:"id" validate:"required"`
}

Request to get carrier OAuth status.

type InitiateOAuthEndpoint

type InitiateOAuthEndpoint struct{}

Starts the OAuth flow that authorizes your own account with the carrier, returning the URL to send the user to.

The carrier must already have a Shippo carrier account, which is created when the carrier is created with a Shippo-supported code. Not available in sandbox mode.

func (*InitiateOAuthEndpoint) Materialize

type InitiateOAuthRequest

type InitiateOAuthRequest struct {
	// Carrier ID.
	CarrierID string `path:"id" validate:"required"`
	// URL the carrier sends the user back to once they finish authorizing.
	RedirectURI string `json:"redirect_uri" validate:"required"`
	// Opaque value passed through the OAuth flow and handed back on the redirect.
	//
	// Use it to correlate the callback with the request that started it, or to carry the page the user should return to.
	State field.Optional[string] `json:"state,omitzero"`
}

Request to initiate carrier OAuth.

func (*InitiateOAuthRequest) SchemaExample

func (*InitiateOAuthRequest) SchemaExample() any

type ListCarriersEndpoint

type ListCarriersEndpoint struct{}

Returns a paginated list of the carriers available to the current account.

This covers the carriers you have created plus the platform-provided system carriers that every account shares.

type ListCarriersRequest

type ListCarriersRequest struct {
	apiresource.PaginationRequest
}

Request to list carriers.

type RetrieveCarrierEndpoint

type RetrieveCarrierEndpoint struct{}

Returns a carrier by ID.

func (*RetrieveCarrierEndpoint) Materialize

type RetrieveCarrierRequest

type RetrieveCarrierRequest struct {
	// Carrier ID.
	CarrierID string `path:"id" validate:"required"`
}

Request to retrieve a carrier by ID.

type SyncOptionsEndpoint

type SyncOptionsEndpoint struct{}

Re-syncs a carrier's service levels from Shippo.

Service levels newly offered by the carrier are added (initially hidden from the customer portal) and previously synced ones no longer offered are removed; manually created service levels are untouched. Only available for Shippo-managed carriers; not available in sandbox mode.

func (*SyncOptionsEndpoint) Materialize

type SyncOptionsRequest

type SyncOptionsRequest struct {
	// Carrier ID.
	CarrierID string `path:"id" validate:"required"`
}

Request to sync a carrier's service levels from Shippo.

type UpdateCarrierEndpoint

type UpdateCarrierEndpoint struct{}

Updates a carrier's name and customer portal visibility.

Only these two attributes can change: a carrier's code and account number are fixed at creation, and system-owned carriers cannot be updated at all.

func (*UpdateCarrierEndpoint) Materialize

type UpdateCarrierRequest

type UpdateCarrierRequest struct {
	// Carrier ID.
	CarrierID string `path:"id" validate:"required"`
	// Human-readable name for the carrier.
	//
	// Must not match another carrier already visible to your account, including the system-provided ones.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Whether customers can see and select this carrier at checkout in the customer portal.
	//
	// Each of the carrier's service levels carries its own customer portal visibility, which this does not change.
	CustomerPortalVisibility field.Optional[constants.CustomerPortalVisibility] `json:"customer_portal_visibility,omitzero"`
}

Request to update a carrier.

func (*UpdateCarrierRequest) SchemaExample

func (*UpdateCarrierRequest) SchemaExample() any

Jump to

Keyboard shortcuts

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