schema

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	// ID of the address
	Id string `json:"id"`

	// ID of the customer this address belongs to
	CustomerId string `json:"customer_id"`

	// Available if the relation customer is expanded.
	Customer []*Customer `json:"customer"`
	// Company name
	Company string `json:"company,omitempty"`

	// First name
	FirstName []any `json:"first_name"`

	// Last name
	LastName []any `json:"last_name"`

	// Address line 1
	Address1 []any `json:"address_1"`

	// Address line 2
	Address2 []any `json:"address_2"`

	// City
	City []any `json:"city"`

	// The 2 character ISO code of the country in lower case
	CountryCode []any `json:"country_code"`

	// A country object. Available if the relation country is expanded.
	Country any `json:"country"`

	// Province
	Province string `json:"province"`

	// Postal Code
	PostalCode string `json:"postal_code"`

	// Phone Number
	Phone string `json:"phone"`

	// The date with timezone at which the resource was created.
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// The date with timezone at which the resource was updated.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`

	// The date with timezone at which the resource was deleted.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`

	// An optional key-value map with additional details
	Metadata map[string]any `json:"metadata,omitempty"`
}

type Cart

type Cart struct {
	// The cart's ID
	Id string `json:"id"`

	// The email associated with the cart
	Email string `json:"email"`

	// The billing address's ID
	BillingAddressId string `json:"billing_address_id"`

	// An address.
	BillingAddress *Address `json:"billing_address"`

	// The shipping address's ID
	ShippingAddressId string `json:"shipping_address_id"`

	// An address.
	ShippingAddress *Address `json:"shipping_address"`

	// Available if the relation items is expanded.
	Items []*LineItem `json:"items"`

	// The region's ID
	RegionId string `json:"region_id"`

	// A region object. Available if the relation region is expanded.
	Region any `json:"region"`

	// Available if the relation discounts is expanded.
	Discounts []any `json:"discounts"`

	// Available if the relation gift_cards is expanded
	GiftCards []*GiftCard `json:"gift_cards"`

	// The customer's ID
	CustomerId string `json:"customer_id"`

	// A customer object. Available if the relation customer is expanded.
	Customer *Customer `json:"customer"`

	PaymentSession any `json:"payment_session"`

	// The payment sessions created on the cart.
	PaymentSessions []any `json:"payment_sessions"`

	// The payment's ID if available
	PaymentId string `json:"payment_id"`

	// Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded.
	Payment any `json:"payment"`

	// The shipping methods added to the cart.
	ShippingMethods any `json:"shipping_methods"`

	// The cart's type.
	Type CartTypeEnum `json:"type"`

	// The date with timezone at which the cart was completed.
	CompletedAt *time.Time `json:"completed_at"`

	// The date with timezone at which the payment was authorized.
	PaymentAuthorizedAt *time.Time `json:"payment_authorized_at"`

	// Randomly generated key used to continue the completion of a cart in case of failure.
	Idempotency_key string `json:"idempotency_key"`

	// Example: {"ip":"::1","user_agent":"PostmanRuntime/7.29.2"}
	// The context of the cart which can include info like IP or user agent.
	Context map[string]any `json:"context"`

	// The sales channel ID the cart is associated with.
	SalesChannelId string `json:"sales_channel_id"`

	// A sales channel object. Available if the relation sales_channel is expanded.
	SalesChannel any `json:"sales_channel"`

	// The date with timezone at which the resource was created.
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// The date with timezone at which the resource was updated.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`

	// The date with timezone at which the resource was deleted.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`

	// An optional key-value map with additional details
	Metadata any `json:"metadata,omitempty"`

	// The total of shipping
	ShippingTotal uint `json:"shipping_total"`

	// The total of discount
	DiscountTotal uint `json:"discount_total"`

	// The total of tax
	TaxTotal uint `json:"tax_total"`

	// The total amount refunded if the order associated with this cart is returned.
	RefundedTotal uint `json:"refunded_total"`

	// The total amount of the cart
	Total uint `json:"total"`

	// The subtotal of the cart
	Subtotal uint `json:"subtotal"`

	// The amount that can be refunded
	RefundableAmount uint `json:"refundable_amount"`

	// The total of gift cards
	GiftCardTaxTotal uint `json:"gift_card_tax_total"`

	// The total of gift cards with taxes
	GiftCardTotal uint `json:"gift_card_total"`
}

