Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShipmentInsurance struct cannot omit Provider field #23

Open
youraerials opened this issue Jan 30, 2024 · 0 comments
Open

ShipmentInsurance struct cannot omit Provider field #23

youraerials opened this issue Jan 30, 2024 · 0 comments

Comments

@youraerials
Copy link

Shippo has changed their insurance provider API slightly. Note here https://docs.goshippo.com/shippoapi/public-api/#operation/CreateShipment!path=extra/insurance&t=request that the Provider field must be omitted entirely if you want to opt for their XCoverage. This is currently not possible because the ShipmentInsurance struct will include an empty provider field no matter what, which breaks in the API call (if there is a provider field at all, it must contain a valid provider)

An easy fix would be:

type ShipmentInsurance struct {
	Amount   string `json:"amount"`
	Currency string `json:"currency"`
	Provider string `json:"provider,omitempty"`
	Content  string `json:"content"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant