shippingoptions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shippingoptions provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.

Index

Constants

View Source
const (
	OAuthScopes = "OAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewPostOptionsSearchRequest

func NewPostOptionsSearchRequest(server string, body PostOptionsSearchJSONRequestBody) (*http.Request, error)

NewPostOptionsSearchRequest calls the generic PostOptionsSearch builder with application/json body

func NewPostOptionsSearchRequestWithBody

func NewPostOptionsSearchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostOptionsSearchRequestWithBody generates requests for PostOptionsSearch with any type of body

Types

type AllMailClasses

type AllMailClasses struct {
	// contains filtered or unexported fields
}

AllMailClasses List or enumeration of the domestic or international mail classes available

func (AllMailClasses) AsDomesticMailClass

func (t AllMailClasses) AsDomesticMailClass() (DomesticMailClass, error)

AsDomesticMailClass returns the union data inside the AllMailClasses as a DomesticMailClass

func (AllMailClasses) AsInternationalMailClass

func (t AllMailClasses) AsInternationalMailClass() (InternationalMailClass, error)

AsInternationalMailClass returns the union data inside the AllMailClasses as a InternationalMailClass

func (*AllMailClasses) FromDomesticMailClass

func (t *AllMailClasses) FromDomesticMailClass(v DomesticMailClass) error

FromDomesticMailClass overwrites any union data inside the AllMailClasses as the provided DomesticMailClass

func (*AllMailClasses) FromInternationalMailClass

func (t *AllMailClasses) FromInternationalMailClass(v InternationalMailClass) error

FromInternationalMailClass overwrites any union data inside the AllMailClasses as the provided InternationalMailClass

func (AllMailClasses) MarshalJSON

func (t AllMailClasses) MarshalJSON() ([]byte, error)

func (*AllMailClasses) MergeDomesticMailClass

func (t *AllMailClasses) MergeDomesticMailClass(v DomesticMailClass) error

MergeDomesticMailClass performs a merge with any union data inside the AllMailClasses, using the provided DomesticMailClass

func (*AllMailClasses) MergeInternationalMailClass

func (t *AllMailClasses) MergeInternationalMailClass(v InternationalMailClass) error

MergeInternationalMailClass performs a merge with any union data inside the AllMailClasses, using the provided InternationalMailClass

func (*AllMailClasses) UnmarshalJSON

func (t *AllMailClasses) UnmarshalJSON(b []byte) error

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) PostOptionsSearch

func (c *Client) PostOptionsSearch(ctx context.Context, body PostOptionsSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostOptionsSearchWithBody

func (c *Client) PostOptionsSearchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// PostOptionsSearchWithBody request with any body
	PostOptionsSearchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostOptionsSearch(ctx context.Context, body PostOptionsSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) PostOptionsSearchWithBodyWithResponse

func (c *ClientWithResponses) PostOptionsSearchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOptionsSearchResponse, error)

PostOptionsSearchWithBodyWithResponse request with arbitrary body returning *PostOptionsSearchResponse

func (*ClientWithResponses) PostOptionsSearchWithResponse