type CartTypeEnum

type CartTypeEnum string
const (
	CartTypeDefault     CartTypeEnum = "default"
	CartTypeSwap        CartTypeEnum = "swap"
	CartTypeDraftOrder  CartTypeEnum = "draft_order"
	CartTypePaymentLink CartTypeEnum = "payment_link"
	CartTypeClaim       CartTypeEnum = "claim"
)

type Collection

type Collection struct {
	// The title that the Product Collection is identified by.
	Title string `json:"title"`

	// The product collection's ID
	Id string `json:"id,omitempty"`

	// A unique string that identifies the Product Collection - can for example be used in slug structures.
	Handle string `json:"handle,omitempty"`

	// The Products contained in the Product Collection. Available if the relation products is expanded.
	Products []*Product `json:"products,omitempty"`

	// The date with timezone at which the resource was created.
	CreatedAt time.Time `json:"created_at,omitempty"`

	// The date with timezone at which the resource was updated.
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// The date with timezone at which the resource was deleted.
	DeletedAt time.Time `json:"deleted_at,omitempty"`

	// An optional key-value map with additional details
	Metadata any `json:"metadata,omitempty"`
}

type Customer

type Customer struct {
	// The customer's email
	Email string `json:"email"`

	// The customer's ID
	Id string `json:"id"`

	// The customer's first name
	FirstName string `json:"first_name"`

	// The customer's last name
	LastName string `json:"last_name"`

	// The customer's billing address ID
	BillingAddressId string `json:"billing_address_id"`

	// An address.
	BillingAddress []*Address `json:"billing_address"`

	// Available if the relation shipping_addresses is expanded.
	ShippingAddress []*Address `json:"shipping_address"`

	// The customer's phone number
	Phone string `json:"phone"`

	// The customer's phone number
	HasAccount bool `json:"has_account"`

	// Available if the relation orders is expanded.
	Orders []*Order `json:"orders"`

	// The customer groups the customer belongs to. Available if the relation groups is expanded.
	Groups []*CustomerGroup `json:"groups"`

	// The date with timezone at which the resource was created.
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// The date with timezone at which the resource was updated.
	UpdatedAt *time.Time `json:"updated_at,omitempty"`

	// The date with timezone at which the resource was deleted.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`

	// An optional key-value map with additional details
	Metadata any `json:"metadata,omitempty"`
}

type CustomerGroup

type CustomerGroup struct {
}

type FulfillmentStatus

type FulfillmentStatus string
const (
	FulfillmentNotFulfilled   FulfillmentStatus = "not_fulfilled"
	FulfillmentFulfilled      FulfillmentStatus = "fulfilled"
	FulfillmentShipped        FulfillmentStatus = "shipped"
	FulfillmentCanceled       FulfillmentStatus = "canceled"
	FulfillmentRequiresAction FulfillmentStatus = "requires_action"
)

type GiftCard

type GiftCard struct {
	Code       string         `json:"code"`
	Value      int            `json:"value"`
	Balance    int            `json:"balance"`
	RegionId   string         `json:"region_id"`
	Id         string         `json:"id,omitempty"`
	Region     string         `json:"region,omitempty"`
	OrderId    string         `json:"order_id,omitempty"`
	Order      *Order         `json:"order,omitempty"`
	IsDisabled bool           `json:"is_disabled,omitempty"`
	EndsAt     *time.Time     `json:"ends_at,omitempty"`
	CreatedAt  *time.Time     `json:"created_at,omitempty"`
	UpdatedAt  *time.Time     `json:"updated_at,omitempty"`
	DeletedAt  *time.Time     `json:"deleted_at,omitempty"`
	Metadata   map[string]any `json:"metadata,omitempty"`
}

type Image

