swaps

package
v0.0.0-...-fad68f1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSwap

type CreateSwap struct {
	// The ID of the Order to create the Swap for.
	OrderId string `json:"order_id"`

	// The items to include in the Return.
	ReturnItems []any `json:"return_items"`

	// The items to exchange the returned items to.
	AdditionalItems []any `json:"additional_items"`

	// The ID of the Shipping Option to create the Shipping Method from.
	ReturnShippingOption string `json:"return_shipping_option,omitempty"`
}

func NewCreateSwap

func NewCreateSwap() *CreateSwap

func (*CreateSwap) Create

func (c *CreateSwap) Create(config *medusa.Config) (*CreateSwapResponse, error)

func (*CreateSwap) SetAdditionalItems

func (c *CreateSwap) SetAdditionalItems(items []any) *CreateSwap

func (*CreateSwap) SetOrderId

func (c *CreateSwap) SetOrderId(orderId string) *CreateSwap

func (*CreateSwap) SetReturnItems

func (c *CreateSwap) SetReturnItems(items []any) *CreateSwap

func (*CreateSwap) SetReturnShippingOption

func (c *CreateSwap) SetReturnShippingOption(shippingOpions string) *CreateSwap

type CreateSwapData

type CreateSwapData struct {
	Swap *schema.Swap `json:"swap"`
}

type CreateSwapResponse

type CreateSwapResponse struct {
	// Success response
	Data *CreateSwapData

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

type RetrieveSwapData

type RetrieveSwapData struct {
	Swap *schema.Swap `json:"swap"`
}

type RetrieveSwapResponse

type RetrieveSwapResponse struct {
	// Success response
	Data *RetrieveSwapData

	// Error response
	Error *response.Error

	// Errors in case of multiple errors
	Errors *response.Errors
}

func RetrieveByCartId

func RetrieveByCartId(cartId string, config *medusa.Config) (*RetrieveSwapResponse, error)

Jump to

Keyboard shortcuts

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