func (c *ClientWithResponses) PostOptionsSearchWithResponse(ctx context.Context, body PostOptionsSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOptionsSearchResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostOptionsSearchWithBodyWithResponse request with any body
	PostOptionsSearchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOptionsSearchResponse, error)

	PostOptionsSearchWithResponse(ctx context.Context, body PostOptionsSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOptionsSearchResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Commitment

type Commitment struct {
	// CutOffTime The latest time packages may be entered at the acceptance location. Packages entered after the cut-off time will have an effective date one day after the requested acceptance date and time.
	CutOffTime *float32 `json:"cutOffTime,omitempty"`

	// EffectiveAcceptanceDate The effective acceptance date based on the requested acceptance date, time, and the facility cut-off times.
	EffectiveAcceptanceDate *openapi_types.Date `json:"effectiveAcceptanceDate,omitempty"`

	// ExpectedDeliveryDate Date in the YYYY-MM-DD format.
	ExpectedDeliveryDate *openapi_types.Date `json:"expectedDeliveryDate,omitempty"`

	// GuaranteedDelivery If true, the expectedDeliveryDate is guaranteed.
	GuaranteedDelivery *bool `json:"guaranteedDelivery,omitempty"`

	// IsPriorityMailNextDay Indicates if the commitment is for Priority Mail Next Day service.
	IsPriorityMailNextDay *bool `json:"isPriorityMailNextDay,omitempty"`

	// Name Commitment name such as 1 Day, 2 Days, 3 Days, MILITARY, DPO, NO STD, or UNAVAILABLE.
	Name *string `json:"name,omitempty"`

	// ScheduleDeliveryDate Date USPS expects that the package or mailpiece will be delivered based on the origin, destination, and drop-off time and date in the request. Actual delivery date may vary based on when the package or mailpiece is entered or other conditions.
	//
	// Note: This field has been deprecated in favor of `expectedDeliveryDate` and will be removed in a future release. Please transition to using `expectedDeliveryDate`.
	// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
	ScheduleDeliveryDate *openapi_types.Date    `json:"scheduleDeliveryDate,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

Commitment The commitment and the scheduled delivery date of the package.

func (Commitment) Get

func (a Commitment) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for Commitment. Returns the specified element and whether it was found

func (Commitment) MarshalJSON

func (a Commitment) MarshalJSON() ([]byte, error)

Override default JSON handling for Commitment to handle AdditionalProperties

func (*Commitment) Set

func (a *Commitment) Set(fieldName string, value interface{})

Setter for additional properties for Commitment

func (*Commitment) UnmarshalJSON

func (a *Commitment) UnmarshalJSON(b []byte) error

Override default JSON handling for Commitment to handle AdditionalProperties

type DestinationZIPCode

type DestinationZIPCode = string

DestinationZIPCode The destination ZIP code for the package.

type DomesticMailClass

type DomesticMailClass string

DomesticMailClass The domestic mail service requested.

const (
	DomesticMailClassBOUNDPRINTEDMATTER               DomesticMailClass = "BOUND_PRINTED_MATTER"
	DomesticMailClassLIBRARYMAIL                      DomesticMailClass = "LIBRARY_MAIL"
	DomesticMailClassMARKETINGMAILPARCELS             DomesticMailClass = "MARKETING_MAIL_PARCELS"
	DomesticMailClassMEDIAMAIL                        DomesticMailClass = "MEDIA_MAIL"
	DomesticMailClassPARCELSELECT                     DomesticMailClass = "PARCEL_SELECT"
	DomesticMailClassPRIORITYMAIL                     DomesticMailClass = "PRIORITY_MAIL"
	DomesticMailClassPRIORITYMAILEXPRESS              DomesticMailClass = "PRIORITY_MAIL_EXPRESS"
	DomesticMailClassPRIORITYMAILEXPRESSRETURNSERVICE DomesticMailClass = "PRIORITY_MAIL_EXPRESS_RETURN_SERVICE"
	DomesticMailClassPRIORITYMAILRETURNSERVICE        DomesticMailClass = "PRIORITY_MAIL_RETURN_SERVICE"
	DomesticMailClassUSPSCONNECTLOCAL                 DomesticMailClass = "USPS_CONNECT_LOCAL"
	DomesticMailClassUSPSCONNECTMAIL                  DomesticMailClass = "USPS_CONNECT_MAIL"
	DomesticMailClassUSPSCONNECTREGIONAL              DomesticMailClass = "USPS_CONNECT_REGIONAL"
	DomesticMailClassUSPSGROUNDADVANTAGE              DomesticMailClass = "USPS_GROUND_ADVANTAGE"
	DomesticMailClassUSPSGROUNDADVANTAGERETURNSERVICE DomesticMailClass = "USPS_GROUND_ADVANTAGE_RETURN_SERVICE"
)

Defines values for DomesticMailClass.

type DomesticOptions

type DomesticOptions struct {
	// MailClass The domestic mail service requested.
	MailClass *DomesticMailClass `json:"mailClass,omitempty"`

	// RateOptions List of domestic rate options
	RateOptions *[]DomesticRateOptions `json:"rateOptions,omitempty"`
}

DomesticOptions TBD

type DomesticOptionsRequest

type DomesticOptionsRequest struct {
	// DestinationEntryFacilityType Types of Facilities:
	//
	// * NONE - Translate to Destination Rate Indicator N
	// * DESTINATION_NETWORK_DISTRIBUTION_CENTER - Translate to Destination Rate Indicator B
	// * DESTINATION_SECTIONAL_CENTER_FACILITY - Translate to Destination Rate Indicator S
	// * DESTINATION_DELIVERY_UNIT - Translate to Destination Rate Indicator D
	// * DESTINATION_SERVICE_HUB - Translate to Destination Rate Indicator H
	// * DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER - Translate to Destination Rate Indicator B
	//
	// Note:
	// - The Destination Entry Facility Type is only used in calculating Shipping Standards.
	// - Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible.
	// - Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.
	DestinationEntryFacilityType *DomesticOptionsRequestDestinationEntryFacilityType `json:"destinationEntryFacilityType,omitempty"`

	// DestinationZIPCode The destination ZIP code for the package.
	DestinationZIPCode DestinationZIPCode `json:"destinationZIPCode"`

	// OriginZIPCode The originating ZIP code for the package.
	OriginZIPCode OriginZIPCode `json:"originZIPCode"`

	// PackageDescription Details of package being shipped
	PackageDescription DomesticPackageDescription `json:"packageDescription"`

	// PricingOptions List of domestic pricing options
	PricingOptions []DomesticPricingOption `json:"pricingOptions"`

	// ShippingFilter A filter for domestic results to return only one response based on lowest price or fastest service standard
	ShippingFilter *DomesticOptionsRequestShippingFilter `json:"shippingFilter,omitempty"`
}

DomesticOptionsRequest Domestic Options Request

type DomesticOptionsRequestDestinationEntryFacilityType

type DomesticOptionsRequestDestinationEntryFacilityType string

DomesticOptionsRequestDestinationEntryFacilityType Types of Facilities:

* NONE - Translate to Destination Rate Indicator N * DESTINATION_NETWORK_DISTRIBUTION_CENTER - Translate to Destination Rate Indicator B * DESTINATION_SECTIONAL_CENTER_FACILITY - Translate to Destination Rate Indicator S * DESTINATION_DELIVERY_UNIT - Translate to Destination Rate Indicator D * DESTINATION_SERVICE_HUB - Translate to Destination Rate Indicator H * DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER - Translate to Destination Rate Indicator B

Note: - The Destination Entry Facility Type is only used in calculating Shipping Standards. - Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible. - Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.

const (
	DomesticOptionsRequestDestinationEntryFacilityTypeDESTINATIONDELIVERYUNIT                         DomesticOptionsRequestDestinationEntryFacilityType = "DESTINATION_DELIVERY_UNIT"
	DomesticOptionsRequestDestinationEntryFacilityTypeDESTINATIONNETWORKDISTRIBUTIONCENTER            DomesticOptionsRequestDestinationEntryFacilityType = "DESTINATION_NETWORK_DISTRIBUTION_CENTER"
	DomesticOptionsRequestDestinationEntryFacilityTypeDESTINATIONREGIONALPROCESSINGDISTRIBUTIONCENTER DomesticOptionsRequestDestinationEntryFacilityType = "DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER"
	DomesticOptionsRequestDestinationEntryFacilityTypeDESTINATIONSECTIONALCENTERFACILITY              DomesticOptionsRequestDestinationEntryFacilityType = "DESTINATION_SECTIONAL_CENTER_FACILITY"
	DomesticOptionsRequestDestinationEntryFacilityTypeDESTINATIONSERVICEHUB                           DomesticOptionsRequestDestinationEntryFacilityType = "DESTINATION_SERVICE_HUB"
	DomesticOptionsRequestDestinationEntryFacilityTypeNONE                                            DomesticOptionsRequestDestinationEntryFacilityType = "NONE"
)

Defines values for DomesticOptionsRequestDestinationEntryFacilityType.

type DomesticOptionsRequestShippingFilter

type DomesticOptionsRequestShippingFilter string

DomesticOptionsRequestShippingFilter A filter for domestic results to return only one response based on lowest price or fastest service standard

const (
	DomesticOptionsRequestShippingFilterPRICE            DomesticOptionsRequestShippingFilter = "PRICE"
	DomesticOptionsRequestShippingFilterSERVICESTANDARDS DomesticOptionsRequestShippingFilter = "SERVICE_STANDARDS"
)

Defines values for DomesticOptionsRequestShippingFilter.

type DomesticOptionsResponse

type DomesticOptionsResponse struct {
	// DestinationZIPCode This is the destination ZIP Code™ for the package.
	DestinationZIPCode *string `json:"destinationZIPCode,omitempty"`

	// OriginZIPCode This is the originating ZIP Code™ for the package.
	OriginZIPCode *string `json:"originZIPCode,omitempty"`

	// PricingOptions List of domestic pricing options
	PricingOptions *[]DomesticPricingOption `json:"pricingOptions,omitempty"`
}

DomesticOptionsResponse TBD

type DomesticPackageDescription

type DomesticPackageDescription struct {
	// ExtraServices Extra Services requested on the package. The available options are:
	// * 365 - Global Direct Entry
	// * 415 - USPS Label Delivery
	// * 452 - USPS Returns
	// * 480 - Tracking Plus 6 Months
	// * 481 - Tracking Plus 1 Year
	// * 482 - Tracking Plus 3 Years
	// * 483 - Tracking Plus 5 Years
	// * 484 - Tracking Plus 7 Years
	// * 485 - Tracking Plus 10 Years
	// * 486 - Tracking Plus Signature 3 Years
	// * 487 - Tracking Plus Signature 5 Years
	// * 488 - Tracking Plus Signature 7 Years
	// * 489 - Tracking Plus Signature 10 Years
	// * 498 - PO Box Locker – Stocking Fee (NSA Only)
	// * 500 - PO Box Locker – Self-Service Pickup Fee (NSA Only)
	// * 501 - PO Box Locker – Clerk-Assisted Pickup Fee (NSA Only)
	// * 502 - PO Box Locker – Local Delivery Fee (NSA Only)
	// * 810 - HAZMAT Air Eligible Ethanol Package
	// * 811 - HAZMAT Class 1 - Toy Propellant/Safety Fuse Package
	// * 812 - HAZMAT Class 3 – Flammable Liquid Package
	// * 813 - HAZMAT Class 7 - Radioactive Materials Package
	// * 814 - HAZMAT Class 8 - Corrosive Materials Package
	// * 815 - HAZMAT Class 8 - Nonspillable Wet Battery Package
	// * 816 - HAZMAT Class 9 - Lithium Battery Marked - Ground Only Package
	// * 817 - HAZMAT Class 9 - Lithium Battery - Returns Package
	// * 818 - HAZMAT Class 9 - Lithium batteries, marked package
	// * 819 - HAZMAT Class 9 - Dry Ice Package
	// * 820 - HAZMAT Class 9 - Lithium batteries, unmarked package
	// * 821 - HAZMAT Class 9 - Magnetized Materials Package
	// * 822 - HAZMAT Division 4.1 – Flammable Solids or Safety Matches Package
	// * 823 - HAZMAT Division 5.1 - Oxidizers Package
	// * 824 - HAZMAT Division 5.2 - Organic Peroxides Package
	// * 825 - HAZMAT Division 6.1 – Toxic Materials Package
	// * 826 - HAZMAT Division 6.2 – Infectious Substances Package
	// * 827 - HAZMAT Excepted Quantity Provision Package
	// * 828 - HAZMAT Ground Only
	// * 829 - HAZMAT ID8000 Consumer Commodity Package
	// * 830 - HAZMAT Lighters Package
	// * 831 - HAZMAT LTD QTY Ground Package
	// * 832 - HAZMAT Small Quantity Provision Package
	// * 853 - Perishable Material
	// * 856 - Live Animals Transportation Fee
	// * 857 - Hazardous Material
	// * 858 - Cremated Remains
	// * 910 - Certified Mail
	// * 911 - Certified Mail Restricted Delivery
	// * 912 - Certified Mail Adult Signature Required
	// * 913 - Certified Mail Adult Signature Restricted Delivery
	// * 915 - Collect on Delivery (COD)
	// * 917 - COD Restricted Delivery
	// * 920 - USPS Tracking
	// * 921 - Signature Confirmation
	// * 922 - Adult Signature Required 21 or Over
	// * 923 - Adult Signature Restricted Delivery 21 or Over
	// * 924 - Signature Confirmation Restricted Delivery
	// * 925 - Priority Mail Express Merchandise Insurance
	// * 930 - Insurance <= $500
	// * 931 - Insurance > $500
	// * 934 - Insurance Restricted Delivery
	// * 940 - Registered Mail
	// * 941 - Registered Mail Restricted Delivery
	// * 955 - Return Receipt
	// * 957 - Return Receipt Electronic
	// * 972 - Live Animal and Perishable Handling Fee
	// * 981 - Signature Requested (PRIORITY_MAIL_EXPRESS only)
	// * 984 - Parcel Locker Delivery
	// * 986 - PO to Addressee (PRIORITY_MAIL_EXPRESS only)
	// * 991 - Sunday Delivery
	ExtraServices *[]ExtraService `json:"extraServices,omitempty"`

	// Girth The girth of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Girth *float32 `json:"girth,omitempty"`

	// HasNonstandardCharacteristics Package is nonstandard. Nonstandard packages include cylindrical tubes and rolls, certain high-density items, cartons containing more than 24 ounces of liquids in one or more glass containers, cartons containing 1 gallon or more of liquid in metal or plastic containers, and items in [201.7.6.2](https://pe.usps.com/text/dmm300/201.htm#7.6.2).
	HasNonstandardCharacteristics *bool `json:"hasNonstandardCharacteristics,omitempty"`

	// Height The height of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Height float32 `json:"height"`

	// Length The length of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Length float32 `json:"length"`

	// MailClass Mail classes for the label.
	//
	// Note:
	// - `PARCEL_SELECT_LIGHTWEIGHT` is deprecated and will convert to `PARCEL_SELECT`.
	// - `FIRST-CLASS_PACKAGE_SERVICE` is deprecated and will convert to `USPS_GROUND_ADVANTAGE`.
	// - `ALL` is deprecated and will convert to `ALL_OUTBOUND`.
	// - Certain mail classes, such as `MEDIA_MAIL`, `BOUND_PRINTED_MATTER`, and `LIBRARY_MAIL`, have eligibility rules on what can be mailed using that service.  For more details on these mail classes, please visit [What are Package Services?](https://faq.usps.com/s/article/What-are-Package-Services).
	// - The Heavy Printed Matter product is supported with `MARKETING_MAIL_PARCELS`. To create Heavy Printed Matter labels, the `rateIndicator` should be set to `PR` or `NP` for Presorted or Nonpresorted USPS Marketing Mail Parcels Heavy Printed Matter or to `PN` or `NN` for Nonprofit Presorted or Nonpresorted USPS Marketing Mail Parcels Heavy Printed Matter respectively.
	MailClass DomesticPackageDescriptionMailClass `json:"mailClass"`

	// MailingDate The local date on which the package will be mailed. If the time is not provided, it will be defaulted to 6:00 p.m. local time.  The local time is based on the `originZIPCode` provided in the request.
	MailingDate *string `json:"mailingDate,omitempty"`

	// PackageValue The merchandise value of the package, in US dollars. Required to receive prices for Insurance and Collect On Delivery extra services.  The price of Insurance, Collect On Delivery, and Registered Mail extra services will vary based on the `packageValue` requested.
	PackageValue *float32 `json:"packageValue,omitempty"`

	// Weight The package weight, in weightUOM (Unit Of Measure). Items must weigh 70 pounds (1120 ounces) or less.
	Weight float32 `json:"weight"`

	// Width The width of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Width                float32                `json:"width"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

DomesticPackageDescription defines model for DomesticPackageDescription.

func (DomesticPackageDescription) Get

func (a DomesticPackageDescription) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for DomesticPackageDescription. Returns the specified element and whether it was found

func (DomesticPackageDescription) MarshalJSON

func (a DomesticPackageDescription) MarshalJSON() ([]byte, error)

Override default JSON handling for DomesticPackageDescription to handle AdditionalProperties

func (*DomesticPackageDescription) Set

func (a *DomesticPackageDescription) Set(fieldName string, value interface{})

Setter for additional properties for DomesticPackageDescription

func (*DomesticPackageDescription) UnmarshalJSON

func (a *DomesticPackageDescription) UnmarshalJSON(b []byte) error

Override default JSON handling for DomesticPackageDescription to handle AdditionalProperties

type DomesticPackageDescriptionMailClass

type DomesticPackageDescriptionMailClass string

DomesticPackageDescriptionMailClass Mail classes for the label.

Note: - `PARCEL_SELECT_LIGHTWEIGHT` is deprecated and will convert to `PARCEL_SELECT`. - `FIRST-CLASS_PACKAGE_SERVICE` is deprecated and will convert to `USPS_GROUND_ADVANTAGE`. - `ALL` is deprecated and will convert to `ALL_OUTBOUND`. - Certain mail classes, such as `MEDIA_MAIL`, `BOUND_PRINTED_MATTER`, and `LIBRARY_MAIL`, have eligibility rules on what can be mailed using that service. For more details on these mail classes, please visit [What are Package Services?](https://faq.usps.com/s/article/What-are-Package-Services). - The Heavy Printed Matter product is supported with `MARKETING_MAIL_PARCELS`. To create Heavy Printed Matter labels, the `rateIndicator` should be set to `PR` or `NP` for Presorted or Nonpresorted USPS Marketing Mail Parcels Heavy Printed Matter or to `PN` or `NN` for Nonprofit Presorted or Nonpresorted USPS Marketing Mail Parcels Heavy Printed Matter respectively.

const (
	DomesticPackageDescriptionMailClassALL                              DomesticPackageDescriptionMailClass = "ALL"
	DomesticPackageDescriptionMailClassALLOUTBOUND                      DomesticPackageDescriptionMailClass = "ALL_OUTBOUND"
	DomesticPackageDescriptionMailClassALLRETURNS                       DomesticPackageDescriptionMailClass = "ALL_RETURNS"
	DomesticPackageDescriptionMailClassBOUNDPRINTEDMATTER               DomesticPackageDescriptionMailClass = "BOUND_PRINTED_MATTER"
	DomesticPackageDescriptionMailClassFIRSTCLASSPACKAGESERVICE         DomesticPackageDescriptionMailClass = "FIRST-CLASS_PACKAGE_SERVICE"
	DomesticPackageDescriptionMailClassLIBRARYMAIL                      DomesticPackageDescriptionMailClass = "LIBRARY_MAIL"
	DomesticPackageDescriptionMailClassMARKETINGMAILPARCELS             DomesticPackageDescriptionMailClass = "MARKETING_MAIL_PARCELS"
	DomesticPackageDescriptionMailClassMEDIAMAIL                        DomesticPackageDescriptionMailClass = "MEDIA_MAIL"
	DomesticPackageDescriptionMailClassPARCELSELECT                     DomesticPackageDescriptionMailClass = "PARCEL_SELECT"
	DomesticPackageDescriptionMailClassPARCELSELECTLIGHTWEIGHT          DomesticPackageDescriptionMailClass = "PARCEL_SELECT_LIGHTWEIGHT"
	DomesticPackageDescriptionMailClassPRIORITYMAIL                     DomesticPackageDescriptionMailClass = "PRIORITY_MAIL"
	DomesticPackageDescriptionMailClassPRIORITYMAILEXPRESS              DomesticPackageDescriptionMailClass = "PRIORITY_MAIL_EXPRESS"
	DomesticPackageDescriptionMailClassPRIORITYMAILEXPRESSRETURNSERVICE DomesticPackageDescriptionMailClass = "PRIORITY_MAIL_EXPRESS_RETURN_SERVICE"
	DomesticPackageDescriptionMailClassPRIORITYMAILRETURNSERVICE        DomesticPackageDescriptionMailClass = "PRIORITY_MAIL_RETURN_SERVICE"
	DomesticPackageDescriptionMailClassUSPSCONNECTLOCAL                 DomesticPackageDescriptionMailClass = "USPS_CONNECT_LOCAL"
	DomesticPackageDescriptionMailClassUSPSCONNECTMAIL                  DomesticPackageDescriptionMailClass = "USPS_CONNECT_MAIL"
	DomesticPackageDescriptionMailClassUSPSCONNECTREGIONAL              DomesticPackageDescriptionMailClass = "USPS_CONNECT_REGIONAL"
	DomesticPackageDescriptionMailClassUSPSGROUNDADVANTAGE              DomesticPackageDescriptionMailClass = "USPS_GROUND_ADVANTAGE"
	DomesticPackageDescriptionMailClassUSPSGROUNDADVANTAGERETURNSERVICE DomesticPackageDescriptionMailClass = "USPS_GROUND_ADVANTAGE_RETURN_SERVICE"
)

Defines values for DomesticPackageDescriptionMailClass.

type DomesticPricingOption

type DomesticPricingOption struct {
	// PaymentAccount The total amount to be charged for the shipment
	PaymentAccount *DomesticPricingOption_PaymentAccount `json:"paymentAccount,omitempty"`

	// PriceType Price type of the Shipping Request.
	//
	// Note:
	// - If `priceType` is `CONTRACT`, `paymentAccount` is required.
	PriceType *PriceTypeRequest `json:"priceType,omitempty"`

	// ShippingOptions List of available shipping options and delivery options for the package
	ShippingOptions *[]DomesticOptions `json:"shippingOptions,omitempty"`
}

DomesticPricingOption The option for domestic pricing

type DomesticPricingOptionPaymentAccountAccountType

type DomesticPricingOptionPaymentAccountAccountType string

DomesticPricingOptionPaymentAccountAccountType The type of payment account.

Note: - `EPS`, `PERMIT`, and `METER` are only available for Outbound Mail Classes. - `METER` is only available to PC Postage Providers. - `MID` is only available for Return Mail Classes.

const (
	DomesticPricingOptionPaymentAccountAccountTypeEPS    DomesticPricingOptionPaymentAccountAccountType = "EPS"
	DomesticPricingOptionPaymentAccountAccountTypeMETER  DomesticPricingOptionPaymentAccountAccountType = "METER"
	DomesticPricingOptionPaymentAccountAccountTypeMID    DomesticPricingOptionPaymentAccountAccountType = "MID"
	DomesticPricingOptionPaymentAccountAccountTypePERMIT DomesticPricingOptionPaymentAccountAccountType = "PERMIT"
)

Defines values for DomesticPricingOptionPaymentAccountAccountType.

type DomesticPricingOption_PaymentAccount

type DomesticPricingOption_PaymentAccount struct {
	// CRID Customer Registration ID (CRID) associated with the business or mailer. Used to retrieve any contract-specific service standards.
	CRID *string `json:"CRID,omitempty"`

	// AccountNumber The Enterprise Payment Account, Permit number, Mailer ID (MID), or PC Postage meter number associated with a contract.
	AccountNumber *string `json:"accountNumber,omitempty"`

	// AccountType The type of payment account.
	//
	// Note:
	// - `EPS`, `PERMIT`, and `METER` are only available for Outbound Mail Classes.
	// - `METER` is only available to PC Postage Providers.
	// - `MID` is only available for Return Mail Classes.
	AccountType          *DomesticPricingOptionPaymentAccountAccountType `json:"accountType,omitempty"`
	AdditionalProperties map[string]interface{}                          `json:"-"`
}

DomesticPricingOption_PaymentAccount defines model for DomesticPricingOption.PaymentAccount.

func (DomesticPricingOption_PaymentAccount) Get

func (a DomesticPricingOption_PaymentAccount) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for DomesticPricingOption_PaymentAccount. Returns the specified element and whether it was found

func (DomesticPricingOption_PaymentAccount) MarshalJSON

func (a DomesticPricingOption_PaymentAccount) MarshalJSON() ([]byte, error)

Override default JSON handling for DomesticPricingOption_PaymentAccount to handle AdditionalProperties

func (*DomesticPricingOption_PaymentAccount) Set

func (a *DomesticPricingOption_PaymentAccount) Set(fieldName string, value interface{})

Setter for additional properties for DomesticPricingOption_PaymentAccount

func (*DomesticPricingOption_PaymentAccount) UnmarshalJSON

func (a *DomesticPricingOption_PaymentAccount) UnmarshalJSON(b []byte) error

Override default JSON handling for DomesticPricingOption_PaymentAccount to handle AdditionalProperties

type DomesticRateOptions

type DomesticRateOptions struct {
	// Commitment The commitment and the scheduled delivery date of the package.
	Commitment *Commitment `json:"commitment,omitempty"`

	// ExtraServices Extra services requested on the package.
	ExtraServices *[]struct {
		// SKU SKU of the extra service.
		SKU *string `json:"SKU,omitempty"`

		// ExtraService The code for the extra service.
		ExtraService *string `json:"extraService,omitempty"`

		// Name Name of the extra service.
		Name *string `json:"name,omitempty"`

		// Price The price for the extra service.
		Price *float64 `json:"price,omitempty"`

		// PriceType The type of price applied.
		//  * Valid Options for Domestic Prices include: 'RETAIL', 'COMMERCIAL', & 'CONTRACT'
		//  * Valid Options for International Prices include: 'RETAIL', 'COMMERCIAL', 'COMMERCIAL_BASE', 'COMMERCIAL_PLUS', & 'CONTRACT'
		PriceType *PriceType `json:"priceType,omitempty"`

		// Warnings List of warnings
		Warnings *[]struct {
			// WarningCode Warning code in response to the request.
			WarningCode *string `json:"warningCode,omitempty"`

			// WarningDescription A human-readable message describing the warning.
			WarningDescription *string `json:"warningDescription,omitempty"`
		} `json:"warnings,omitempty"`
	} `json:"extraServices,omitempty"`

	// Rates List of available rates for the package including base postage and extra service fees
	Rates *[]struct {
		// SKU Pricing SKU.
		SKU *string `json:"SKU,omitempty"`

		// Description The description of the price.
		Description *string `json:"description,omitempty"`

		// DestinationEntryFacilityType Destination Entry Facility type for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		//
		// * `NONE` - None, translates to PTR code `N`
		// * `AREA_DISTRIBUTION_CENTER` - Area Distribution Center, translates to PTR code `A`
		// * `AUXILIARY_SERVICE_FACILITY` - Auxiliary Service Facility, translates to PTR code `F`
		// * `DESTINATION_DELIVERY_UNIT` - Destination Delivery Unit, translates to PTR code `D`
		// * `DESTINATION_NETWORK_DISTRIBUTION_CENTER` - Destination Network Distribution Center, translates to PTR code `B`
		// * `DESTINATION_SECTIONAL_CENTER_FACILITY` - Destination Sectional Center Facility, translates to PTR code `S`
		// * `DESTINATION_SERVICE_HUB` - Destination Service Hub, translates to PTR code `H`
		// * `INTERNATIONAL_SERVICE_CENTER` - International Service Center, translates to PTR code `I`
		// * `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` - Destination Regional Processing Distribution Center, translates to PTR code `B`
		//
		// Note:
		// * Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible.
		// * Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.
		DestinationEntryFacilityType *DomesticRateOptionsRatesDestinationEntryFacilityType `json:"destinationEntryFacilityType,omitempty"`

		// DimWeight The dimensional weight of the package, if greater than specified in weight, in ounces.
		DimWeight *float32 `json:"dimWeight,omitempty"`

		// DimensionalWeight The dimensional weight of package, if greater than specified in weight, in ounces. This will be removed in July 2025.
		// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
		DimensionalWeight *float32 `json:"dimensionalWeight,omitempty"`

		// EndDate Effective end date of the rate. If blank, the rate does not have an end date as of yet.
		EndDate *string `json:"endDate,omitempty"`

		// Fees Fees associated to the package.
		Fees *[]struct {
			// SKU Pricing SKU.
			SKU *string `json:"SKU,omitempty"`

			// Name Name of the fee.
			Name *string `json:"name,omitempty"`

			// Price The price for the fee.
			Price *float64 `json:"price,omitempty"`
		} `json:"fees,omitempty"`

		// MailClass List or enumeration of the domestic or international mail classes available
		MailClass *AllMailClasses `json:"mailClass,omitempty"`

		// Price Amount of Postage Required, does not include insurance or other extra service fees.
		Price *float64 `json:"price,omitempty"`

		// PriceType The type of price applied.
		//  * Valid Options for Domestic Prices include: 'RETAIL', 'COMMERCIAL', & 'CONTRACT'
		//  * Valid Options for International Prices include: 'RETAIL', 'COMMERCIAL', 'COMMERCIAL_BASE', 'COMMERCIAL_PLUS', & 'CONTRACT'
		PriceType *PriceType `json:"priceType,omitempty"`

		// ProcessingCategory Processing category for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		//
		// * `CARDS` - Cards, translates to PTR code `0`
		// * `LETTERS` - Letters, translates to PTR code `1`
		// * `FLATS` - Flats, translates to PTR code `2`
		// * `MACHINABLE` - Machinable Parcel, translates to PTR code `3`
		// * `IRREGULAR` - Irregular Parcel, translates to PTR code `4` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025.
		// * `NON_MACHINABLE` - Non-machinable parcel, translates to PTR code `5` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025.
		// * `NONSTANDARD` - Nonstandard parcel, translates to PTR code `5`
		// * `CATALOGS` - Catalogs, translates to PTR code `C`
		// * `OPEN_AND_DISTRIBUTE` - Open and Distribute, translates to PTR code `O`
		// * `RETURNS` - Returns, translates to PTR code `R`
		// * `SOFT_PACK_MACHINABLE` - Soft Pack Machinable, translates to PTR code `S`
		// * `SOFT_PACK_NON_MACHINABLE` - Soft Package Non-machinable, translates to PTR code `T`
		ProcessingCategory *DomesticRateOptionsRatesProcessingCategory `json:"processingCategory,omitempty"`

		// ProductDefinition A business friendly description associated to the product that can be displayed to a customer on a shipping portal.
		ProductDefinition *string `json:"productDefinition,omitempty"`

		// ProductName A business friendly name associated to the product that can be displayed to a customer on a shipping portal.
		ProductName *string `json:"productName,omitempty"`

		// RateIndicator Two-digit rate indicator code for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		RateIndicator *string `json:"rateIndicator,omitempty"`

		// StartDate Effective start date of the rate.
		StartDate *openapi_types.Date `json:"startDate,omitempty"`

		// Weight The package weight, in weightUOM. Items must weigh 70 pounds (1120 ounces) or less.
		Weight *float32 `json:"weight,omitempty"`

		// Zone For domestic requests: indicates the calculated zone between the provided `originZIPCode` and `destinationZIPCode` for a given `mailClass`, `mailingDate`, and `weight`.
		//
		// For international requests: indicates the price group for a given `destinationCountryCode`, `mailClass`, `mailingDate`, and `rateIndicator`.
		Zone *string `json:"zone,omitempty"`
	} `json:"rates,omitempty"`

	// TotalBasePrice The price of the rate, fees, and pound postage.
	TotalBasePrice *float64 `json:"totalBasePrice,omitempty"`

	// TotalPrice The total price, including the `totalBasePrice` and all extra service prices.
	//
	// Note: This field is only returned when `extraServices` are passed in the request.
	TotalPrice           *float64               `json:"totalPrice,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

DomesticRateOptions defines model for DomesticRateOptions.

func (DomesticRateOptions) Get

func (a DomesticRateOptions) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for DomesticRateOptions. Returns the specified element and whether it was found

func (DomesticRateOptions) MarshalJSON

func (a DomesticRateOptions) MarshalJSON() ([]byte, error)

Override default JSON handling for DomesticRateOptions to handle AdditionalProperties

func (*DomesticRateOptions) Set

func (a *DomesticRateOptions) Set(fieldName string, value interface{})

Setter for additional properties for DomesticRateOptions

func (*DomesticRateOptions) UnmarshalJSON

func (a *DomesticRateOptions) UnmarshalJSON(b []byte) error

Override default JSON handling for DomesticRateOptions to handle AdditionalProperties

type DomesticRateOptionsRatesDestinationEntryFacilityType

type DomesticRateOptionsRatesDestinationEntryFacilityType string

DomesticRateOptionsRatesDestinationEntryFacilityType Destination Entry Facility type for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.

* `NONE` - None, translates to PTR code `N` * `AREA_DISTRIBUTION_CENTER` - Area Distribution Center, translates to PTR code `A` * `AUXILIARY_SERVICE_FACILITY` - Auxiliary Service Facility, translates to PTR code `F` * `DESTINATION_DELIVERY_UNIT` - Destination Delivery Unit, translates to PTR code `D` * `DESTINATION_NETWORK_DISTRIBUTION_CENTER` - Destination Network Distribution Center, translates to PTR code `B` * `DESTINATION_SECTIONAL_CENTER_FACILITY` - Destination Sectional Center Facility, translates to PTR code `S` * `DESTINATION_SERVICE_HUB` - Destination Service Hub, translates to PTR code `H` * `INTERNATIONAL_SERVICE_CENTER` - International Service Center, translates to PTR code `I` * `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` - Destination Regional Processing Distribution Center, translates to PTR code `B`

Note: * Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible. * Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.

const (
	DomesticRateOptionsRatesDestinationEntryFacilityTypeAREADISTRIBUTIONCENTER                          DomesticRateOptionsRatesDestinationEntryFacilityType = "AREA_DISTRIBUTION_CENTER"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeAUXILIARYSERVICEFACILITY                        DomesticRateOptionsRatesDestinationEntryFacilityType = "AUXILIARY_SERVICE_FACILITY"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONDELIVERYUNIT                         DomesticRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_DELIVERY_UNIT"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONNETWORKDISTRIBUTIONCENTER            DomesticRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_NETWORK_DISTRIBUTION_CENTER"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONREGIONALPROCESSINGDISTRIBUTIONCENTER DomesticRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONSECTIONALCENTERFACILITY              DomesticRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_SECTIONAL_CENTER_FACILITY"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONSERVICEHUB                           DomesticRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_SERVICE_HUB"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeINTERNATIONALSERVICECENTER                      DomesticRateOptionsRatesDestinationEntryFacilityType = "INTERNATIONAL_SERVICE_CENTER"
	DomesticRateOptionsRatesDestinationEntryFacilityTypeNONE                                            DomesticRateOptionsRatesDestinationEntryFacilityType = "NONE"
)

Defines values for DomesticRateOptionsRatesDestinationEntryFacilityType.

type DomesticRateOptionsRatesProcessingCategory

type DomesticRateOptionsRatesProcessingCategory string

DomesticRateOptionsRatesProcessingCategory Processing category for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.

* `CARDS` - Cards, translates to PTR code `0` * `LETTERS` - Letters, translates to PTR code `1` * `FLATS` - Flats, translates to PTR code `2` * `MACHINABLE` - Machinable Parcel, translates to PTR code `3` * `IRREGULAR` - Irregular Parcel, translates to PTR code `4` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025. * `NON_MACHINABLE` - Non-machinable parcel, translates to PTR code `5` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025. * `NONSTANDARD` - Nonstandard parcel, translates to PTR code `5` * `CATALOGS` - Catalogs, translates to PTR code `C` * `OPEN_AND_DISTRIBUTE` - Open and Distribute, translates to PTR code `O` * `RETURNS` - Returns, translates to PTR code `R` * `SOFT_PACK_MACHINABLE` - Soft Pack Machinable, translates to PTR code `S` * `SOFT_PACK_NON_MACHINABLE` - Soft Package Non-machinable, translates to PTR code `T`

const (
	DomesticRateOptionsRatesProcessingCategoryCARDS                 DomesticRateOptionsRatesProcessingCategory = "CARDS"
	DomesticRateOptionsRatesProcessingCategoryCATALOGS              DomesticRateOptionsRatesProcessingCategory = "CATALOGS"
	DomesticRateOptionsRatesProcessingCategoryFLATS                 DomesticRateOptionsRatesProcessingCategory = "FLATS"
	DomesticRateOptionsRatesProcessingCategoryIRREGULAR             DomesticRateOptionsRatesProcessingCategory = "IRREGULAR"
	DomesticRateOptionsRatesProcessingCategoryLETTERS               DomesticRateOptionsRatesProcessingCategory = "LETTERS"
	DomesticRateOptionsRatesProcessingCategoryMACHINABLE            DomesticRateOptionsRatesProcessingCategory = "MACHINABLE"
	DomesticRateOptionsRatesProcessingCategoryNONMACHINABLE         DomesticRateOptionsRatesProcessingCategory = "NON_MACHINABLE"
	DomesticRateOptionsRatesProcessingCategoryNONSTANDARD           DomesticRateOptionsRatesProcessingCategory = "NONSTANDARD"
	DomesticRateOptionsRatesProcessingCategoryOPENANDDISTRIBUTE     DomesticRateOptionsRatesProcessingCategory = "OPEN_AND_DISTRIBUTE"
	DomesticRateOptionsRatesProcessingCategoryRETURNS               DomesticRateOptionsRatesProcessingCategory = "RETURNS"
	DomesticRateOptionsRatesProcessingCategorySOFTPACKMACHINABLE    DomesticRateOptionsRatesProcessingCategory = "SOFT_PACK_MACHINABLE"
	DomesticRateOptionsRatesProcessingCategorySOFTPACKNONMACHINABLE DomesticRateOptionsRatesProcessingCategory = "SOFT_PACK_NON_MACHINABLE"
)

Defines values for DomesticRateOptionsRatesProcessingCategory.

type DutiesTaxesFeesQuote

type DutiesTaxesFeesQuote struct {
	// ItemQuotes The total landed cost prices for taxes and duties on each item.
	ItemQuotes *[]struct {
		// DutyPrice The value of the duties associated with the item.
		DutyPrice *float32 `json:"dutyPrice,omitempty"`

		// ItemId The corresponding `itemId` provided in the request.
		ItemId *string `json:"itemId,omitempty"`

		// TaxPrice The value of the taxes associated with the item.
		TaxPrice *float32 `json:"taxPrice,omitempty"`
	} `json:"itemQuotes,omitempty"`

	// PackageFee The value of the total landed cost fee associated with the package.
	PackageFee *float32 `json:"packageFee,omitempty"`
}

DutiesTaxesFeesQuote The duties, taxes, and fees details. Included if `requestDutiesTaxesFees` is `true` and the shipping destination has applicable duties, taxes, and fees.

type ErrorMessage

type ErrorMessage struct {
	// ApiVersion The version of the API that was used and that raised the error.
	ApiVersion *string `json:"apiVersion,omitempty"`

	// Error The high-level error that has occurred as indicated by the status code.
	Error                *ErrorMessage_Error    `json:"error,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage Standard error message response.

func (ErrorMessage) Get

func (a ErrorMessage) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage. Returns the specified element and whether it was found

func (ErrorMessage) MarshalJSON

func (a ErrorMessage) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage to handle AdditionalProperties

func (*ErrorMessage) Set

func (a *ErrorMessage) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage

func (*ErrorMessage) UnmarshalJSON

func (a *ErrorMessage) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage to handle AdditionalProperties

type ErrorMessage_Error

type ErrorMessage_Error struct {
	// Code The error status code that has been returned in response to the request.
	Code *string `json:"code,omitempty"`

	// Errors List of errors
	Errors *[]ErrorMessage_Error_Errors_Item `json:"errors,omitempty"`

	// Message A human-readable message describing the error.
	Message              *string                `json:"message,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error The high-level error that has occurred as indicated by the status code.

func (ErrorMessage_Error) Get

func (a ErrorMessage_Error) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error. Returns the specified element and whether it was found

func (ErrorMessage_Error) MarshalJSON

func (a ErrorMessage_Error) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error to handle AdditionalProperties

func (*ErrorMessage_Error) Set

func (a *ErrorMessage_Error) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error

func (*ErrorMessage_Error) UnmarshalJSON

func (a *ErrorMessage_Error) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error to handle AdditionalProperties

type ErrorMessage_Error_Errors_Item

type ErrorMessage_Error_Errors_Item struct {
	// Code An internal subordinate code used for error diagnosis.
	Code *string `json:"code,omitempty"`

	// Detail A human-readable description of the error that occurred.
	Detail *string `json:"detail,omitempty"`

	// Source The element that is suspected of originating the error.  Helps to pinpoint the problem.
	Source *ErrorMessage_Error_Errors_Source `json:"source,omitempty"`

	// Status The status code response returned to the client.
	Status *string `json:"status,omitempty"`

	// Title A human-readable title that identifies the error.
	Title                *string                `json:"title,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error_Errors_Item defines model for ErrorMessage.Error.Errors.Item.

func (ErrorMessage_Error_Errors_Item) Get

func (a ErrorMessage_Error_Errors_Item) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error_Errors_Item. Returns the specified element and whether it was found

func (ErrorMessage_Error_Errors_Item) MarshalJSON

func (a ErrorMessage_Error_Errors_Item) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error_Errors_Item to handle AdditionalProperties

func (*ErrorMessage_Error_Errors_Item) Set

func (a *ErrorMessage_Error_Errors_Item) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error_Errors_Item

func (*ErrorMessage_Error_Errors_Item) UnmarshalJSON

func (a *ErrorMessage_Error_Errors_Item) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error_Errors_Item to handle AdditionalProperties

type ErrorMessage_Error_Errors_Source

type ErrorMessage_Error_Errors_Source struct {
	// Example An example of a valid value for the input parameter.
	Example *string `json:"example,omitempty"`

	// Parameter The input in the request which caused an error.
	Parameter            *string                `json:"parameter,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error_Errors_Source The element that is suspected of originating the error. Helps to pinpoint the problem.

func (ErrorMessage_Error_Errors_Source) Get

func (a ErrorMessage_Error_Errors_Source) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error_Errors_Source. Returns the specified element and whether it was found

func (ErrorMessage_Error_Errors_Source) MarshalJSON

func (a ErrorMessage_Error_Errors_Source) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error_Errors_Source to handle AdditionalProperties

func (*ErrorMessage_Error_Errors_Source) Set

func (a *ErrorMessage_Error_Errors_Source) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error_Errors_Source

func (*ErrorMessage_Error_Errors_Source) UnmarshalJSON

func (a *ErrorMessage_Error_Errors_Source) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error_Errors_Source to handle AdditionalProperties

type ExtraService

type ExtraService int

ExtraService Available extra service codes.

const (
	ExtraServiceN365 ExtraService = 365
	ExtraServiceN415 ExtraService = 415
	ExtraServiceN452 ExtraService = 452
	ExtraServiceN480 ExtraService = 480
	ExtraServiceN481 ExtraService = 481
	ExtraServiceN482 ExtraService = 482
	ExtraServiceN483 ExtraService = 483
	ExtraServiceN484 ExtraService = 484
	ExtraServiceN485 ExtraService = 485
	ExtraServiceN486 ExtraService = 486
	ExtraServiceN487 ExtraService = 487
	ExtraServiceN488 ExtraService = 488
	ExtraServiceN489 ExtraService = 489
	ExtraServiceN498 ExtraService = 498
	ExtraServiceN500 ExtraService = 500
	ExtraServiceN501 ExtraService = 501
	ExtraServiceN502 ExtraService = 502
	ExtraServiceN810 ExtraService = 810
	ExtraServiceN811 ExtraService = 811
	ExtraServiceN812 ExtraService = 812
	ExtraServiceN813 ExtraService = 813
	ExtraServiceN814 ExtraService = 814
	ExtraServiceN815 ExtraService = 815
	ExtraServiceN816 ExtraService = 816
	ExtraServiceN817 ExtraService = 817
	ExtraServiceN818 ExtraService = 818
	ExtraServiceN819 ExtraService = 819
	ExtraServiceN820 ExtraService = 820
	ExtraServiceN821 ExtraService = 821
	ExtraServiceN822 ExtraService = 822
	ExtraServiceN823 ExtraService = 823
	ExtraServiceN824 ExtraService = 824
	ExtraServiceN825 ExtraService = 825
	ExtraServiceN826 ExtraService = 826
	ExtraServiceN827 ExtraService = 827
	ExtraServiceN828 ExtraService = 828
	ExtraServiceN829 ExtraService = 829
	ExtraServiceN830 ExtraService = 830
	ExtraServiceN831 ExtraService = 831
	ExtraServiceN832 ExtraService = 832
	ExtraServiceN853 ExtraService = 853
	ExtraServiceN856 ExtraService = 856
	ExtraServiceN857 ExtraService = 857
	ExtraServiceN858 ExtraService = 858
	ExtraServiceN910 ExtraService = 910
	ExtraServiceN911 ExtraService = 911
	ExtraServiceN912 ExtraService = 912
	ExtraServiceN913 ExtraService = 913
	ExtraServiceN915 ExtraService = 915
	ExtraServiceN917 ExtraService = 917
	ExtraServiceN920 ExtraService = 920
	ExtraServiceN921 ExtraService = 921
	ExtraServiceN922 ExtraService = 922
	ExtraServiceN923 ExtraService = 923
	ExtraServiceN924 ExtraService = 924
	ExtraServiceN925 ExtraService = 925
	ExtraServiceN930 ExtraService = 930
	ExtraServiceN931 ExtraService = 931
	ExtraServiceN934 ExtraService = 934
	ExtraServiceN940 ExtraService = 940
	ExtraServiceN941 ExtraService = 941
	ExtraServiceN955 ExtraService = 955
	ExtraServiceN957 ExtraService = 957
	ExtraServiceN972 ExtraService = 972
	ExtraServiceN981 ExtraService = 981
	ExtraServiceN984 ExtraService = 984
	ExtraServiceN986 ExtraService = 986
	ExtraServiceN991 ExtraService = 991
)

Defines values for ExtraService.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InternationalExtraService

type InternationalExtraService int

InternationalExtraService Extra Services requested on the package. The available options are: * 370 - USPS Delivery Duties Paid Fee * 813 - HAZMAT Class 7 - Radioactive Materials Package * 820 - HAZMAT Class 9 - Lithium batteries, unmarked package * 826 - HAZMAT Division 6.2 – Infectious Substances Package * 857 - Hazardous Material * 930 - Insurance <= $500 * 931 - Insurance > $500 * 955 - Return Receipt (Unsupported as of 01/19/2025)

const (
	InternationalExtraServiceN370 InternationalExtraService = 370
	InternationalExtraServiceN813 InternationalExtraService = 813
	InternationalExtraServiceN820 InternationalExtraService = 820
	InternationalExtraServiceN826 InternationalExtraService = 826
	InternationalExtraServiceN857 InternationalExtraService = 857
	InternationalExtraServiceN930 InternationalExtraService = 930
	InternationalExtraServiceN931 InternationalExtraService = 931
	InternationalExtraServiceN955 InternationalExtraService = 955
)

Defines values for InternationalExtraService.

type InternationalMailClass

type InternationalMailClass string

InternationalMailClass The international mail service requested.

Note: - `GLOBAL_EXPRESS_GUARANTEED` - Global Express Guaranteed Service is suspended as of September 29, 2024.

const (
	InternationalMailClassFIRSTCLASSPACKAGEINTERNATIONALSERVICE InternationalMailClass = "FIRST-CLASS_PACKAGE_INTERNATIONAL_SERVICE"
	InternationalMailClassGLOBALEXPRESSGUARANTEED               InternationalMailClass = "GLOBAL_EXPRESS_GUARANTEED"
	InternationalMailClassPRIORITYMAILEXPRESSINTERNATIONAL      InternationalMailClass = "PRIORITY_MAIL_EXPRESS_INTERNATIONAL"
	InternationalMailClassPRIORITYMAILINTERNATIONAL             InternationalMailClass = "PRIORITY_MAIL_INTERNATIONAL"
)

Defines values for InternationalMailClass.

type InternationalOptions

type InternationalOptions struct {
	// MailClass The international mail service requested.
	//
	// Note:
	// - `GLOBAL_EXPRESS_GUARANTEED` - Global Express Guaranteed Service is suspended as of September 29, 2024.
	MailClass *InternationalMailClass `json:"mailClass,omitempty"`

	// RateOptions List of rate options
	RateOptions *[]InternationalRateOptions `json:"rateOptions,omitempty"`
}

InternationalOptions Options specific to international shipments

type InternationalOptionsRequest

type InternationalOptionsRequest struct {
	// DestinationCity When `requestDutiesTaxesFees` is `true` then `destinationCity` may be required based on the country of import.
	DestinationCity *string `json:"destinationCity,omitempty"`

	// DestinationCountryCode The ISO 3166-1 alpha-2 code representing the shipping destination.
	DestinationCountryCode string `json:"destinationCountryCode"`

	// DestinationState When `requestDutiesTaxesFees` is `true` then `destinationState` may be required based on the country of import.
	DestinationState *string `json:"destinationState,omitempty"`

	// ForeignPostalCode This is the Postal Code used in an international addresses.
	//
	// Note:
	// - Different shipping destinations may require a postal code for shipping.  For more details, review the [Individual Country Listing](https://pe.usps.com/text/imm/immctry.htm) for your shipping destination
	ForeignPostalCode *PostalCode `json:"foreignPostalCode,omitempty"`

	// Items A list of items utilized for pricing when `requestDutiesTaxesFees` is `true`.
	Items *[]InternationalOptionsRequestLandedCostItem `json:"items,omitempty"`

	// OriginZIPCode The originating ZIP code for the package.
	OriginZIPCode OriginZIPCode `json:"originZIPCode"`

	// PackageDescription Details of package being shipped
	PackageDescription InternationalPackageDescription `json:"packageDescription"`

	// PricingOptions List of international pricing options
	PricingOptions []InternationalPricingOption `json:"pricingOptions"`

	// RequestDutiesTaxesFees When `true` the returned `rateOption` elements will include the duties and taxes cost for each item and package fees.
	RequestDutiesTaxesFees *bool `json:"requestDutiesTaxesFees,omitempty"`

	// ShippingFilter A filter for international results to return only one response based on lowest price.  There are no service standards for international.
	ShippingFilter *InternationalOptionsRequestShippingFilter `json:"shippingFilter,omitempty"`
}

InternationalOptionsRequest International Options Request

type InternationalOptionsRequestLandedCostItem

type InternationalOptionsRequestLandedCostItem struct {
	// HSTariffNumber The HS tariff number is based on the Harmonized Commodity Description and Coding System developed by the World Customs Organization.  The value should follow the regular expression pattern: `^\.*(?:[A-Za-z\d]\.*){6,14}$`.  For more information, see: [https://hts.usitc.gov/current](https://hts.usitc.gov/current).
	HSTariffNumber *string `json:"HSTariffNumber,omitempty"`

	// CountryOfOrigin A two digit Alpha Country Code defined by ISO representing where the item is from.
	CountryOfOrigin *string `json:"countryOfOrigin,omitempty"`

	// ItemId A user-provided item identifier. The itemId is echoed in the response to correlate duties and taxes to this item.
	ItemId string `json:"itemId"`

	// ItemQuantity The quantity of the item.
	ItemQuantity float32 `json:"itemQuantity"`

	// ItemValue The value of the item.
	ItemValue float32 `json:"itemValue"`

	// ItemWeight The calculated weight for each individual item within a quantity based on user input.
	ItemWeight *float64 `json:"itemWeight,omitempty"`
}

InternationalOptionsRequestLandedCostItem When `requestDutiesTaxesFees` is true at least one item is required.

type InternationalOptionsRequestShippingFilter

type InternationalOptionsRequestShippingFilter string

InternationalOptionsRequestShippingFilter A filter for international results to return only one response based on lowest price. There are no service standards for international.

const (
	InternationalOptionsRequestShippingFilterPRICE InternationalOptionsRequestShippingFilter = "PRICE"
)

Defines values for InternationalOptionsRequestShippingFilter.

type InternationalOptionsResponse

type InternationalOptionsResponse struct {
	// DestinationCountryCode Country of destination.
	DestinationCountryCode *string `json:"destinationCountryCode,omitempty"`

	// ForeignPostalCode This is the Postal Code used in an international addresses.
	//
	// Note:
	// - Different shipping destinations may require a postal code for shipping.  For more details, review the [Individual Country Listing](https://pe.usps.com/text/imm/immctry.htm) for your shipping destination
	ForeignPostalCode *PostalCode `json:"foreignPostalCode,omitempty"`

	// OriginZIPCode This is the originating ZIP Code&#8482; for the package.
	OriginZIPCode *string `json:"originZIPCode,omitempty"`

	// PricingOptions List of international pricing options
	PricingOptions *[]InternationalPricingOption `json:"pricingOptions,omitempty"`
}

InternationalOptionsResponse TBD

type InternationalPackageDescription

type InternationalPackageDescription struct {
	// ExtraServices Extra Services requested on the package. The available options are:
	// * 370 - USPS Delivery Duties Paid Fee
	// * 813 - HAZMAT Class 7 - Radioactive Materials Package
	// * 820 - HAZMAT Class 9 - Lithium batteries, unmarked package
	// * 826 - HAZMAT Division 6.2 – Infectious Substances Package
	// * 857 - Hazardous Material
	// * 930 - Insurance <= $500
	// * 931 - Insurance > $500
	// * 955 - Return Receipt (Unsupported as of 01/19/2025)
	ExtraServices *[]InternationalExtraService `json:"extraServices,omitempty"`

	// Girth The girth of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Girth *float32 `json:"girth,omitempty"`

	// HasNonstandardCharacteristics Package is nonstandard. Nonstandard packages include cylindrical tubes and rolls, certain high-density items, cartons containing more than 24 ounces of liquids in one or more glass containers, cartons containing 1 gallon or more of liquid in metal or plastic containers, and items in [201.7.6.2](https://pe.usps.com/text/dmm300/201.htm#7.6.2).
	HasNonstandardCharacteristics *bool `json:"hasNonstandardCharacteristics,omitempty"`

	// Height The height of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Height float32 `json:"height"`

	// Length The length of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Length float32 `json:"length"`

	// MailClass International Mail classes for the label.
	//
	// `GLOBAL_EXPRESS_GUARANTEED` is supported by shipping options, but is not supported by labels. Global Express Guaranteed Service is suspended as of September 29, 2024.
	MailClass InternationalPackageDescriptionMailClass `json:"mailClass"`

	// MailingDate Supports either a date or date-time entry, if using a date the time will be defaulted to 6:00 pm local time for the purpose of Service Delivery Standard estimates. A mailing date of 0-30 days in advance can be requested.
	MailingDate *string `json:"mailingDate,omitempty"`

	// PackageValue The merchandise value of the package, in US dollars. Required to receive prices for Insurance.  The price of the Insurance extra service will vary based on the `packageValue` requested.
	PackageValue *float32 `json:"packageValue,omitempty"`

	// Weight The package weight, in weightUOM (Unit Of Measure). Items must weigh 70 pounds (1120 ounces) or less.
	Weight float32 `json:"weight"`

	// Width The width of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Width                float32                `json:"width"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

InternationalPackageDescription defines model for InternationalPackageDescription.

func (InternationalPackageDescription) Get

func (a InternationalPackageDescription) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for InternationalPackageDescription. Returns the specified element and whether it was found

func (InternationalPackageDescription) MarshalJSON

func (a InternationalPackageDescription) MarshalJSON() ([]byte, error)

Override default JSON handling for InternationalPackageDescription to handle AdditionalProperties

func (*InternationalPackageDescription) Set

func (a *InternationalPackageDescription) Set(fieldName string, value interface{})

Setter for additional properties for InternationalPackageDescription

func (*InternationalPackageDescription) UnmarshalJSON

func (a *InternationalPackageDescription) UnmarshalJSON(b []byte) error

Override default JSON handling for InternationalPackageDescription to handle AdditionalProperties

type InternationalPackageDescriptionMailClass

type InternationalPackageDescriptionMailClass string

InternationalPackageDescriptionMailClass International Mail classes for the label.

`GLOBAL_EXPRESS_GUARANTEED` is supported by shipping options, but is not supported by labels. Global Express Guaranteed Service is suspended as of September 29, 2024.

const (
	InternationalPackageDescriptionMailClassALL                                   InternationalPackageDescriptionMailClass = "ALL"
	InternationalPackageDescriptionMailClassFIRSTCLASSPACKAGEINTERNATIONALSERVICE InternationalPackageDescriptionMailClass = "FIRST-CLASS_PACKAGE_INTERNATIONAL_SERVICE"
	InternationalPackageDescriptionMailClassGLOBALEXPRESSGUARANTEED               InternationalPackageDescriptionMailClass = "GLOBAL_EXPRESS_GUARANTEED"
	InternationalPackageDescriptionMailClassPRIORITYMAILEXPRESSINTERNATIONAL      InternationalPackageDescriptionMailClass = "PRIORITY_MAIL_EXPRESS_INTERNATIONAL"
	InternationalPackageDescriptionMailClassPRIORITYMAILINTERNATIONAL             InternationalPackageDescriptionMailClass = "PRIORITY_MAIL_INTERNATIONAL"
)

Defines values for InternationalPackageDescriptionMailClass.

type InternationalPricingOption

type InternationalPricingOption struct {
	// PaymentAccount Payment account information. Used only if `priceType` is `CONTRACT`.
	PaymentAccount *PaymentAccount `json:"paymentAccount,omitempty"`

	// PriceType Price type of the Shipping Request.
	//
	// Note:
	// - If `priceType` is `CONTRACT`, `paymentAccount` is required.
	PriceType *PriceTypeRequest `json:"priceType,omitempty"`

	// ShippingOptions List of available shipping services and delivery options for the package
	ShippingOptions *[]InternationalOptions `json:"shippingOptions,omitempty"`
}

InternationalPricingOption Option for international pricing

type InternationalRateOptions

type InternationalRateOptions struct {
	// DutiesTaxesFeesQuote The duties, taxes, and fees details. Included if `requestDutiesTaxesFees` is `true` and the shipping destination has applicable duties, taxes, and fees.
	DutiesTaxesFeesQuote *DutiesTaxesFeesQuote `json:"dutiesTaxesFeesQuote,omitempty"`

	// ExtraServices Extra services requested on the package.
	ExtraServices *[]struct {
		// SKU SKU of the extra service.
		SKU *string `json:"SKU,omitempty"`

		// ExtraService The code for the extra service.
		ExtraService *string `json:"extraService,omitempty"`

		// Name Name of the extra service.
		Name *string `json:"name,omitempty"`

		// Price The price for the extra service.
		Price *float64 `json:"price,omitempty"`

		// PriceType The type of price applied.
		//  * Valid Options for Domestic Prices include: 'RETAIL', 'COMMERCIAL', & 'CONTRACT'
		//  * Valid Options for International Prices include: 'RETAIL', 'COMMERCIAL', 'COMMERCIAL_BASE', 'COMMERCIAL_PLUS', & 'CONTRACT'
		PriceType *PriceType `json:"priceType,omitempty"`

		// Warnings List of warnings
		Warnings *[]struct {
			// WarningCode Warning code in response to the request.
			WarningCode *string `json:"warningCode,omitempty"`

			// WarningDescription A human-readable message describing the warning.
			WarningDescription *string `json:"warningDescription,omitempty"`
		} `json:"warnings,omitempty"`
	} `json:"extraServices,omitempty"`

	// Rates List of available rates for the package including base postage and extra service fees
	Rates *[]struct {
		// SKU Pricing SKU.
		SKU *string `json:"SKU,omitempty"`

		// Description The description of the price.
		Description *string `json:"description,omitempty"`

		// DestinationEntryFacilityType Destination Entry Facility type for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		//
		// * `NONE` - None, translates to PTR code `N`
		// * `AREA_DISTRIBUTION_CENTER` - Area Distribution Center, translates to PTR code `A`
		// * `AUXILIARY_SERVICE_FACILITY` - Auxiliary Service Facility, translates to PTR code `F`
		// * `DESTINATION_DELIVERY_UNIT` - Destination Delivery Unit, translates to PTR code `D`
		// * `DESTINATION_NETWORK_DISTRIBUTION_CENTER` - Destination Network Distribution Center, translates to PTR code `B`
		// * `DESTINATION_SECTIONAL_CENTER_FACILITY` - Destination Sectional Center Facility, translates to PTR code `S`
		// * `DESTINATION_SERVICE_HUB` - Destination Service Hub, translates to PTR code `H`
		// * `INTERNATIONAL_SERVICE_CENTER` - International Service Center, translates to PTR code `I`
		// * `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` - Destination Regional Processing Distribution Center, translates to PTR code `B`
		//
		// Note:
		// * Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible.
		// * Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.
		DestinationEntryFacilityType *InternationalRateOptionsRatesDestinationEntryFacilityType `json:"destinationEntryFacilityType,omitempty"`

		// DimWeight The dimensional weight of the package, if greater than specified in weight, in ounces.
		DimWeight *float32 `json:"dimWeight,omitempty"`

		// DimensionalWeight The dimensional weight of package, if greater than specified in weight, in ounces. This will be removed in July 2025.
		// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
		DimensionalWeight *float32 `json:"dimensionalWeight,omitempty"`

		// EndDate Effective end date of the rate. If blank, the rate does not have an end date as of yet.
		EndDate *string `json:"endDate,omitempty"`

		// Fees Fees associated to the package.
		Fees *[]struct {
			// SKU Pricing SKU.
			SKU *string `json:"SKU,omitempty"`

			// Name Name of the fee.
			Name *string `json:"name,omitempty"`

			// Price The price for the fee.
			Price *float64 `json:"price,omitempty"`
		} `json:"fees,omitempty"`

		// MailClass List or enumeration of the domestic or international mail classes available
		MailClass *AllMailClasses `json:"mailClass,omitempty"`

		// Price Amount of Postage Required, does not include insurance or other extra service fees.
		Price *float64 `json:"price,omitempty"`

		// PriceType The type of price applied.
		//  * Valid Options for Domestic Prices include: 'RETAIL', 'COMMERCIAL', & 'CONTRACT'
		//  * Valid Options for International Prices include: 'RETAIL', 'COMMERCIAL', 'COMMERCIAL_BASE', 'COMMERCIAL_PLUS', & 'CONTRACT'
		PriceType *PriceType `json:"priceType,omitempty"`

		// ProcessingCategory Processing category for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		//
		// * `CARDS` - Cards, translates to PTR code `0`
		// * `LETTERS` - Letters, translates to PTR code `1`
		// * `FLATS` - Flats, translates to PTR code `2`
		// * `MACHINABLE` - Machinable Parcel, translates to PTR code `3`
		// * `IRREGULAR` - Irregular Parcel, translates to PTR code `4` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025.
		// * `NON_MACHINABLE` - Non-machinable parcel, translates to PTR code `5` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025.
		// * `NONSTANDARD` - Nonstandard parcel, translates to PTR code `5`
		// * `CATALOGS` - Catalogs, translates to PTR code `C`
		// * `OPEN_AND_DISTRIBUTE` - Open and Distribute, translates to PTR code `O`
		// * `RETURNS` - Returns, translates to PTR code `R`
		// * `SOFT_PACK_MACHINABLE` - Soft Pack Machinable, translates to PTR code `S`
		// * `SOFT_PACK_NON_MACHINABLE` - Soft Package Non-machinable, translates to PTR code `T`
		ProcessingCategory *InternationalRateOptionsRatesProcessingCategory `json:"processingCategory,omitempty"`

		// ProductDefinition A business friendly description associated to the product that can be displayed to a customer on a shipping portal.
		ProductDefinition *string `json:"productDefinition,omitempty"`

		// ProductName A business friendly name associated to the product that can be displayed to a customer on a shipping portal.
		ProductName *string `json:"productName,omitempty"`

		// RateIndicator Two-digit rate indicator code for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		RateIndicator *string `json:"rateIndicator,omitempty"`

		// StartDate Effective start date of the rate.
		StartDate *openapi_types.Date `json:"startDate,omitempty"`

		// Weight The package weight, in weightUOM. Items must weigh 70 pounds (1120 ounces) or less.
		Weight *float32 `json:"weight,omitempty"`

		// Zone For domestic requests: indicates the calculated zone between the provided `originZIPCode` and `destinationZIPCode` for a given `mailClass`, `mailingDate`, and `weight`.
		//
		// For international requests: indicates the price group for a given `destinationCountryCode`, `mailClass`, `mailingDate`, and `rateIndicator`.
		Zone *string `json:"zone,omitempty"`
	} `json:"rates,omitempty"`

	// TotalBasePrice The price of the rate, fees, and pound postage.
	TotalBasePrice *float64 `json:"totalBasePrice,omitempty"`

	// TotalPrice The total price, including the `totalBasePrice` and all extra service prices.
	//
	// Note: This field is only returned when `extraServices` are passed in the request.
	TotalPrice           *float64               `json:"totalPrice,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

InternationalRateOptions defines model for InternationalRateOptions.

func (InternationalRateOptions) Get

func (a InternationalRateOptions) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for InternationalRateOptions. Returns the specified element and whether it was found

func (InternationalRateOptions) MarshalJSON

func (a InternationalRateOptions) MarshalJSON() ([]byte, error)

Override default JSON handling for InternationalRateOptions to handle AdditionalProperties

func (*InternationalRateOptions) Set

func (a *InternationalRateOptions) Set(fieldName string, value interface{})

Setter for additional properties for InternationalRateOptions

func (*InternationalRateOptions) UnmarshalJSON

func (a *InternationalRateOptions) UnmarshalJSON(b []byte) error

Override default JSON handling for InternationalRateOptions to handle AdditionalProperties

type InternationalRateOptionsRatesDestinationEntryFacilityType

type InternationalRateOptionsRatesDestinationEntryFacilityType string

InternationalRateOptionsRatesDestinationEntryFacilityType Destination Entry Facility type for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.

* `NONE` - None, translates to PTR code `N` * `AREA_DISTRIBUTION_CENTER` - Area Distribution Center, translates to PTR code `A` * `AUXILIARY_SERVICE_FACILITY` - Auxiliary Service Facility, translates to PTR code `F` * `DESTINATION_DELIVERY_UNIT` - Destination Delivery Unit, translates to PTR code `D` * `DESTINATION_NETWORK_DISTRIBUTION_CENTER` - Destination Network Distribution Center, translates to PTR code `B` * `DESTINATION_SECTIONAL_CENTER_FACILITY` - Destination Sectional Center Facility, translates to PTR code `S` * `DESTINATION_SERVICE_HUB` - Destination Service Hub, translates to PTR code `H` * `INTERNATIONAL_SERVICE_CENTER` - International Service Center, translates to PTR code `I` * `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` - Destination Regional Processing Distribution Center, translates to PTR code `B`

Note: * Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible. * Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.

const (
	InternationalRateOptionsRatesDestinationEntryFacilityTypeAREADISTRIBUTIONCENTER                          InternationalRateOptionsRatesDestinationEntryFacilityType = "AREA_DISTRIBUTION_CENTER"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeAUXILIARYSERVICEFACILITY                        InternationalRateOptionsRatesDestinationEntryFacilityType = "AUXILIARY_SERVICE_FACILITY"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONDELIVERYUNIT                         InternationalRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_DELIVERY_UNIT"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONNETWORKDISTRIBUTIONCENTER            InternationalRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_NETWORK_DISTRIBUTION_CENTER"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONREGIONALPROCESSINGDISTRIBUTIONCENTER InternationalRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONSECTIONALCENTERFACILITY              InternationalRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_SECTIONAL_CENTER_FACILITY"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeDESTINATIONSERVICEHUB                           InternationalRateOptionsRatesDestinationEntryFacilityType = "DESTINATION_SERVICE_HUB"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeINTERNATIONALSERVICECENTER                      InternationalRateOptionsRatesDestinationEntryFacilityType = "INTERNATIONAL_SERVICE_CENTER"
	InternationalRateOptionsRatesDestinationEntryFacilityTypeNONE                                            InternationalRateOptionsRatesDestinationEntryFacilityType = "NONE"
)

Defines values for InternationalRateOptionsRatesDestinationEntryFacilityType.

type InternationalRateOptionsRatesProcessingCategory

type InternationalRateOptionsRatesProcessingCategory string

InternationalRateOptionsRatesProcessingCategory Processing category for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.

* `CARDS` - Cards, translates to PTR code `0` * `LETTERS` - Letters, translates to PTR code `1` * `FLATS` - Flats, translates to PTR code `2` * `MACHINABLE` - Machinable Parcel, translates to PTR code `3` * `IRREGULAR` - Irregular Parcel, translates to PTR code `4` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025. * `NON_MACHINABLE` - Non-machinable parcel, translates to PTR code `5` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025. * `NONSTANDARD` - Nonstandard parcel, translates to PTR code `5` * `CATALOGS` - Catalogs, translates to PTR code `C` * `OPEN_AND_DISTRIBUTE` - Open and Distribute, translates to PTR code `O` * `RETURNS` - Returns, translates to PTR code `R` * `SOFT_PACK_MACHINABLE` - Soft Pack Machinable, translates to PTR code `S` * `SOFT_PACK_NON_MACHINABLE` - Soft Package Non-machinable, translates to PTR code `T`

const (
	InternationalRateOptionsRatesProcessingCategoryCARDS                 InternationalRateOptionsRatesProcessingCategory = "CARDS"
	InternationalRateOptionsRatesProcessingCategoryCATALOGS              InternationalRateOptionsRatesProcessingCategory = "CATALOGS"
	InternationalRateOptionsRatesProcessingCategoryFLATS                 InternationalRateOptionsRatesProcessingCategory = "FLATS"
	InternationalRateOptionsRatesProcessingCategoryIRREGULAR             InternationalRateOptionsRatesProcessingCategory = "IRREGULAR"
	InternationalRateOptionsRatesProcessingCategoryLETTERS               InternationalRateOptionsRatesProcessingCategory = "LETTERS"
	InternationalRateOptionsRatesProcessingCategoryMACHINABLE            InternationalRateOptionsRatesProcessingCategory = "MACHINABLE"
	InternationalRateOptionsRatesProcessingCategoryNONMACHINABLE         InternationalRateOptionsRatesProcessingCategory = "NON_MACHINABLE"
	InternationalRateOptionsRatesProcessingCategoryNONSTANDARD           InternationalRateOptionsRatesProcessingCategory = "NONSTANDARD"
	InternationalRateOptionsRatesProcessingCategoryOPENANDDISTRIBUTE     InternationalRateOptionsRatesProcessingCategory = "OPEN_AND_DISTRIBUTE"
	InternationalRateOptionsRatesProcessingCategoryRETURNS               InternationalRateOptionsRatesProcessingCategory = "RETURNS"
	InternationalRateOptionsRatesProcessingCategorySOFTPACKMACHINABLE    InternationalRateOptionsRatesProcessingCategory = "SOFT_PACK_MACHINABLE"
	InternationalRateOptionsRatesProcessingCategorySOFTPACKNONMACHINABLE InternationalRateOptionsRatesProcessingCategory = "SOFT_PACK_NON_MACHINABLE"
)

Defines values for InternationalRateOptionsRatesProcessingCategory.

type MailingDate

type MailingDate = openapi_types.Date

MailingDate The date package will be mailed. The mailing date may be today plus 0 to 30 days in advance. Enter the date in the full-date notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).

type MailingDateTime

type MailingDateTime = time.Time

MailingDateTime The date and time a package will be mailed. The mailing date may be today plus 0 to 30 days in advance. Enter the date in the date-time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).

type OptionsRequest

type OptionsRequest struct {
	// contains filtered or unexported fields
}

OptionsRequest All ingredients requested to calculate pricing based on USPS service standards.

func (OptionsRequest) AsDomesticOptionsRequest

func (t OptionsRequest) AsDomesticOptionsRequest() (DomesticOptionsRequest, error)

AsDomesticOptionsRequest returns the union data inside the OptionsRequest as a DomesticOptionsRequest

func (OptionsRequest) AsInternationalOptionsRequest

func (t OptionsRequest) AsInternationalOptionsRequest() (InternationalOptionsRequest, error)

AsInternationalOptionsRequest returns the union data inside the OptionsRequest as a InternationalOptionsRequest

func (*OptionsRequest) FromDomesticOptionsRequest

func (t *OptionsRequest) FromDomesticOptionsRequest(v DomesticOptionsRequest) error

FromDomesticOptionsRequest overwrites any union data inside the OptionsRequest as the provided DomesticOptionsRequest

func (*OptionsRequest) FromInternationalOptionsRequest

func (t *OptionsRequest) FromInternationalOptionsRequest(v InternationalOptionsRequest) error

FromInternationalOptionsRequest overwrites any union data inside the OptionsRequest as the provided InternationalOptionsRequest

func (OptionsRequest) MarshalJSON

func (t OptionsRequest) MarshalJSON() ([]byte, error)

func (*OptionsRequest) MergeDomesticOptionsRequest

func (t *OptionsRequest) MergeDomesticOptionsRequest(v DomesticOptionsRequest) error

MergeDomesticOptionsRequest performs a merge with any union data inside the OptionsRequest, using the provided DomesticOptionsRequest

func (*OptionsRequest) MergeInternationalOptionsRequest

func (t *OptionsRequest) MergeInternationalOptionsRequest(v InternationalOptionsRequest) error

MergeInternationalOptionsRequest performs a merge with any union data inside the OptionsRequest, using the provided InternationalOptionsRequest

func (*OptionsRequest) UnmarshalJSON

func (t *OptionsRequest) UnmarshalJSON(b []byte) error

type OptionsResponse

type OptionsResponse struct {
	// contains filtered or unexported fields
}

OptionsResponse The response type varies depending on which request is passed

func (OptionsResponse) AsDomesticOptionsResponse

func (t OptionsResponse) AsDomesticOptionsResponse() (DomesticOptionsResponse, error)

AsDomesticOptionsResponse returns the union data inside the OptionsResponse as a DomesticOptionsResponse

func (OptionsResponse) AsInternationalOptionsResponse

func (t OptionsResponse) AsInternationalOptionsResponse() (InternationalOptionsResponse, error)

AsInternationalOptionsResponse returns the union data inside the OptionsResponse as a InternationalOptionsResponse

func (*OptionsResponse) FromDomesticOptionsResponse

func (t *OptionsResponse) FromDomesticOptionsResponse(v DomesticOptionsResponse) error

FromDomesticOptionsResponse overwrites any union data inside the OptionsResponse as the provided DomesticOptionsResponse

func (*OptionsResponse) FromInternationalOptionsResponse

func (t *OptionsResponse) FromInternationalOptionsResponse(v InternationalOptionsResponse) error

FromInternationalOptionsResponse overwrites any union data inside the OptionsResponse as the provided InternationalOptionsResponse

func (OptionsResponse) MarshalJSON

func (t OptionsResponse) MarshalJSON() ([]byte, error)

func (*OptionsResponse) MergeDomesticOptionsResponse

func (t *OptionsResponse) MergeDomesticOptionsResponse(v DomesticOptionsResponse) error

MergeDomesticOptionsResponse performs a merge with any union data inside the OptionsResponse, using the provided DomesticOptionsResponse

func (*OptionsResponse) MergeInternationalOptionsResponse

func (t *OptionsResponse) MergeInternationalOptionsResponse(v InternationalOptionsResponse) error

MergeInternationalOptionsResponse performs a merge with any union data inside the OptionsResponse, using the provided InternationalOptionsResponse

func (*OptionsResponse) UnmarshalJSON

func (t *OptionsResponse) UnmarshalJSON(b []byte) error

type OriginZIPCode

type OriginZIPCode = string

OriginZIPCode The originating ZIP code for the package.

type PaymentAccount

type PaymentAccount struct {
	// AccountNumber The Enterprise Payment Account, Permit number, Mailer ID (MID), or PC Postage meter number associated with a contract.
	AccountNumber *string `json:"accountNumber,omitempty"`

	// AccountType The type of payment account.
	//
	// Note:
	// - `EPS`, `PERMIT`, and `METER` are only available for Outbound Mail Classes.
	// - `METER` is only available to PC Postage Providers.
	// - `MID` is only available for Return Mail Classes.
	AccountType          *PaymentAccountAccountType `json:"accountType,omitempty"`
	AdditionalProperties map[string]interface{}     `json:"-"`
}

PaymentAccount Payment account information. Used only if `priceType` is `CONTRACT`.

func (PaymentAccount) Get

func (a PaymentAccount) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for PaymentAccount. Returns the specified element and whether it was found

func (PaymentAccount) MarshalJSON

func (a PaymentAccount) MarshalJSON() ([]byte, error)

Override default JSON handling for PaymentAccount to handle AdditionalProperties

func (*PaymentAccount) Set

func (a *PaymentAccount) Set(fieldName string, value interface{})

Setter for additional properties for PaymentAccount

func (*PaymentAccount) UnmarshalJSON

func (a *PaymentAccount) UnmarshalJSON(b []byte) error

Override default JSON handling for PaymentAccount to handle AdditionalProperties

type PaymentAccountAccountType

type PaymentAccountAccountType string

PaymentAccountAccountType The type of payment account.

Note: - `EPS`, `PERMIT`, and `METER` are only available for Outbound Mail Classes. - `METER` is only available to PC Postage Providers. - `MID` is only available for Return Mail Classes.

const (
	PaymentAccountAccountTypeEPS    PaymentAccountAccountType = "EPS"
	PaymentAccountAccountTypeMETER  PaymentAccountAccountType = "METER"
	PaymentAccountAccountTypeMID    PaymentAccountAccountType = "MID"
	PaymentAccountAccountTypePERMIT PaymentAccountAccountType = "PERMIT"
)

Defines values for PaymentAccountAccountType.

type PostOptionsSearchJSONRequestBody

type PostOptionsSearchJSONRequestBody = OptionsRequest

PostOptionsSearchJSONRequestBody defines body for PostOptionsSearch for application/json ContentType.

type PostOptionsSearchResponse

type PostOptionsSearchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *OptionsResponse
	XML200       *OptionsResponse
	JSON400      *ErrorMessage
	XML400       *ErrorMessage
	JSON401      *ErrorMessage
	XML401       *ErrorMessage
	JSON403      *ErrorMessage
	XML403       *ErrorMessage
	JSON429      *ErrorMessage
	XML429       *ErrorMessage
	JSON503      *ErrorMessage
	XML503       *ErrorMessage
}

func ParsePostOptionsSearchResponse

func ParsePostOptionsSearchResponse(rsp *http.Response) (*PostOptionsSearchResponse, error)

ParsePostOptionsSearchResponse parses an HTTP response from a PostOptionsSearchWithResponse call

func (PostOptionsSearchResponse) Status

func (r PostOptionsSearchResponse) Status() string

Status returns HTTPResponse.Status

func (PostOptionsSearchResponse) StatusCode

func (r PostOptionsSearchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostalCode

type PostalCode = string

PostalCode This is the Postal Code used in an international addresses.

Note: - Different shipping destinations may require a postal code for shipping. For more details, review the [Individual Country Listing](https://pe.usps.com/text/imm/immctry.htm) for your shipping destination

type PriceType

type PriceType string

PriceType The type of price applied.

  • Valid Options for Domestic Prices include: 'RETAIL', 'COMMERCIAL', & 'CONTRACT'
  • Valid Options for International Prices include: 'RETAIL', 'COMMERCIAL', 'COMMERCIAL_BASE', 'COMMERCIAL_PLUS', & 'CONTRACT'
const (
	PriceTypeCOMMERCIAL     PriceType = "COMMERCIAL"
	PriceTypeCOMMERCIALBASE PriceType = "COMMERCIAL_BASE"
	PriceTypeCOMMERCIALPLUS PriceType = "COMMERCIAL_PLUS"
	PriceTypeCONTRACT       PriceType = "CONTRACT"
	PriceTypeRETAIL         PriceType = "RETAIL"
)

Defines values for PriceType.

type PriceTypeRequest

type PriceTypeRequest string

PriceTypeRequest Price type of the Shipping Request.

Note: - If `priceType` is `CONTRACT`, `paymentAccount` is required.

const (
	PriceTypeRequestCOMMERCIAL PriceTypeRequest = "COMMERCIAL"
	PriceTypeRequestCONTRACT   PriceTypeRequest = "CONTRACT"
	PriceTypeRequestRETAIL     PriceTypeRequest = "RETAIL"
)

Defines values for PriceTypeRequest.

type RateOptions

type RateOptions struct {
	// ExtraServices Extra services requested on the package.
	ExtraServices *[]struct {
		// SKU SKU of the extra service.
		SKU *string `json:"SKU,omitempty"`

		// ExtraService The code for the extra service.
		ExtraService *string `json:"extraService,omitempty"`

		// Name Name of the extra service.
		Name *string `json:"name,omitempty"`

		// Price The price for the extra service.
		Price *float64 `json:"price,omitempty"`

		// PriceType The type of price applied.
		//  * Valid Options for Domestic Prices include: 'RETAIL', 'COMMERCIAL', & 'CONTRACT'
		//  * Valid Options for International Prices include: 'RETAIL', 'COMMERCIAL', 'COMMERCIAL_BASE', 'COMMERCIAL_PLUS', & 'CONTRACT'
		PriceType *PriceType `json:"priceType,omitempty"`

		// Warnings List of warnings
		Warnings *[]struct {
			// WarningCode Warning code in response to the request.
			WarningCode *string `json:"warningCode,omitempty"`

			// WarningDescription A human-readable message describing the warning.
			WarningDescription *string `json:"warningDescription,omitempty"`
		} `json:"warnings,omitempty"`
	} `json:"extraServices,omitempty"`

	// Rates List of available rates for the package including base postage and extra service fees
	Rates *[]struct {
		// SKU Pricing SKU.
		SKU *string `json:"SKU,omitempty"`

		// Description The description of the price.
		Description *string `json:"description,omitempty"`

		// DestinationEntryFacilityType Destination Entry Facility type for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		//
		// * `NONE` - None, translates to PTR code `N`
		// * `AREA_DISTRIBUTION_CENTER` - Area Distribution Center, translates to PTR code `A`
		// * `AUXILIARY_SERVICE_FACILITY` - Auxiliary Service Facility, translates to PTR code `F`
		// * `DESTINATION_DELIVERY_UNIT` - Destination Delivery Unit, translates to PTR code `D`
		// * `DESTINATION_NETWORK_DISTRIBUTION_CENTER` - Destination Network Distribution Center, translates to PTR code `B`
		// * `DESTINATION_SECTIONAL_CENTER_FACILITY` - Destination Sectional Center Facility, translates to PTR code `S`
		// * `DESTINATION_SERVICE_HUB` - Destination Service Hub, translates to PTR code `H`
		// * `INTERNATIONAL_SERVICE_CENTER` - International Service Center, translates to PTR code `I`
		// * `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` - Destination Regional Processing Distribution Center, translates to PTR code `B`
		//
		// Note:
		// * Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible.
		// * Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.
		DestinationEntryFacilityType *RateOptionsRatesDestinationEntryFacilityType `json:"destinationEntryFacilityType,omitempty"`

		// DimWeight The dimensional weight of the package, if greater than specified in weight, in ounces.
		DimWeight *float32 `json:"dimWeight,omitempty"`

		// DimensionalWeight The dimensional weight of package, if greater than specified in weight, in ounces. This will be removed in July 2025.
		// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
		DimensionalWeight *float32 `json:"dimensionalWeight,omitempty"`

		// EndDate Effective end date of the rate. If blank, the rate does not have an end date as of yet.
		EndDate *string `json:"endDate,omitempty"`

		// Fees Fees associated to the package.
		Fees *[]struct {
			// SKU Pricing SKU.
			SKU *string `json:"SKU,omitempty"`

			// Name Name of the fee.
			Name *string `json:"name,omitempty"`

			// Price The price for the fee.
			Price *float64 `json:"price,omitempty"`
		} `json:"fees,omitempty"`

		// MailClass List or enumeration of the domestic or international mail classes available
		MailClass *AllMailClasses `json:"mailClass,omitempty"`

		// Price Amount of Postage Required, does not include insurance or other extra service fees.
		Price *float64 `json:"price,omitempty"`

		// PriceType The type of price applied.
		//  * Valid Options for Domestic Prices include: 'RETAIL', 'COMMERCIAL', & 'CONTRACT'
		//  * Valid Options for International Prices include: 'RETAIL', 'COMMERCIAL', 'COMMERCIAL_BASE', 'COMMERCIAL_PLUS', & 'CONTRACT'
		PriceType *PriceType `json:"priceType,omitempty"`

		// ProcessingCategory Processing category for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		//
		// * `CARDS` - Cards, translates to PTR code `0`
		// * `LETTERS` - Letters, translates to PTR code `1`
		// * `FLATS` - Flats, translates to PTR code `2`
		// * `MACHINABLE` - Machinable Parcel, translates to PTR code `3`
		// * `IRREGULAR` - Irregular Parcel, translates to PTR code `4` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025.
		// * `NON_MACHINABLE` - Non-machinable parcel, translates to PTR code `5` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025.
		// * `NONSTANDARD` - Nonstandard parcel, translates to PTR code `5`
		// * `CATALOGS` - Catalogs, translates to PTR code `C`
		// * `OPEN_AND_DISTRIBUTE` - Open and Distribute, translates to PTR code `O`
		// * `RETURNS` - Returns, translates to PTR code `R`
		// * `SOFT_PACK_MACHINABLE` - Soft Pack Machinable, translates to PTR code `S`
		// * `SOFT_PACK_NON_MACHINABLE` - Soft Package Non-machinable, translates to PTR code `T`
		ProcessingCategory *RateOptionsRatesProcessingCategory `json:"processingCategory,omitempty"`

		// ProductDefinition A business friendly description associated to the product that can be displayed to a customer on a shipping portal.
		ProductDefinition *string `json:"productDefinition,omitempty"`

		// ProductName A business friendly name associated to the product that can be displayed to a customer on a shipping portal.
		ProductName *string `json:"productName,omitempty"`

		// RateIndicator Two-digit rate indicator code for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.
		RateIndicator *string `json:"rateIndicator,omitempty"`

		// StartDate Effective start date of the rate.
		StartDate *openapi_types.Date `json:"startDate,omitempty"`

		// Weight The package weight, in weightUOM. Items must weigh 70 pounds (1120 ounces) or less.
		Weight *float32 `json:"weight,omitempty"`

		// Zone For domestic requests: indicates the calculated zone between the provided `originZIPCode` and `destinationZIPCode` for a given `mailClass`, `mailingDate`, and `weight`.
		//
		// For international requests: indicates the price group for a given `destinationCountryCode`, `mailClass`, `mailingDate`, and `rateIndicator`.
		Zone *string `json:"zone,omitempty"`
	} `json:"rates,omitempty"`

	// TotalBasePrice The price of the rate, fees, and pound postage.
	TotalBasePrice *float64 `json:"totalBasePrice,omitempty"`

	// TotalPrice The total price, including the `totalBasePrice` and all extra service prices.
	//
	// Note: This field is only returned when `extraServices` are passed in the request.
	TotalPrice           *float64               `json:"totalPrice,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

RateOptions Options used to determine the rate

func (RateOptions) Get

func (a RateOptions) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for RateOptions. Returns the specified element and whether it was found

func (RateOptions) MarshalJSON

func (a RateOptions) MarshalJSON() ([]byte, error)

Override default JSON handling for RateOptions to handle AdditionalProperties

func (*RateOptions) Set

func (a *RateOptions) Set(fieldName string, value interface{})

Setter for additional properties for RateOptions

func (*RateOptions) UnmarshalJSON

func (a *RateOptions) UnmarshalJSON(b []byte) error

Override default JSON handling for RateOptions to handle AdditionalProperties

type RateOptionsRatesDestinationEntryFacilityType

type RateOptionsRatesDestinationEntryFacilityType string

RateOptionsRatesDestinationEntryFacilityType Destination Entry Facility type for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.

* `NONE` - None, translates to PTR code `N` * `AREA_DISTRIBUTION_CENTER` - Area Distribution Center, translates to PTR code `A` * `AUXILIARY_SERVICE_FACILITY` - Auxiliary Service Facility, translates to PTR code `F` * `DESTINATION_DELIVERY_UNIT` - Destination Delivery Unit, translates to PTR code `D` * `DESTINATION_NETWORK_DISTRIBUTION_CENTER` - Destination Network Distribution Center, translates to PTR code `B` * `DESTINATION_SECTIONAL_CENTER_FACILITY` - Destination Sectional Center Facility, translates to PTR code `S` * `DESTINATION_SERVICE_HUB` - Destination Service Hub, translates to PTR code `H` * `INTERNATIONAL_SERVICE_CENTER` - International Service Center, translates to PTR code `I` * `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` - Destination Regional Processing Distribution Center, translates to PTR code `B`

Note: * Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible. * Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.

const (
	RateOptionsRatesDestinationEntryFacilityTypeAREADISTRIBUTIONCENTER                          RateOptionsRatesDestinationEntryFacilityType = "AREA_DISTRIBUTION_CENTER"
	RateOptionsRatesDestinationEntryFacilityTypeAUXILIARYSERVICEFACILITY                        RateOptionsRatesDestinationEntryFacilityType = "AUXILIARY_SERVICE_FACILITY"
	RateOptionsRatesDestinationEntryFacilityTypeDESTINATIONDELIVERYUNIT                         RateOptionsRatesDestinationEntryFacilityType = "DESTINATION_DELIVERY_UNIT"
	RateOptionsRatesDestinationEntryFacilityTypeDESTINATIONNETWORKDISTRIBUTIONCENTER            RateOptionsRatesDestinationEntryFacilityType = "DESTINATION_NETWORK_DISTRIBUTION_CENTER"
	RateOptionsRatesDestinationEntryFacilityTypeDESTINATIONREGIONALPROCESSINGDISTRIBUTIONCENTER RateOptionsRatesDestinationEntryFacilityType = "DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER"
	RateOptionsRatesDestinationEntryFacilityTypeDESTINATIONSECTIONALCENTERFACILITY              RateOptionsRatesDestinationEntryFacilityType = "DESTINATION_SECTIONAL_CENTER_FACILITY"
	RateOptionsRatesDestinationEntryFacilityTypeDESTINATIONSERVICEHUB                           RateOptionsRatesDestinationEntryFacilityType = "DESTINATION_SERVICE_HUB"
	RateOptionsRatesDestinationEntryFacilityTypeINTERNATIONALSERVICECENTER                      RateOptionsRatesDestinationEntryFacilityType = "INTERNATIONAL_SERVICE_CENTER"
	RateOptionsRatesDestinationEntryFacilityTypeNONE                                            RateOptionsRatesDestinationEntryFacilityType = "NONE"
)

Defines values for RateOptionsRatesDestinationEntryFacilityType.

type RateOptionsRatesProcessingCategory

type RateOptionsRatesProcessingCategory string

RateOptionsRatesProcessingCategory Processing category for the provided rate, this value can be used in the labels API to ensure the provided rate is applied.

* `CARDS` - Cards, translates to PTR code `0` * `LETTERS` - Letters, translates to PTR code `1` * `FLATS` - Flats, translates to PTR code `2` * `MACHINABLE` - Machinable Parcel, translates to PTR code `3` * `IRREGULAR` - Irregular Parcel, translates to PTR code `4` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025. * `NON_MACHINABLE` - Non-machinable parcel, translates to PTR code `5` - This option is deprecated in favor of `NONSTANDARD` and will no longer be returned as of 01/19/2025. * `NONSTANDARD` - Nonstandard parcel, translates to PTR code `5` * `CATALOGS` - Catalogs, translates to PTR code `C` * `OPEN_AND_DISTRIBUTE` - Open and Distribute, translates to PTR code `O` * `RETURNS` - Returns, translates to PTR code `R` * `SOFT_PACK_MACHINABLE` - Soft Pack Machinable, translates to PTR code `S` * `SOFT_PACK_NON_MACHINABLE` - Soft Package Non-machinable, translates to PTR code `T`

const (
	CARDS                 RateOptionsRatesProcessingCategory = "CARDS"
	CATALOGS              RateOptionsRatesProcessingCategory = "CATALOGS"
	FLATS                 RateOptionsRatesProcessingCategory = "FLATS"
	IRREGULAR             RateOptionsRatesProcessingCategory = "IRREGULAR"
	LETTERS               RateOptionsRatesProcessingCategory = "LETTERS"
	MACHINABLE            RateOptionsRatesProcessingCategory = "MACHINABLE"
	NONMACHINABLE         RateOptionsRatesProcessingCategory = "NON_MACHINABLE"
	NONSTANDARD           RateOptionsRatesProcessingCategory = "NONSTANDARD"
	OPENANDDISTRIBUTE     RateOptionsRatesProcessingCategory = "OPEN_AND_DISTRIBUTE"
	RETURNS               RateOptionsRatesProcessingCategory = "RETURNS"
	SOFTPACKMACHINABLE    RateOptionsRatesProcessingCategory = "SOFT_PACK_MACHINABLE"
	SOFTPACKNONMACHINABLE RateOptionsRatesProcessingCategory = "SOFT_PACK_NON_MACHINABLE"
)

Defines values for RateOptionsRatesProcessingCategory.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ShippingOptionsPackageDescription

type ShippingOptionsPackageDescription struct {
	// Girth The girth of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Girth *float32 `json:"girth,omitempty"`

	// HasNonstandardCharacteristics Package is nonstandard. Nonstandard packages include cylindrical tubes and rolls, certain high-density items, cartons containing more than 24 ounces of liquids in one or more glass containers, cartons containing 1 gallon or more of liquid in metal or plastic containers, and items in [201.7.6.2](https://pe.usps.com/text/dmm300/201.htm#7.6.2).
	HasNonstandardCharacteristics *bool `json:"hasNonstandardCharacteristics,omitempty"`

	// Height The height of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Height float32 `json:"height"`

	// Length The length of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Length float32 `json:"length"`

	// Weight The package weight, in weightUOM (Unit Of Measure). Items must weigh 70 pounds (1120 ounces) or less.
	Weight float32 `json:"weight"`

	// Width The width of the container, in dimensionsUOM. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non- rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non- rectangular packages.
	Width                float32                `json:"width"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ShippingOptionsPackageDescription Package Definitions

func (ShippingOptionsPackageDescription) Get

func (a ShippingOptionsPackageDescription) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ShippingOptionsPackageDescription. Returns the specified element and whether it was found

func (ShippingOptionsPackageDescription) MarshalJSON

func (a ShippingOptionsPackageDescription) MarshalJSON() ([]byte, error)

Override default JSON handling for ShippingOptionsPackageDescription to handle AdditionalProperties

func (*ShippingOptionsPackageDescription) Set

func (a *ShippingOptionsPackageDescription) Set(fieldName string, value interface{})

Setter for additional properties for ShippingOptionsPackageDescription

func (*ShippingOptionsPackageDescription) UnmarshalJSON

func (a *ShippingOptionsPackageDescription) UnmarshalJSON(b []byte) error

Override default JSON handling for ShippingOptionsPackageDescription to handle AdditionalProperties

Jump to

Keyboard shortcuts

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