type Image struct {
	Url       string         `json:"url"`
	Id        string         `json:"id,omitempty"`
	CreatedAt string         `json:"created_at,omitempty"`
	UpdatedAt string         `json:"updated_at,omitempty"`
	DeletedAt string         `json:"deleted_at,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
}

type LineItem

type LineItem struct {
	Title             string          `json:"title,omitempty"`
	UnitPrice         bool            `json:"unit_price,omitempty"`
	Quantity          uint            `json:"quantity,omitempty"`
	Id                string          `json:"id,omitempty"`
	CartId            string          `json:"cart_id,omitempty"`
	Cart              *Cart           `json:"cart,omitempty"`
	OrderId           string          `json:"order_id,omitempty"`
	Order             *Order          `json:"order,omitempty"`
	SwapId            string          `json:"swap_id,omitempty"`
	Swap              *Swap           `json:"swap,omitempty"`
	ClaimOrderId      string          `json:"claim_order_id,omitempty"`
	ClaimOrder        any             `json:"claim_order,omitempty"`
	TaxLines          []any           `json:"tax_lines,omitempty"`
	Adjustments       []any           `json:"adjustments,omitempty"`
	Description       string          `json:"description,omitempty"`
	Thumbnail         string          `json:"thumbnail,omitempty"`
	IsReturn          bool            `json:"is_return,omitempty"`
	IsGiftcard        bool            `json:"is_giftcard,omitempty"`
	ShouldMerge       bool            `json:"should_merge,omitempty"`
	AllowDiscounts    bool            `json:"allow_discounts,omitempty"`
	HasShipping       bool            `json:"has_shipping,omitempty"`
	VariantId         string          `json:"variant_id,omitempty"`
	Variant           *ProductVariant `json:"variant,omitempty"`
	FulfilledQuantity uint            `json:"fulfilled_quantity,omitempty"`
	ReturnedQuantity  uint            `json:"returned_quantity,omitempty"`
	Shipped_quantity  uint            `json:"shipped_quantity,omitempty"`
	Refundable        uint            `json:"refundable,omitempty"`
	Subtotal          uint            `json:"subtotal,omitempty"`
	TaxTotal          uint            `json:"tax_total,omitempty"`
	Total             uint            `json:"total,omitempty"`
	OriginalTotal     uint            `json:"original_total,omitempty"`
	OriginalTaxTotal  uint            `json:"original_tax_total,omitempty"`
	DiscountTotal     uint            `json:"discount_total,omitempty"`
	GiftCardTotal     uint            `json:"gift_card_total,omitempty"`
	CreatedAt         *time.Time      `json:"created_at,omitempty"`
	DeletedAt         *time.Time      `json:"deleted_at,omitempty"`
	Metadata          map[string]any  `json:"metadata,omitempty"`
}

type Order

type Order struct {
	CustomerId           string     `json:"customer_id"`
	Email                string     `json:"email"`
	RegionId             string     `json:"region_id"`
	CurrencyCode         string     `json:"currency_code"`
	Id                   string     `json:"id,omitempty"`
	Status               string     `json:"status,omitempty"`
	FulfillmentStatus    string     `json:"fulfillment_status,omitempty"`
	PaymentStatus        string     `json:"payment_status,omitempty"`
	DisplayId            string     `json:"display_id,omitempty"`
	CartId               string     `json:"cart_id,omitempty"`
	Cart                 any        `json:"cart,omitempty"`
	Customer             any        `json:"customer,omitempty"`
	BillingAddressId     string     `json:"billing_address_id,omitempty"`
	BillingAddress       any        `json:"billing_address,omitempty"`
	ShippingAddressId    string     `json:"shipping_address_id,omitempty"`
	ShippingAddress      any        `json:"shipping_address"`
	Region               any        `json:"region,omitempty"`
	Currency             any        `json:"currency,omitempty"`
	Tax_rate             int        `json:"tax_rate,omitempty"`
	Discounts            []any      `json:"discounts,omitempty"`
	Gift_cards           any        `json:"gift_cards,omitempty"`
	Payments             []any      `json:"payments,omitempty"`
	Fulfillments         []any      `json:"fulfillments,omitempty"`
	Returns              []any      `json:"returns,omitempty"`
	Claims               []any      `json:"claims,omitempty"`
	Refunds              []any      `json:"refunds,omitempty"`
	Swaps                []any      `json:"swaps,omitempty"`
	DraftOrderId         string     `json:"draft_order_id,omitempty"`
	DraftOrder           any        `json:"draft_order,omitempty"`
	Items                []any      `json:"items,omitempty"`
	Edits                []any      `json:"edits,omitempty"`
	GiftCardTransactions []any      `json:"gift_card_transactions,omitempty"`
	CanceledAt           *time.Time `json:"canceled_at,omitempty"`
	NoNotification       bool       `json:"no_notification,omitempty"`
	IdempotencyKey       string     `json:"idempotency_key,omitempty"`
	ExternalId           string     `json:"external_id,omitempty"`
	SalesChannelId       string     `json:"sales_channel_id,omitempty"`
	SalesChannel         any        `json:"sales_channel,omitempty"`
	ShippingTotal        int        `json:"shipping_total,omitempty"`
	DiscountTotal        int        `json:"discount_total,omitempty"`
	TaxTotal             int        `json:"tax_total,omitempty"`
	RefundedTotal        int        `json:"refunded_total,omitempty"`
	Total                int        `json:"total,omitempty"`
	Subtotal             int        `json:"subtotal,omitempty"`
	PaidTotal            int        `json:"paid_total,omitempty"`
	RefundableAmount     int        `json:"refundable_amount,omitempty"`
	GiftCardTotal        int        `json:"gift_card_total,omitempty"`
	GiftCardTaxTotal     int        `json:"gift_card_tax_total,omitempty"`
}

type OrderEdit

type OrderEdit struct {
	// The ID of the order that is edited
	OrderId string `json:"order_id"`

	// Represents an order
	Order *Order `json:"order"`

	// Line item changes array.
	Changes []any `json:"changes"`

	// The unique identifier of the user or customer who created the order edit.
	CreatedBy string `json:"created_by"`

	// The order edit's ID
	Id string `json:"id,omitempty"`

	// An optional note with additional details about the order edit.
	InternalNote string `json:"internal_note,omitempty"`

	// The unique identifier of the user or customer who requested the order edit.
	RequestedBy string `json:"requested_by,omitempty"`

	// The date with timezone at which the edit was requested.
	RequestedAt *time.Time `json:"requested_at,omitempty"`

	// The unique identifier of the user or customer who confirmed the order edit
	ConfirmedBy string `json:"confirmed_by,omitempty"`

	// The date with timezone at which the edit was confirmed.
	ConfirmedAt *time.Time `json:"confirmed_at,omitempty"`

	// The date with timezone at which the edit was declined.
	DeclinedBy string `json:"declined_by,omitempty"`

	// An optional note why the order edit is declined.
	DeclinedAt *time.Time `json:"declined_at,omitempty"`

	// An optional note why the order edit is declined.
	DeclinedReason string `json:"declined_reason,omitempty"`

	// The total of subtotal
	Subtotal uint `json:"subtotal,omitempty"`

	// The total of discount
	DiscountTotal uint `json:"discount_total,omitempty"`

	// The total of the shipping amount
	ShippingTotal uint `json:"ShippingTotal,omitempty"`

	// The total of the gift card amount
	GiftCardTotal uint `json:"gift_card_total,omitempty"`

	// The total of the gift card tax amount
	GiftCardTaxTotal uint `json:"gift_card_tax_total,omitempty"`

	// The total of tax
	TaxTotal uint `json:"tax_total,omitempty"`

	// The total amount of the edited order.
	Total uint `json:"total,omitempty"`

	// The difference between the total amount of the order and total amount of edited order.
	DifferenceDue uint `json:"difference_due,omitempty"`

	// Computed line items from the changes.
	Items []any `json:"items,omitempty"`
}

type PaymentStatus

type PaymentStatus string
const (
	PaymentNotPaid            PaymentStatus = "not_paid"
	PaymentAwaiting           PaymentStatus = "awaiting"
	PaymentCaptured           PaymentStatus = "captured"
	PaymentConfirmed          PaymentStatus = "confirmed"
	PaymentCanceled           PaymentStatus = "canceled"
	PaymentDifferenceRefunded PaymentStatus = "difference_refunded"
	PaymentPartiallyRefunded  PaymentStatus = "partially_refunded"
	PaymentRefunded           PaymentStatus = "refunded"
	RPaymentequiresAction     PaymentStatus = "requires_action"
)

type Product

type Product struct {
	Title         string            `json:"title"`
	ProfileId     string            `json:"profile_id"`
	Id            string            `json:"id"`
	Subtitle      string            `json:"subtitle"`
	Description   string            `json:"description"`
	Handle        string            `json:"handle"`
	IsGiftcard    bool              `json:"is_giftcard"`
	Status        ProductStatus     `json:"status"`
	Images        []*Image          `json:"images"`
	Thumbnail     string            `json:"thumbnail"`
	Options       []*ProductOption  `json:"options"`
	Variants      []*ProductVariant `json:"variants"`
	Profile       *ShippingProfile  `json:"profile"`
	Weight        int               `json:"weight"`
	Height        int               `json:"height"`
	Width         int               `json:"width"`
	Length        int               `json:"length"`
	HsCode        string
	OriginCountry string         `json:"origin_country"`
	MidCode       string         `json:"mid_code"`
	Material      string         `json:"material"`
	CollectionId  string         `json:"collection_id"`
	Collection    *Collection    `json:"collection"`
	TypeId        string         `json:"type_id"`
	Type          *ProductType   `json:"type"`
	Tags          []*Tag         `json:"tags"`
	Discountable  bool           `json:"discountable"`
	ExternalId    string         `json:"external_id"`
	SalesChannels string         `json:"sales_channels"`
	CreatedAt     *time.Time     `json:"created_at"`
	UpdatedAt     *time.Time     `json:"updated_at"`
	DeletedAt     *time.Time     `json:"deleted_at"`
	Metadata      map[string]any `json:"metadata"`
}

type ProductOption

type ProductOption struct {
	Title     string         `json:"title"`
	ProductId string         `json:"product_id"`
	Id        string         `json:"id,omitempty"`
	Values    []any          `json:"values"`
	Product   *Product       `json:"product"`
	CreatedAt string         `json:"created_at,omitempty"`
	UpdatedAt string         `json:"updated_at,omitempty"`
	DeletedAt string         `json:"deleted_at,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
}

type ProductStatus

type ProductStatus string
const (
	Draft     ProductStatus = "draft"
	Proposed  ProductStatus = "proposed"
	Published ProductStatus = "published"
	Rejected  ProductStatus = "rejected"
)

type ProductType

type ProductType struct {
	Value     string         `json:"value"`
	Id        string         `json:"id"`
	CreatedAt string         `json:"created_at"`
	UpdatedAt string         `json:"updated_at"`
	DeletedAt string         `json:"deleted_at"`
	Metadata  map[string]any `json:"metadata"`
}

type ProductVariant

type ProductVariant struct {
	Title                  string         `json:"title"`
	ProductId              string         `json:"product_id"`
	InventoryQuantity      string         `json:"inventory_quantity"`
	Id                     string         `json:"id,omitempty"`
	Product                *Product       `json:"product,omitempty"`
	Prices                 []any          `json:"prices,omitempty"`
	Sku                    string         `json:"sku,omitempty"`
	Barcode                string         `json:"barcode,omitempty"`
	Ean                    string         `json:"ean,omitempty"`
	Upc                    string         `json:"upc,omitempty"`
	VariantRank            int            `json:"variant_rank,omitempty"`
	AllowBackorder         bool           `json:"allow_backorder,omitempty"`
	ManageInventory        bool           `json:"manage_inventory,omitempty"`
	HsCode                 string         `json:"hs_code,omitempty"`
	MidCode                string         `json:"mid_code,omitempty"`
	Material               string         `json:"material,omitempty"`
	Weight                 int            `json:"weight,omitempty"`
	Height                 int            `json:"height,omitempty"`
	Width                  int            `json:"width,omitempty"`
	Length                 int            `json:"length,omitempty"`
	Options                []any          `json:"options,omitempty"`
	CreatedAt              *time.Time     `json:"created_at,omitempty"`
	UpdatedAt              *time.Time     `json:"updated_at,omitempty"`
	DeletedAt              *time.Time     `json:"deleted_at,omitempty"`
	Metadata               map[string]any `json:"metadata,omitempty"`
	OriginalPrice          int            `json:"original_price,omitempty"`
	CalculatedPrice        int            `json:"calculated_price,omitempty"`
	OriginalPriceInclTax   int            `json:"original_price_incl_tax,omitempty"`
	CalculatedPriceInclTax int            `json:"calculated_price_incl_tax,omitempty"`
	OriginalTax            int            `json:"original_tax,omitempty"`
	CalculatedTax          int            `json:"calculated_tax,omitempty"`
	TaxRates               []any          `json:"tax_rates,omitempty"`
}

type Region

type Region struct {
	Name                 string         `json:"name"`
	CurrencyCode         string         `json:"currency_code"`
	TaxRate              int            `json:"tax_rate"`
	Id                   string         `json:"id"`
	Currency             any            `json:"currency"`
	TaxRates             []any          `json:"tax_rates"`
	TaxCode              string         `json:"tax_code"`
	GiftCardsTaxable     bool           `json:"gift_cards_taxable"`
	AutomaticTaxes       bool           `json:"automatic_taxes"`
	Countries            []any          `json:"countries"`
	TaxProviderId        string         `json:"tax_provider_id"`
	TaxProvider          any            `json:"tax_provider"`
	PaymentProviders     []any          `json:"payment_providers"`
	FulfillmentProviders []any          `json:"fulfillment_providers"`
	IncludesTax          string         `json:"includes_tax"`
	CreatedAt            *time.Time     `json:"created_at"`
	UpdatedAt            *time.Time     `json:"updated_at"`
	DeletedAt            *time.Time     `json:"deleted_at"`
	Metadata             map[string]any `json:"metadata"`
}

type Return

type Return struct {
	// The amount that should be refunded as a result of the return.
	RefundAmount int `json:"refund_amount"`

	// The return's ID
	Id string `json:"id"`

	// Status of the Return.
	Status ReturnStatusEnum `json:"status"`

	// The Return Items that will be shipped back to the warehouse. Available if the relation items is expanded.
	Items []any `json:"items"`

	// The ID of the Swap that the Return is a part of.
	SwapId string `json:"swap_id"`

	// A swap object. Available if the relation swap is expanded.
	Swap *Swap `json:"swap"`

	// The ID of the Order that the Return is made from.
	OrderId string `json:"order_id"`

	// An order object. Available if the relation order is expanded.
	Order *Order `json:"order"`

	// The ID of the Claim that the Return is a part of.
	ClaimOrderId string `json:"claim_order_id"`

	// A claim order object. Available if the relation claim_order is expanded.
	ClaimOrder any `json:"claim_order"`

	// The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation shipping_method is expanded.
	ShippingMethod any `json:"shipping_method"`

	// Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.
	ShippingData any `json:"shipping_data"`

	// When set to true, no notification will be sent related to this return.
	NoNotification bool `json:"no_notification"`

	// Randomly generated key used to continue the completion of the return in case of failure.
	IdempotencyKey string `json:"idempotency_key"`

	// The date with timezone at which the return was received.
	ReceivedAt *time.Time `json:"received_at"`

	// The date with timezone at which the resource was created.
	UpdatedAt *time.Time `json:"updated_at"`

	// The date with timezone at which the resource was updated.
	DeletedAt *time.Time `json:"deleted_at"`

	// An optional key-value map with additional details
	Metadata map[string]any `json:"metadata"`
}

type ReturnReason

type ReturnReason struct {
	// The value to identify the reason by.
	Value string `json:"value"`

	// A text that can be displayed to the Customer as a reason.
	Label string `json:"Label"`

	// The cart's ID
	Id string `json:"id"`

	// A description of the Reason.
	Description string `json:"description"`

	// The ID of the parent reason.
	ParentReturnReason *ReturnReason `json:"parent_return_reason"`

	ParentReturnReasonId string `json:"parent_return_reason_id"`

	ReturnReasonChildren *ReturnReason `json:"return_reason_children"`

	// The date with timezone at which the resource was created.
	CreatedAt *time.Time `json:"created_at"`

	// The date with timezone at which the resource was updated.
	UpdatedAt *time.Time `json:"updated_at"`

	// The date with timezone at which the resource was deleted.
	DeletedAt *time.Time `json:"deleted_at"`

	// An optional key-value map with additional details
	Metadata map[string]any `json:"metadata"`
}

type ReturnStatusEnum

type ReturnStatusEnum string
const (
	StatusRequested      ReturnStatusEnum = "requested"
	StatusReceived       ReturnStatusEnum = "received"
	StatusRequiresAction ReturnStatusEnum = "requires_action"
	StatusCanceled       ReturnStatusEnum = "canceled"
)

type ShippingOption

type ShippingOption struct {
	Name         string         `json:"name"`
	RegionId     string         `json:"region_id"`
	ProfileId    string         `json:"profile_id"`
	ProviderId   string         `json:"provider_id"`
	PriceType    string         `json:"price_type"`
	Id           string         `json:"id,omitempty"`
	Region       any            `json:"region,omitempty"`
	Profile      any            `json:"profile,omitempty"`
	Provider     any            `json:"provider,omitempty"`
	Amount       int            `json:"amount,omitempty"`
	IsReturn     bool           `json:"is_return,omitempty"`
	Requirements []any          `json:"requirements,omitempty"`
	Data         map[string]any `json:"data,omitempty"`
	IncludesTax  bool           `json:"includes_tax,omitempty"`
	CreatedAt    *time.Time     `json:"created_at,omitempty"`
	UpdatedAt    *time.Time     `json:"updated_at,omitempty"`
	DeletedAt    *time.Time     `json:"deleted_at,omitempty"`
	Metadata     map[string]any `json:"metadata,omitempty"`
}

type ShippingOptions

type ShippingOptions struct {
	CreatedAt string         `json:"created_at,omitempty"`
	UpdatedAt string         `json:"updated_at,omitempty"`
	DeletedAt string         `json:"deleted_at,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
}

type ShippingProfile

type ShippingProfile struct {
	Name            string         `json:"name"`
	Type            string         `json:"type"`
	Id              string         `json:"id"`
	Products        []*Product     `json:"products"`
	ShippingOptions any            `json:"shipping_options"`
	CreatedAt       string         `json:"created_at,omitempty"`
	UpdatedAt       string         `json:"updated_at,omitempty"`
	DeletedAt       string         `json:"deleted_at,omitempty"`
	Metadata        map[string]any `json:"metadata,omitempty"`
}

type Swap

type Swap struct {
	// The status of the Fulfillment of the Swap.
	FulfillmentStatus FulfillmentStatus `json:"fulfillment_status"`

	// The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.
	PaymentStatus PaymentStatus `json:"payment_status"`

	// The ID of the Order where the Line Items to be returned where purchased.
	OrderId string `json:"order_id"`

	// The swap's ID
	Id string `json:"id"`

	// An order object. Available if the relation order is expanded.
	Order *Order `json:"order"`

	// The new Line Items to ship to the Customer. Available if the relation additional_items is expanded.
	AdditionalItems []any `json:"additional_items"`

	// A return order object. The Return that is issued for the return part of the Swap. Available if the relation return_order is expanded.
	ReturnOrder any `json:"eturn_order"`

	// The Fulfillments used to send the new Line Items. Available if the relation fulfillments is expanded.
	Fulfillments []any `json:"fulfillments"`

	// Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded.
	Payment any `json:"payment"`

	// The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products.
	DifferenceDue int `json:"difference_due"`

	// The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order.
	ShippingaddressId string `json:"shipping_address_id"`

	// An address
	ShippingAddress *Address `json:"shipping_address"`

	// The Shipping Methods used to fulfill the additional items purchased. Available if the relation shipping_methods is expanded.
	ShippingMethods []any `json:"shipping_methods"`

	// The id of the Cart that the Customer will use to confirm the Swap.
	CartId string `json:"cart_id"`

	// A cart object. Available if the relation cart is expanded.
	Cart any `json:"cart"`

	// If true, swaps can be completed with items out of stock
	AllowBackorder bool `json:"allow_backorder"`

	// Randomly generated key used to continue the completion of the swap in case of failure.
	IdempotencyKey string `json:"idempotency_key"`

	// The date with timezone at which the Swap was confirmed by the Customer.
	ConfirmedAt *time.Time `json:"confirmed_at"`

	// The date with timezone at which the Swap was canceled
	CanceledAt *time.Time `json:"canceled_at"`

	// If set to true, no notification will be sent related to this swap
	NoNotification bool `json:"no_notification"`

	// The date with timezone at which the resource was created.
	CreatedAt *time.Time `json:"created_at"`

	// The date with timezone at which the resource was updated.
	UpdatedAt *time.Time `json:"updated_at"`

	// The date with timezone at which the resource was deleted.
	DeletedAt *time.Time `json:"deleted_at"`

	// An optional key-value map with additional details
	Metadata map[string]any `json:"metadata"`
}

type Tag

type Tag struct {
	Value     string         `json:"value"`
	Id        string         `json:"id"`
	CreatedAt string         `json:"created_at"`
	UpdatedAt string         `json:"updated_at"`
	DeletedAt string         `json:"deleted_at"`
	Metadata  map[string]any `json:"metadata"`
}

Jump to

Keyboard shortcuts

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