types

package
v0.0.0-...-9ed8f83 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const TempReorderRank = 99999

Variables

DiscountConditionMapTypeToProperty maps the discount condition type to its corresponding property.

Functions

This section is empty.

Types

type AcceptCustomer

type AcceptCustomer struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Password  string `json:"password"`
}

type AcceptInvite

type AcceptInvite struct {
	Token string          `json:"token"`
	User  *AcceptCustomer `json:"user"`
}

@oas:schema:AdminPostInvitesInviteAcceptReq type: object description: "The details of the invite to be accepted." required:

  • token
  • user

properties:

token:
  description: "The token of the invite to accept. This is a unique token generated when the invite was created or resent."
  type: string
user:
  description: "The details of the user to create."
  type: object
  required:
    - first_name
    - last_name
    - password
  properties:
    first_name:
      type: string
      description: the first name of the User
    last_name:
      type: string
      description: the last name of the User
    password:
      description: The password for the User
      type: string
      format: password

type AddOrderEditLineItemInput

type AddOrderEditLineItemInput struct {
	Quantity  int        `json:"quantity"`
	VariantId uuid.UUID  `json:"variant_id"`
	Metadata  core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrderEditsEditLineItemsReq type: object description: "The details of the line item change to create." required:

  • variant_id
  • quantity

properties:

variant_id:
  description: The ID of the product variant associated with the item.
  type: string
quantity:
  description: The quantity of the item.
  type: number
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type AddPriceListPrices

type AddPriceListPrices struct {
	Prices   []PriceListPriceCreateInput `json:"prices"`
	Override bool                        `json:"override,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostPriceListPricesPricesReq type: object description: "The details of the prices to add." properties:

prices:
  description: The prices to update or add.
  type: array
  items:
    type: object
    required:
      - amount
      - variant_id
    properties:
      id:
        description: The ID of the price.
        type: string
      region_id:
        description: The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided.
        type: string
      currency_code:
        description: The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided.
        type: string
        externalDocs:
          url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
          description: See a list of codes.
      variant_id:
        description: The ID of the Variant for which the price is used.
        type: string
      amount:
        description: The amount to charge for the Product Variant.
        type: integer
      min_quantity:
        description: The minimum quantity for which the price will be used.
        type: integer
      max_quantity:
        description: The maximum quantity for which the price will be used.
        type: integer
override:
  description: >-
    If set to `true`, the prices will replace all existing prices associated with the Price List.
  type: boolean

type AddPricesDTO

type AddPricesDTO struct {
	PriceSetId uuid.UUID         `json:"priceSetId uuid.UUID"`
	Prices     []CreatePricesDTO `json:"prices"`
}

type AddProductsToCollectionInput

type AddProductsToCollectionInput struct {
	ProductIds []uuid.UUID `json:"product_ids"`
}

@oas:schema:AdminPostProductsToCollectionReq type: object description: "The details of the products to add to the collection." required:

  • product_ids

properties:

product_ids:
  description: "An array of Product IDs to add to the Product Collection."
  type: array
  items:
    description: "The ID of a Product to add to the Product Collection."
    type: string

type AddResourcesToConditionBatch

type AddResourcesToConditionBatch struct {
	Resources []string `json:"resources"`
}

@oas:schema:AdminDeleteDiscountsDiscountConditionsConditionBatchReq type: object description: "The resources to remove." required:

  • resources

properties:

resources:
  description: The resources to be removed from the discount condition
  type: array
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: The id of the item
        type: string

type AddRule

type AddRule struct {
	Attribute string `json:"attribute"`
}

type AddRulesDTO

type AddRulesDTO struct {
	PriceSetId uuid.UUID `json:"priceSetId uuid.UUID"`
	Rules      []AddRule `json:"rules"`
}

type AddShippingMethod

type AddShippingMethod struct {
	OptionId uuid.UUID  `json:"option_id"`
	Data     core.JSONB `json:"data,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostCartsCartShippingMethodReq type: object description: "The details of the shipping method to add to the cart." required:

  • option_id

properties:

option_id:
  type: string
  description: ID of the shipping option to create the method from.
data:
  type: object
  description: Used to hold any data that the shipping method may need to process the fulfillment of the order. This depends on the fulfillment provider you're using.

type AddressCreatePayload

type AddressCreatePayload struct {
	FirstName   string     `json:"first_name"`
	LastName    string     `json:"last_name"`
	Phone       string     `json:"phone,omitempty" validate:"omitempty"`
	Metadata    core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	Company     string     `json:"company,omitempty" validate:"omitempty"`
	Address1    string     `json:"address_1"`
	Address2    string     `json:"address_2,omitempty" validate:"omitempty"`
	City        string     `json:"city"`
	CountryCode string     `json:"country_code"`
	Province    string     `json:"province,omitempty" validate:"omitempty"`
	PostalCode  string     `json:"postal_code"`
}

type AddressPayload

type AddressPayload struct {
	FirstName   string     `json:"first_name,omitempty" validate:"omitempty"`
	LastName    string     `json:"last_name,omitempty" validate:"omitempty"`
	Phone       string     `json:"phone,omitempty" validate:"omitempty"`
	Metadata    core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	Company     string     `json:"company,omitempty" validate:"omitempty"`
	Address1    string     `json:"address_1,omitempty" validate:"omitempty"`
	Address2    string     `json:"address_2,omitempty" validate:"omitempty"`
	City        string     `json:"city,omitempty" validate:"omitempty"`
	CountryCode string     `json:"country_code,omitempty" validate:"omitempty"`
	Province    string     `json:"province,omitempty" validate:"omitempty"`
	PostalCode  string     `json:"postal_code,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostCustomersCustomerAddressesAddressReq anyOf:

  • $ref: "#/components/schemas/AddressPayload"

type AdminGetDiscountsDiscountRule

type AdminGetDiscountsDiscountRule struct {
	Type       *models.DiscountRule   `json:"type,omitempty" validate:"omitempty"`
	Allocation *models.AllocationType `json:"allocation,omitempty" validate:"omitempty"`
}

type AdminListOrdersSelector

type AdminListOrdersSelector struct {
	Q                 string          `json:"q,omitempty" validate:"omitempty"`
	Id                uuid.UUID       `json:"id,omitempty" validate:"omitempty"`
	Status            []string        `json:"status,omitempty" validate:"omitempty,dive,oneof=OrderStatus"`
	FulfillmentStatus []string        `json:"fulfillment_status,omitempty" validate:"omitempty,dive,oneof=FulfillmentStatus"`
	PaymentStatus     []string        `json:"payment_status,omitempty" validate:"omitempty,dive,oneof=PaymentStatus"`
	DisplayId         uuid.UUID       `json:"display_id,omitempty" validate:"omitempty"`
	CartId            uuid.UUID       `json:"cart_id,omitempty" validate:"omitempty"`
	CustomerId        uuid.UUID       `json:"customer_id,omitempty" validate:"omitempty"`
	Email             string          `json:"email,omitempty" validate:"omitempty"`
	RegionId          uuid.UUIDs      `json:"region_id,omitempty" validate:"omitempty,dive,oneof=string"`
	CurrencyCode      string          `json:"currency_code,omitempty" validate:"omitempty"`
	TaxRate           string          `json:"tax_rate,omitempty" validate:"omitempty"`
	SalesChannelId    uuid.UUIDs      `json:"sales_channel_id,omitempty" validate:"omitempty"`
	CanceledAt        *core.TimeModel `json:"canceled_at,omitempty" validate:"omitempty"`
	CreatedAt         *core.TimeModel `json:"created_at,omitempty" validate:"omitempty"`
	UpdatedAt         *core.TimeModel `json:"updated_at,omitempty" validate:"omitempty"`
}

type AdminPriceListPricesCreateReq

type AdminPriceListPricesCreateReq struct {
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	Amount       float64   `json:"amount"`
	VariantId    uuid.UUID `json:"variant_id"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type AdminPriceListPricesUpdateReq

type AdminPriceListPricesUpdateReq struct {
	Id           uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	VariantId    uuid.UUID `json:"variant_id"`
	Amount       float64   `json:"amount"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type AdminPriceSelectionParams

type AdminPriceSelectionParams struct {
	PriceSelectionParams
	// Retrieve prices for a customer Id uuid.UUID.
	CustomerId uuid.UUID `json:"customer_id,omitempty" validate:"omitempty"`
}

The context to apply on retrieved prices by a user admin.

type AdminProductCategoriesReqBase

type AdminProductCategoriesReqBase struct {
	Description      string    `json:"description,omitempty" validate:"omitempty"`
	Handle           string    `json:"handle,omitempty" validate:"omitempty"`
	IsInternal       bool      `json:"is_internal,omitempty" validate:"omitempty"`
	IsActive         bool      `json:"is_active,omitempty" validate:"omitempty"`
	ParentCategoryId uuid.UUID `json:"parent_category_id,omitempty" validate:"omitempty"`
}

type AdminUpsertConditionsReq

type AdminUpsertConditionsReq struct {
	Products           []string `json:"products,omitempty" validate:"omitempty"`
	ProductCollections []string `json:"product_collections,omitempty" validate:"omitempty"`
	ProductTypes       []string `json:"product_types,omitempty" validate:"omitempty"`
	ProductTags        []string `json:"product_tags,omitempty" validate:"omitempty"`
	CustomerGroups     []string `json:"customer_groups,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostDiscountsDiscountConditionsCondition type: object properties:

products:
   type: array
   description: list of product IDs if the condition's type is `products`.
   items:
     type: string
product_types:
   type: array
   description: list of product type IDs if the condition's type is `product_types`.
   items:
     type: string
product_collections:
   type: array
   description: list of product collection IDs if the condition's type is `product_collections`.
   items:
     type: string
product_tags:
   type: array
   description: list of product tag IDs if the condition's type is `product_tags`
   items:
     type: string
customer_groups:
   type: array
   description: list of customer group IDs if the condition's type is `customer_groups`.
   items:
     type: string

type AuthenticateResult

type AuthenticateResult struct {
	Success  bool             `json:"success"`
	User     *models.User     `json:"user,omitempty" validate:"omitempty"`
	Customer *models.Customer `json:"customer,omitempty" validate:"omitempty"`
	Error    string           `json:"error,omitempty" validate:"omitempty"`
}

type BatchJobCreateProps

type BatchJobCreateProps struct {
	Context   core.JSONB `json:"context"`
	Type      string     `json:"type"`
	CreatedBy uuid.UUID  `json:"created_by"`
	DryRun    bool       `json:"dry_run"`
}

type BatchJobResultError

type BatchJobResultError struct {
	Message string                           `json:"message"`
	Code    *models.BatchJobResultErrorsCode `json:"code"`
}

type BatchJobResultStatDescriptor

type BatchJobResultStatDescriptor struct {
	Key     string `json:"key"`
	Name    string `json:"name"`
	Message string `json:"message"`
}

type BatchJobUpdateProps

type BatchJobUpdateProps struct {
	Context core.JSONB             `json:"context,omitempty" validate:"omitempty"`
	Result  *models.BatchJobResult `json:"result,omitempty" validate:"omitempty"`
}

type CalculatedPrice

type CalculatedPrice struct {
	MoneyAmountId uuid.UUID `json:"money_amount_id,omitempty" validate:"omitempty"`
	PriceListId   uuid.UUID `json:"price_list_id,omitempty" validate:"omitempty"`
	PriceListType string    `json:"price_list_type,omitempty" validate:"omitempty"`
	MinQuantity   int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity   int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type CalculatedPriceSet

type CalculatedPriceSet struct {
	Id                         uuid.UUID        `json:"id"`
	IsCalculatedPricePriceList bool             `json:"is_calculated_price_price_list,omitempty" validate:"omitempty"`
	CalculatedAmount           float64          `json:"calculated_amount,omitempty" validate:"omitempty"`
	IsOriginalPricePriceList   bool             `json:"is_original_price_price_list,omitempty" validate:"omitempty"`
	OriginalAmount             float64          `json:"original_amount,omitempty" validate:"omitempty"`
	CurrencyCode               string           `json:"currency_code,omitempty" validate:"omitempty"`
	CalculatedPrice            *CalculatedPrice `json:"calculated_price,omitempty" validate:"omitempty"`
	OriginalPrice              *OriginalPrice   `json:"original_price,omitempty" validate:"omitempty"`
}

type CalculatedPriceSetDTO

type CalculatedPriceSetDTO struct {
	Id            uuid.UUID `json:"id"`
	PriceSetId    uuid.UUID `json:"price_set_id"`
	Amount        string    `json:"amount,omitempty" validate:"omitempty"`
	CurrencyCode  string    `json:"currency_code,omitempty" validate:"omitempty"`
	MinQuantity   string    `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity   string    `json:"max_quantity,omitempty" validate:"omitempty"`
	PriceListType string    `json:"price_list_type,omitempty" validate:"omitempty"`
	PriceListId   uuid.UUID `json:"price_list_id,omitempty" validate:"omitempty"`
}

type CalculationContextData

type CalculationContextData struct {
	Discounts       []models.Discount       `json:"discounts,omitempty" validate:"omitempty"`
	Items           []models.LineItem       `json:"items,omitempty" validate:"omitempty"`
	Customer        *models.Customer        `json:"customer"`
	Region          *models.Region          `json:"region"`
	ShippingAddress *models.Address         `json:"shipping_address,omitempty" validate:"omitempty"`
	Swaps           []models.Swap           `json:"swaps,omitempty" validate:"omitempty"`
	Claims          []models.ClaimOrder     `json:"claims,omitempty" validate:"omitempty"`
	ShippingMethods []models.ShippingMethod `json:"shipping_methods,omitempty" validate:"omitempty"`
}

CalculationContextData represents the data required for performing calculations

type CartCreateProps

type CartCreateProps struct {
	RegionId          uuid.UUID        `json:"region_id,omitempty" validate:"omitempty"`
	Region            *models.Region   `json:"region,omitempty" validate:"omitempty"`
	Email             string           `json:"email,omitempty" validate:"omitempty"`
	BillingAddressId  uuid.UUID        `json:"billing_address_id,omitempty" validate:"omitempty"`
	BillingAddress    *AddressPayload  `json:"billing_address,omitempty" validate:"omitempty"`
	ShippingAddressId uuid.UUID        `json:"shipping_address_id,omitempty" validate:"omitempty"`
	ShippingAddress   *AddressPayload  `json:"shipping_address,omitempty" validate:"omitempty"`
	GiftCards         []GiftCard       `json:"gift_cards,omitempty" validate:"omitempty"`
	Discounts         []Discount       `json:"discounts,omitempty" validate:"omitempty"`
	Customer          *models.Customer `json:"customer,omitempty" validate:"omitempty"`
	CustomerId        uuid.UUID        `json:"customer_id,omitempty" validate:"omitempty"`
	Type              models.CartType  `json:"type,omitempty" validate:"omitempty"`
	Context           core.JSONB       `json:"context,omitempty" validate:"omitempty"`
	Metadata          core.JSONB       `json:"metadata,omitempty" validate:"omitempty"`
	SalesChannelId    uuid.UUID        `json:"sales_channel_id,omitempty" validate:"omitempty"`
	CountryCode       string           `json:"country_code,omitempty" validate:"omitempty"`
}

type CartUpdateProps

type CartUpdateProps struct {
	RegionId            uuid.UUID       `json:"region_id,omitempty" validate:"omitempty"`
	CountryCode         string          `json:"country_code,omitempty" validate:"omitempty"`
	Email               string          `json:"email,omitempty" validate:"omitempty"`
	ShippingAddressId   uuid.UUID       `json:"shipping_address_id,omitempty" validate:"omitempty"`
	BillingAddressId    uuid.UUID       `json:"billing_address_id,omitempty" validate:"omitempty"`
	BillingAddress      *AddressPayload `json:"billing_address,omitempty" validate:"omitempty"`
	ShippingAddress     *AddressPayload `json:"shipping_address,omitempty" validate:"omitempty"`
	CompletedAt         *time.Time      `json:"completed_at,omitempty" validate:"omitempty"`
	PaymentAuthorizedAt *time.Time      `json:"payment_authorized_at,omitempty" validate:"omitempty"`
	GiftCards           []GiftCard      `json:"gift_cards,omitempty" validate:"omitempty"`
	Discounts           []Discount      `json:"discounts,omitempty" validate:"omitempty"`
	CustomerId          uuid.UUID       `json:"customer_id,omitempty" validate:"omitempty"`
	Context             core.JSONB      `json:"context,omitempty" validate:"omitempty"`
	Metadata            core.JSONB      `json:"metadata,omitempty" validate:"omitempty"`
	SalesChannelId      uuid.UUID       `json:"sales_channel_id,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostCartsCartReq type: object description: "The details to update of the cart." properties:

region_id:
  type: string
  description: "The ID of the Region to create the Cart in. Setting the cart's region can affect the pricing of the items in the cart as well as the used currency."
country_code:
  type: string
  description: "The 2 character ISO country code to create the Cart in. Setting this parameter will set the country code of the shipping address."
  externalDocs:
    url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
    description: See a list of codes.
email:
  type: string
  description: "An email to be used on the Cart."
  format: email
sales_channel_id:
  type: string
  description: "The ID of the Sales channel to create the Cart in. The cart's sales channel affects which products can be added to the cart. If a product does not
   exist in the cart's sales channel, it cannot be added to the cart. If you add a publishable API key in the header of this request and specify a sales channel ID,
   the specified sales channel must be within the scope of the publishable API key's resources."
billing_address:
  description: "The Address to be used for billing purposes."
  anyOf:
    - $ref: "#/components/schemas/AddressPayload"
      description: A full billing address object.
    - type: string
      description: The billing address ID
shipping_address:
  description: "The Address to be used for shipping purposes."
  anyOf:
    - $ref: "#/components/schemas/AddressPayload"
      description: A full shipping address object.
    - type: string
      description: The shipping address ID
gift_cards:
  description: "An array of Gift Card codes to add to the Cart."
  type: array
  items:
    type: object
    required:
      - code
    properties:
      code:
        description: "The code of a gift card."
        type: string
discounts:
  description: "An array of Discount codes to add to the Cart."
  type: array
  items:
    type: object
    required:
      - code
    properties:
      code:
        description: "The code of the discount."
        type: string
customer_id:
  description: "The ID of the Customer to associate the Cart with."
  type: string
context:
  description: >-
    An object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent`
  type: object
  example:
    ip: "::1"
    user_agent: "Chrome"

type ClaimTypeValue

type ClaimTypeValue string

type CreateAnalyticsConfig

type CreateAnalyticsConfig struct {
	OptOut    bool `json:"opt_out"`
	Anonymize bool `json:"anonymize"`
}

type CreateAuth

type CreateAuth struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required"`
}

@oas:schema:PostAuthReq type: object description: The admin's credentials used to log in. required:

  • email
  • password

properties:

email:
  type: string
  description: The user's email.
  format: email
password:
  type: string
  description: The user's password.
  format: password

type CreateBatchJobInput

type CreateBatchJobInput struct {
	Type    string     `json:"type"`
	Context core.JSONB `json:"context,omitempty" validate:"omitempty"`
	DryRun  bool       `json:"dry_run"`
}

@oas:schema:AdminPostBatchesReq type: object description: The details of the batch job to create. required:

  • type
  • context

properties:

type:
  type: string
  description: >-
    The type of batch job to start, which is defined by the `batchType` property of the associated batch job strategy.
  example: product-export
context:
  type: object
  description: Additional infomration regarding the batch to be used for processing.
  example:
    shape:
      prices:
        - region: null
          currency_code: "eur"
      dynamicImageColumnCount: 4
      dynamicOptionColumnCount: 2
    list_config:
      skip: 0
      take: 50
      order:
        created_at: "DESC"
      relations:
        - variants
        - variant.prices
        - images
dry_run:
  type: boolean
  description: Set a batch job in dry_run mode, which would delay executing the batch job until it's confirmed.
  default: false

type CreateCart

type CreateCart struct {
	RegionId       uuid.UUID                            `json:"region_id,omitempty" validate:"omitempty,string"`
	CountryCode    string                               `json:"country_code,omitempty" validate:"omitempty,string"`
	Items          []CreateClaimItemAdditionalItemInput `json:"items,omitempty" validate:"omitempty,dive"`
	Context        core.JSONB                           `json:"context,omitempty" validate:"omitempty"`
	SalesChannelId uuid.UUID                            `json:"sales_channel_id,omitempty" validate:"omitempty,string"`
}

@oas:schema:StorePostCartReq type: object description: "The details of the cart to be created." properties:

region_id:
  type: string
  description: "The ID of the Region to create the Cart in. Setting the cart's region can affect the pricing of the items in the cart as well as the used currency.
   If this parameter is not provided, the first region in the store is used by default."
sales_channel_id:
  type: string
  description: "The ID of the Sales channel to create the Cart in. The cart's sales channel affects which products can be added to the cart. If a product does not
   exist in the cart's sales channel, it cannot be added to the cart. If you add a publishable API key in the header of this request and specify a sales channel ID,
   the specified sales channel must be within the scope of the publishable API key's resources. If you add a publishable API key in the header of this request,
   you don't specify a sales channel ID, and the publishable API key is associated with one sales channel, that sales channel will be attached to the cart.
   If no sales channel is passed and no publishable API key header is passed or the publishable API key isn't associated with any sales channel,
   the cart will not be associated with any sales channel."
country_code:
  type: string
  description: "The two character ISO country code to create the Cart in. Setting this parameter will set the country code of the shipping address."
  externalDocs:
   url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
   description: See a list of codes.
items:
  description: "An array of product variants to generate line items from."
  type: array
  items:
    type: object
    required:
      - variant_id
      - quantity
    properties:
      variant_id:
        description: The ID of the Product Variant.
        type: string
      quantity:
        description: The quantity to add into the cart.
        type: integer
context:
  description: >-
    An object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent`
  type: object
  example:
    ip: "::1"
    user_agent: "Chrome"

type CreateClaimInput

type CreateClaimInput struct {
	Type              models.ClaimStatus                   `json:"type"`
	ClaimItems        []CreateClaimItemInput               `json:"claim_items"`
	ReturnShipping    *CreateClaimReturnShippingInput      `json:"return_shipping,omitempty" validate:"omitempty"`
	AdditionalItems   []CreateClaimItemAdditionalItemInput `json:"additional_items,omitempty" validate:"omitempty"`
	ShippingMethods   []CreateClaimShippingMethodInput     `json:"shipping_methods,omitempty" validate:"omitempty"`
	RefundAmount      float64                              `json:"refund_amount,omitempty" validate:"omitempty"`
	ShippingAddress   *AddressPayload                      `json:"shipping_address,omitempty" validate:"omitempty"`
	NoNotification    bool                                 `json:"no_notification,omitempty" validate:"omitempty"`
	Metadata          core.JSONB                           `json:"metadata,omitempty" validate:"omitempty"`
	Order             *models.Order                        `json:"order"`
	ClaimOrderId      uuid.UUID                            `json:"claim_order_id,omitempty" validate:"omitempty"`
	ShippingAddressId uuid.UUID                            `json:"shipping_address_id,omitempty" validate:"omitempty"`
	ReturnLocationId  uuid.UUID                            `json:"return_location_id,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderClaimsReq type: object description: "The details of the claim to be created." required:

  • type
  • claim_items

properties:

type:
  description: >-
    The type of the Claim. This will determine how the Claim is treated: `replace` Claims will result in a Fulfillment with new items being created, while a `refund` Claim will refund the amount paid for the claimed items.
  type: string
  enum:
    - replace
    - refund
claim_items:
  description: The Claim Items that the Claim will consist of.
  type: array
  items:
    type: object
    required:
      - item_id
      - quantity
    properties:
      item_id:
        description: The ID of the Line Item that will be claimed.
        type: string
      quantity:
        description: The number of items that will be returned
        type: integer
      note:
        description: Short text describing the Claim Item in further detail.
        type: string
      reason:
        description: The reason for the Claim
        type: string
        enum:
          - missing_item
          - wrong_item
          - production_failure
          - other
      tags:
        description: A list of tags to add to the Claim Item
        type: array
        items:
          type: string
      images:
        description: A list of image URL's that will be associated with the Claim
        items:
          type: string
return_shipping:
   description: Optional details for the Return Shipping Method, if the items are to be sent back. Providing this field will result in a return being created and associated with the claim.
   type: object
   properties:
     option_id:
       type: string
       description: The ID of the Shipping Option to create the Shipping Method from.
     price:
       type: integer
       description: The price to charge for the Shipping Method.
additional_items:
   description: The new items to send to the Customer. This is only used if the claim's type is `replace`.
   type: array
   items:
     type: object
     required:
       - variant_id
       - quantity
     properties:
       variant_id:
         description: The ID of the Product Variant.
         type: string
       quantity:
         description: The quantity of the Product Variant.
         type: integer
shipping_methods:
   description: The Shipping Methods to send the additional Line Items with. This is only used if the claim's type is `replace`.
   type: array
   items:
      type: object
      properties:
        id:
          description: The ID of an existing Shipping Method
          type: string
        option_id:
          description: The ID of the Shipping Option to create a Shipping Method from
          type: string
        price:
          description: The price to charge for the Shipping Method
          type: integer
        data:
          description: An optional set of key-value pairs to hold additional information.
          type: object
shipping_address:
   description: "An optional shipping address to send the claimed items to. If not provided, the parent order's shipping address will be used."
   $ref: "#/components/schemas/AddressPayload"
refund_amount:
   description: The amount to refund the customer. This is used when the claim's type is `refund`.
   type: integer
no_notification:
   description: If set to true no notification will be send related to this Claim.
   type: boolean
return_location_id:
   description: The ID of the location used for the associated return.
   type: string
metadata:
   description: An optional set of key-value pairs to hold additional information.
   type: object
   externalDocs:
     description: "Learn about the metadata attribute, and how to delete and update it."
     url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateClaimItemAdditionalItemInput

type CreateClaimItemAdditionalItemInput struct {
	VariantId uuid.UUID `json:"variant_id"`
	Quantity  int       `json:"quantity"`
}

type CreateClaimItemInput

type CreateClaimItemInput struct {
	ItemId       uuid.UUID              `json:"item_id"`
	Quantity     int                    `json:"quantity"`
	ClaimOrderId uuid.UUID              `json:"claim_order_id"`
	Reason       models.ClaimReasonType `json:"reason"`
	Note         string                 `json:"note,omitempty" validate:"omitempty"`
	Tags         []string               `json:"tags,omitempty" validate:"omitempty"`
	Images       []string               `json:"images,omitempty" validate:"omitempty"`
}

type CreateClaimReturnShippingInput

type CreateClaimReturnShippingInput struct {
	OptionId uuid.UUID `json:"option_id,omitempty" validate:"omitempty"`
	Price    float64   `json:"price,omitempty" validate:"omitempty"`
}

type CreateClaimShippingMethodInput

type CreateClaimShippingMethodInput struct {
	Id       uuid.UUID  `json:"id,omitempty" validate:"omitempty"`
	OptionId uuid.UUID  `json:"option_id,omitempty" validate:"omitempty"`
	Price    float64    `json:"price,omitempty" validate:"omitempty"`
	Data     core.JSONB `json:"data,omitempty" validate:"omitempty"`
}

type CreateConditon

type CreateConditon struct {
	Operator models.DiscountConditionOperator `json:"operator"`
}

@oas:schema:AdminPostDiscountsDiscountConditions type: object required:

  • operator

properties:

operator:
   description: >-
     Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that
     discountable resources are everything but the specified resources.
   type: string
   enum: [in, not_in]
products:
   type: array
   description: list of product IDs if the condition's type is `products`.
   items:
     type: string
product_types:
   type: array
   description: list of product type IDs if the condition's type is `product_types`.
   items:
     type: string
product_collections:
   type: array
   description: list of product collection IDs if the condition's type is `product_collections`.
   items:
     type: string
product_tags:
   type: array
   description: list of product tag IDs if the condition's type is `product_tags`.
   items:
     type: string
customer_groups:
   type: array
   description: list of customer group IDs if the condition's type is `customer_groups`.
   items:
     type: string

type CreateCustomShippingOptionInput

type CreateCustomShippingOptionInput struct {
	Price            float64    `json:"price,omitempty" validate:"omitempty"`
	ShippingOptionId uuid.UUID  `json:"shipping_option_id,omitempty" validate:"omitempty"`
	CartId           uuid.UUID  `json:"cart_id,omitempty" validate:"omitempty"`
	Metadata         core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

type CreateCustomerGroup

type CreateCustomerGroup struct {
	Name     string     `json:"name,omitempty" validate:"omitempty"`
	Metadata core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostCustomerGroupsReq type: object description: "The details of the customer group to create." required:

  • name

properties:

name:
  type: string
  description: Name of the customer group
metadata:
  type: object
  description: Metadata of the customer group.
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateCustomerInput

type CreateCustomerInput struct {
	Email        string     `json:"email"`
	Password     string     `json:"password,omitempty" validate:"omitempty"`
	PasswordHash string     `json:"password_hash,omitempty" validate:"omitempty"`
	HasAccount   bool       `json:"has_account,omitempty" validate:"omitempty"`
	FirstName    string     `json:"first_name,omitempty" validate:"omitempty"`
	LastName     string     `json:"last_name,omitempty" validate:"omitempty"`
	Phone        string     `json:"phone,omitempty" validate:"omitempty"`
	Metadata     core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:PostCustomersReq type: object description: "The details of the customer to create." required:

  • email
  • first_name
  • last_name
  • password

properties:

email:
  type: string
  description: The customer's email.
  format: email
first_name:
  type: string
  description: The customer's first name.
last_name:
  type: string
  description: The customer's last name.
password:
  type: string
  description: The customer's password.
  format: password
phone:
  type: string
  description: The customer's phone number.
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateDiscountInput

type CreateDiscountInput struct {
	Code          string                  `json:"code"`
	Rule          CreateDiscountRuleInput `json:"rule"`
	IsDynamic     bool                    `json:"is_dynamic"`
	IsDisabled    bool                    `json:"is_disabled"`
	StartsAt      *time.Time              `json:"starts_at,omitempty" validate:"omitempty"`
	EndsAt        *time.Time              `json:"ends_at,omitempty" validate:"omitempty"`
	ValidDuration *time.Time              `json:"valid_duration,omitempty" validate:"omitempty"`
	UsageLimit    int                     `json:"usage_limit,omitempty" validate:"omitempty"`
	Regions       uuid.UUIDs              `json:"regions,omitempty" validate:"omitempty"`
	Metadata      core.JSONB              `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostDiscountsReq type: object description: "The details of the discount to create." required:

  • code
  • rule
  • regions

properties:

code:
  type: string
  description: A unique code that will be used to redeem the discount
is_dynamic:
  type: boolean
  description: Whether the discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated discount codes that all have to follow a common set of rules.
  default: false
rule:
  description: The discount rule that defines how discounts are calculated
  type: object
  required:
     - type
     - value
     - allocation
  properties:
    description:
      type: string
      description: "A short description of the discount"
    type:
      type: string
      description: >-
        The type of the discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers.
      enum: [fixed, percentage, free_shipping]
    value:
      type: number
      description: "The value that the discount represents. This will depend on the type of the discount."
    allocation:
      type: string
      description: >-
        The scope that the discount should apply to. `total` indicates that the discount should be applied on the cart total, and `item` indicates that the discount should be applied to each discountable item in the cart.
      enum: [total, item]
    conditions:
      type: array
      description: "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided based on the discount condition's type."
      items:
        type: object
        required:
           - operator
        properties:
          operator:
            type: string
            description: >-
              Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that
              discountable resources are everything but the specified resources.
            enum: [in, not_in]
          products:
            type: array
            description: list of product IDs if the condition's type is `products`.
            items:
              type: string
          product_types:
            type: array
            description: list of product type IDs if the condition's type is `product_types`.
            items:
              type: string
          product_collections:
            type: array
            description: list of product collection IDs if the condition's type is `product_collections`.
            items:
              type: string
          product_tags:
            type: array
            description: list of product tag IDs if the condition's type is `product_tags`.
            items:
              type: string
          customer_groups:
            type: array
            description: list of customer group IDs if the condition's type is `customer_groups`.
            items:
              type: string
is_disabled:
  type: boolean
  description: >-
    Whether the discount code is disabled on creation. If set to `true`, it will not be available for customers.
  default: false
starts_at:
  type: string
  format: date-time
  description: The date and time at which the discount should be available.
ends_at:
  type: string
  format: date-time
  description: The date and time at which the discount should no longer be available.
valid_duration:
  type: string
  description: The duration the discount runs between
  example: P3Y6M4DT12H30M5S
regions:
  description: A list of region IDs representing the Regions in which the Discount can be used.
  type: array
  items:
    type: string
usage_limit:
  type: number
  description: Maximum number of times the discount can be used
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateDiscountRuleInput

type CreateDiscountRuleInput struct {
	Description string                   `json:"description,omitempty" validate:"omitempty"`
	Type        models.DiscountRuleType  `json:"type"`
	Value       float64                  `json:"value"`
	Allocation  models.AllocationType    `json:"allocation"`
	Conditions  []DiscountConditionInput `json:"conditions,omitempty" validate:"omitempty"`
}

CreateDiscountRuleInput represents the input for creating a discount rule.

type CreateDynamicDiscountInput

type CreateDynamicDiscountInput struct {
	Code       string     `json:"code"`
	EndsAt     *time.Time `json:"ends_at,omitempty" validate:"omitempty"`
	UsageLimit int        `json:"usage_limit"`
	Metadata   core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostDiscountsDiscountDynamicCodesReq type: object description: "The details of the dynamic discount to create." required:

  • code

properties:

code:
  type: string
  description: A unique code that will be used to redeem the Discount
usage_limit:
  type: number
  description: Maximum number of times the discount code can be used
  default: 1
metadata:
  type: object
  description: An optional set of key-value pairs to hold additional information.
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateFulfillmentOrder

type CreateFulfillmentOrder struct {
	*models.ClaimOrder
	IsClaim         bool                    `json:"is_claim,omitempty" validate:"omitempty"`
	Email           string                  `json:"email,omitempty" validate:"omitempty"`
	Payments        []models.Payment        `json:"payments"`
	Discounts       []models.Discount       `json:"discounts"`
	CurrencyCode    string                  `json:"currency_code"`
	TaxRate         float64                 `json:"tax_rate,omitempty" validate:"omitempty"`
	RegionId        uuid.UUID               `json:"region_id"`
	Region          *models.Region          `json:"region,omitempty" validate:"omitempty"`
	IsSwap          bool                    `json:"is_swap,omitempty" validate:"omitempty"`
	DisplayId       int                     `json:"display_id"`
	BillingAddress  *models.Address         `json:"billing_address"`
	Items           []models.LineItem       `json:"items"`
	ShippingMethods []models.ShippingMethod `json:"shipping_methods"`
	NoNotification  bool                    `json:"no_notification"`
}

type CreateGiftCardInput

type CreateGiftCardInput struct {
	OrderId    uuid.UUID  `json:"order_id,omitempty" validate:"omitempty"`
	Value      float64    `json:"value,omitempty" validate:"omitempty"`
	Balance    float64    `json:"balance,omitempty" validate:"omitempty"`
	EndsAt     *time.Time `json:"ends_at,omitempty" validate:"omitempty"`
	IsDisabled bool       `json:"is_disabled,omitempty" validate:"omitempty"`
	RegionId   uuid.UUID  `json:"region_id"`
	Metadata   core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	TaxRate    float64    `json:"tax_rate,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostGiftCardsReq type: object description: "The details of the gift card to create." required:

  • region_id

properties:

value:
  type: integer
  description: The value (excluding VAT) that the Gift Card should represent.
is_disabled:
  type: boolean
  description: >-
    Whether the Gift Card is disabled on creation. If set to `true`, the gift card will not be available for customers.
ends_at:
  type: string
  format: date-time
  description: The date and time at which the Gift Card should no longer be available.
region_id:
  description: The ID of the Region in which the Gift Card can be used.
  type: string
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateGiftCardTransactionInput

type CreateGiftCardTransactionInput struct {
	GiftCardId uuid.UUID `json:"gift_card_id"`
	OrderId    uuid.UUID `json:"order_id"`
	Amount     float64   `json:"amount"`
	CreatedAt  time.Time `json:"created_at,omitempty" validate:"omitempty"`
	IsTaxable  bool      `json:"is_taxable,omitempty" validate:"omitempty"`
	TaxRate    float64   `json:"tax_rate,omitempty" validate:"omitempty"`
}

type CreateIdempotencyKeyInput

type CreateIdempotencyKeyInput struct {
	RequestMethod  string     `json:"request_method,omitempty"`
	RequestParams  core.JSONB `json:"request_params,omitempty"`
	RequestPath    string     `json:"request_path,omitempty"`
	IdempotencyKey string     `json:"idempotency_key,omitempty"`
}

type CreateInviteInput

type CreateInviteInput struct {
	Email string          `json:"email"`
	Role  models.UserRole `json:"role"`
}

@oas:schema:AdminPostInvitesReq type: object required:

  • user
  • role

properties:

user:
  description: "The email associated with the invite. Once the invite is accepted, the email will be associated with the created user."
  type: string
  format: email
role:
  description: "The role of the user to be created. This does not actually change the privileges of the user that is eventually created."
  type: string
  enum: [admin, member, developer]

type CreateNoteInput

type CreateNoteInput struct {
	Value        string       `json:"value"`
	ResourceType string       `json:"resource_type"`
	ResourceId   uuid.UUID    `json:"resource_id"`
	AuthorId     uuid.UUID    `json:"author_id,omitempty" validate:"omitempty"`
	Author       *models.User `json:"author,omitempty" validate:"omitempty"`
	Metadata     core.JSONB   `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostNotesReq type: object description: "The details of the note to be created." required:

  • resource_id
  • resource_type
  • value

properties:

resource_id:
  type: string
  description: The ID of the resource which the Note relates to. For example, an order ID.
resource_type:
  type: string
  description: The type of resource which the Note relates to. For example, `order`.
value:
  type: string
  description: The content of the Note to create.

type CreateOauthInput

type CreateOauthInput struct {
	DisplayName     string `json:"display_name"`
	ApplicationName string `json:"application_name"`
	InstallURL      string `json:"install_url,omitempty" validate:"omitempty"`
	UninstallURL    string `json:"uninstall_url,omitempty" validate:"omitempty"`
}

type CreateOrderEditInput

type CreateOrderEditInput struct {
	OrderId      uuid.UUID `json:"order_id"`
	InternalNote string    `json:"internal_note,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrderEditsReq type: object description: "The details of the order edit to create." required:

  • order_id

properties:

order_id:
  description: The ID of the order to create the edit for.
  type: string
internal_note:
  description: An optional note to associate with the order edit.
  type: string

type CreateOrderEditItemChangeInput

type CreateOrderEditItemChangeInput struct {
	Type               models.OrderEditItemChangeType `json:"type"`
	OrderEditId        uuid.UUID                      `json:"order_edit_id"`
	OriginalLineItemId uuid.UUID                      `json:"original_line_item_id,omitempty" validate:"omitempty"`
	LineItemId         uuid.UUID                      `json:"line_item_id,omitempty" validate:"omitempty"`
}

type CreateOrderInput

type CreateOrderInput struct {
	Status          *models.OrderStatus   `json:"status,omitempty" validate:"omitempty"`
	Email           string                `json:"email"`
	BillingAddress  *AddressPayload       `json:"billing_address"`
	ShippingAddress *AddressPayload       `json:"shipping_address"`
	Items           []models.LineItem     `json:"items"`
	Region          string                `json:"region"`
	Discounts       []models.Discount     `json:"discounts,omitempty" validate:"omitempty"`
	CustomerId      uuid.UUID             `json:"customer_id"`
	PaymentMethod   *PaymentMethod        `json:"payment_method"`
	ShippingMethod  []ShippingMethodOrder `json:"shipping_method,omitempty" validate:"omitempty"`
	NoNotification  bool                  `json:"no_notification,omitempty" validate:"omitempty"`
}

type CreateOrderShipment

type CreateOrderShipment struct {
	FulfillmentId   uuid.UUID `json:"fulfillment_id"`
	TrackingNumbers []string  `json:"tracking_numbers,omitempty" validate:"omitempty"`
	NoNotification  bool      `json:"no_notification,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderShipmentReq type: object description: "The details of the shipment to create." required:

  • fulfillment_id

properties:

fulfillment_id:
  description: The ID of the Fulfillment.
  type: string
tracking_numbers:
  description: The tracking numbers for the shipment.
  type: array
  items:
    type: string
no_notification:
  description: If set to true no notification will be send related to this Shipment.
  type: boolean

type CreatePaymentCollectionInput

type CreatePaymentCollectionInput struct {
	RegionId     uuid.UUID                    `json:"region_id"`
	Type         models.PaymentCollectionType `json:"type"`
	CurrencyCode string                       `json:"currency_code"`
	Amount       float64                      `json:"amount"`
	CreatedBy    uuid.UUID                    `json:"created_by"`
	Metadata     core.JSONB                   `json:"metadata,omitempty" validate:"omitempty"`
	Description  string                       `json:"description,omitempty" validate:"omitempty"`
}

type CreatePaymentInput

type CreatePaymentInput struct {
	CartId         uuid.UUID              `json:"cart_id,omitempty" validate:"omitempty"`
	Amount         float64                `json:"amount"`
	CurrencyCode   string                 `json:"currency_code"`
	ProviderId     uuid.UUID              `json:"provider_id,omitempty" validate:"omitempty"`
	PaymentSession *models.PaymentSession `json:"payment_session"`
	ResourceId     uuid.UUID              `json:"resource_id,omitempty" validate:"omitempty"`
}

type CreatePriceListInput

type CreatePriceListInput struct {
	Name           string                      `json:"name"`
	Description    string                      `json:"description"`
	Type           models.PriceListType        `json:"type"`
	Status         models.PriceListStatus      `json:"status,omitempty" validate:"omitempty"`
	Prices         []PriceListPriceCreateInput `json:"prices"`
	CustomerGroups []CustomerGroups            `json:"customer_groups,omitempty" validate:"omitempty"`
	StartsAt       *time.Time                  `json:"starts_at,omitempty" validate:"omitempty"`
	EndsAt         *time.Time                  `json:"ends_at,omitempty" validate:"omitempty"`
	IncludesTax    bool                        `json:"includes_tax,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostPriceListsPriceListReq type: object description: "The details of the price list to create." required:

  • name
  • description
  • type
  • prices

properties:

name:
  description: "The name of the Price List."
  type: string
description:
  description: "The description of the Price List."
  type: string
starts_at:
  description: "The date with timezone that the Price List starts being valid."
  type: string
  format: date
ends_at:
  description: "The date with timezone that the Price List ends being valid."
  type: string
  format: date
type:
  description: The type of the Price List.
  type: string
  enum:
   - sale
   - override
status:
  description: >-
    The status of the Price List. If the status is set to `draft`, the prices created in the price list will not be available of the customer.
  type: string
  enum:
    - active
    - draft
prices:
   description: The prices of the Price List.
   type: array
   items:
     type: object
     required:
       - amount
       - variant_id
     properties:
       region_id:
         description: The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided.
         type: string
       currency_code:
         description: The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided.
         type: string
         externalDocs:
           url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
           description: See a list of codes.
       amount:
         description: The amount to charge for the Product Variant.
         type: integer
       variant_id:
         description: The ID of the Variant for which the price is used.
         type: string
       min_quantity:
         description: The minimum quantity for which the price will be used.
         type: integer
       max_quantity:
         description: The maximum quantity for which the price will be used.
         type: integer
customer_groups:
  type: array
  description: An array of customer groups that the Price List applies to.
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: The ID of a customer group
        type: string
includes_tax:
   description: "Tax included in prices of price list"
   x-featureFlag: "tax_inclusive_pricing"
   type: boolean

type CreatePriceSetDTO

type CreatePriceSetDTO struct {
	Rules  []CreateRule      `json:"rules,omitempty" validate:"omitempty"`
	Prices []CreatePricesDTO `json:"prices,omitempty" validate:"omitempty"`
}

type CreatePricesDTO

type CreatePricesDTO struct {
	*models.MoneyAmount
	Rules map[string]string `json:"rules"`
}

type CreateProductCategoryInput

type CreateProductCategoryInput struct {
	ProductCategoryInput
	Name string `json:"name"`
}

@oas:schema:AdminPostProductCategoriesReq type: object description: "The details of the product category to create." required:

  • name

properties:

name:
  type: string
  description: The name of the product category
description:
  type: string
  description: The description of the product category.
handle:
  type: string
  description: The handle of the product category. If none is provided, the kebab-case version of the name will be used. This field can be used as a slug in URLs.
is_internal:
  type: boolean
  description: >-
    If set to `true`, the product category will only be available to admins.
is_active:
  type: boolean
  description: >-
    If set to `false`, the product category will not be available in the storefront.
parent_category_id:
  type: string
  description: The ID of the parent product category
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateProductCollection

type CreateProductCollection struct {
	Title    string     `json:"title"`
	Handle   string     `json:"handle,omitempty" validate:"omitempty"`
	Metadata core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostCollectionsReq type: object description: The product collection's details. required:

  • title

properties:

title:
  type: string
  description: The title of the collection.
handle:
  type: string
  description: An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used.
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateProductInput

type CreateProductInput struct {
	Title         string                                  `json:"title"`
	Subtitle      string                                  `json:"subtitle,omitempty" validate:"omitempty"`
	ProfileId     uuid.UUID                               `json:"profile_id,omitempty" validate:"omitempty"`
	Description   string                                  `json:"description,omitempty" validate:"omitempty"`
	IsGiftcard    bool                                    `json:"is_giftcard,omitempty" validate:"omitempty"`
	Discountable  bool                                    `json:"discountable,omitempty" validate:"omitempty"`
	Images        []string                                `json:"images,omitempty" validate:"omitempty"`
	Thumbnail     string                                  `json:"thumbnail,omitempty" validate:"omitempty"`
	Handle        string                                  `json:"handle,omitempty" validate:"omitempty"`
	Status        models.ProductStatus                    `json:"status,omitempty" validate:"omitempty"`
	Type          *CreateProductProductTypeInput          `json:"type,omitempty" validate:"omitempty"`
	CollectionId  uuid.UUID                               `json:"collection_id,omitempty" validate:"omitempty"`
	Tags          []CreateProductProductTagInput          `json:"tags,omitempty" validate:"omitempty"`
	Options       []CreateProductProductOption            `json:"options,omitempty" validate:"omitempty"`
	Variants      []CreateProductVariantInput             `json:"variants,omitempty" validate:"omitempty"`
	SalesChannels []CreateProductProductSalesChannelInput `json:"sales_channels,omitempty" validate:"omitempty"`
	Categories    []CreateProductProductCategoryInput     `json:"categories,omitempty" validate:"omitempty"`
	Weight        int                                     `json:"weight,omitempty" validate:"omitempty"`
	Length        int                                     `json:"length,omitempty" validate:"omitempty"`
	Height        int                                     `json:"height,omitempty" validate:"omitempty"`
	Width         int                                     `json:"width,omitempty" validate:"omitempty"`
	HSCode        string                                  `json:"hs_code,omitempty" validate:"omitempty"`
	OriginCountry string                                  `json:"origin_country,omitempty" validate:"omitempty"`
	MIdCode       uuid.UUID                               `json:"mid_code,omitempty" validate:"omitempty"`
	Material      string                                  `json:"material,omitempty" validate:"omitempty"`
	Metadata      core.JSONB                              `json:"metadata,omitempty" validate:"omitempty"`
	ExternalId    uuid.UUID                               `json:"external_id,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostProductsReq type: object description: "The details of the product to create." required:

  • title

properties:

title:
  description: "The title of the Product"
  type: string
subtitle:
  description: "The subtitle of the Product"
  type: string
description:
  description: "The description of the Product."
  type: string
is_giftcard:
  description: A flag to indicate if the Product represents a Gift Card. Purchasing Products with this flag set to `true` will result in a Gift Card being created.
  type: boolean
  default: false
discountable:
  description: A flag to indicate if discounts can be applied to the Line Items generated from this Product
  type: boolean
  default: true
images:
  description: An array of images of the Product. Each value in the array is a URL to the image. You can use the upload API Routes to upload the image and obtain a URL.
  type: array
  items:
    type: string
thumbnail:
  description: The thumbnail to use for the Product. The value is a URL to the thumbnail. You can use the upload API Routes to upload the thumbnail and obtain a URL.
  type: string
handle:
  description: A unique handle to identify the Product by. If not provided, the kebab-case version of the product title will be used. This can be used as a slug in URLs.
  type: string
status:
  description: The status of the product. The product is shown to the customer only if its status is `published`.
  type: string
  enum: [draft, proposed, published, rejected]
  default: draft
type:
  description: The Product Type to associate the Product with.
  type: object
  required:
    - value
  properties:
    id:
      description: The ID of an existing Product Type. If not provided, a new product type will be created.
      type: string
    value:
      description: The value of the Product Type.
      type: string
collection_id:
  description: The ID of the Product Collection the Product belongs to.
  type: string
tags:
  description: Product Tags to associate the Product with.
  type: array
  items:
    type: object
    required:
      - value
    properties:
      id:
        description: The ID of an existing Product Tag. If not provided, a new product tag will be created.
        type: string
      value:
        description: The value of the Tag. If the `id` is provided, the value of the existing tag will be updated.
        type: string
sales_channels:
  description: "Sales channels to associate the Product with."
  type: array
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: The ID of an existing Sales channel.
        type: string
categories:
  description: "Product categories to add the Product to."
  x-featureFlag: "product_categories"
  type: array
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: The ID of a Product Category.
        type: string
options:
  description: The Options that the Product should have. A new product option will be created for every item in the array.
  type: array
  items:
    type: object
    required:
      - title
    properties:
      title:
        description: The title of the Product Option.
        type: string
variants:
  description: An array of Product Variants to create with the Product. Each product variant must have a unique combination of Product Option values.
  type: array
  items:
    type: object
    required:
      - title
    properties:
      title:
        description: The title of the Product Variant.
        type: string
      sku:
        description: The unique SKU of the Product Variant.
        type: string
      ean:
        description: The EAN number of the item.
        type: string
      upc:
        description: The UPC number of the item.
        type: string
      barcode:
        description: A generic GTIN field of the Product Variant.
        type: string
      hs_code:
        description: The Harmonized System code of the Product Variant.
        type: string
      inventory_quantity:
        description: The amount of stock kept of the Product Variant.
        type: integer
        default: 0
      allow_backorder:
        description: Whether the Product Variant can be purchased when out of stock.
        type: boolean
      manage_inventory:
        description: Whether Medusa should keep track of the inventory of this Product Variant.
        type: boolean
      weight:
        description: The wieght of the Product Variant.
        type: number
      length:
        description: The length of the Product Variant.
        type: number
      height:
        description: The height of the Product Variant.
        type: number
      width:
        description: The width of the Product Variant.
        type: number
      origin_country:
        description: The country of origin of the Product Variant.
        type: string
      mid_code:
        description: The Manufacturer Identification code of the Product Variant.
        type: string
      material:
        description: The material composition of the Product Variant.
        type: string
      metadata:
        description: An optional set of key-value pairs with additional information.
        type: object
        externalDocs:
          description: "Learn about the metadata attribute, and how to delete and update it."
          url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
      prices:
        type: array
        description: An array of product variant prices. A product variant can have different prices for each region or currency code.
        externalDocs:
          url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices
          description: Product variant pricing.
        items:
          type: object
          required:
            - amount
          properties:
            region_id:
              description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided.
              type: string
            currency_code:
              description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided.
              type: string
              externalDocs:
                url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
                description: See a list of codes.
            amount:
              description: The price amount.
              type: integer
            min_quantity:
              description: The minimum quantity required to be added to the cart for the price to be used.
              type: integer
            max_quantity:
              description: The maximum quantity required to be added to the cart for the price to be used.
              type: integer
      options:
        type: array
        description: An array of Product Option values that the variant corresponds to. The option values should be added into the array in the same index as in the `options` field of the product.
        externalDocs:
          url: https://docs.medusajs.com/modules/products/admin/manage-products#create-a-product
          description: Example of how to create a product with options and variants
        items:
          type: object
          required:
            - value
          properties:
            value:
              description: The value to give for the Product Option at the same index in the Product's `options` field.
              type: string
weight:
  description: The weight of the Product.
  type: number
length:
  description: The length of the Product.
  type: number
height:
  description: The height of the Product.
  type: number
width:
  description: The width of the Product.
  type: number
hs_code:
  description: The Harmonized System code of the Product.
  type: string
origin_country:
  description: The country of origin of the Product.
  type: string
mid_code:
  description: The Manufacturer Identification code of the Product.
  type: string
material:
  description: The material composition of the Product.
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateProductProductCategoryInput

type CreateProductProductCategoryInput struct {
	Id uuid.UUID `json:"id"`
}

type CreateProductProductOption

type CreateProductProductOption struct {
	Title string `json:"title"`
}

@oas:schema:AdminPostProductsProductOptionsReq type: object description: "The details of the product option to create." required:

  • title

properties:

title:
  description: "The title the Product Option."
  type: string
  example: "Size"

type CreateProductProductSalesChannelInput

type CreateProductProductSalesChannelInput struct {
	Id uuid.UUID `json:"id"`
}

type CreateProductProductTagInput

type CreateProductProductTagInput struct {
	Id    uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	Value string    `json:"value"`
}

type CreateProductProductTypeInput

type CreateProductProductTypeInput struct {
	Id    uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	Value string    `json:"value"`
}

type CreateProductProductVariantInput

type CreateProductProductVariantInput struct {
	Title             string                                  `json:"title"`
	SKU               string                                  `json:"sku,omitempty" validate:"omitempty"`
	EAN               string                                  `json:"ean,omitempty" validate:"omitempty"`
	UPC               string                                  `json:"upc,omitempty" validate:"omitempty"`
	Barcode           string                                  `json:"barcode,omitempty" validate:"omitempty"`
	HSCode            string                                  `json:"hs_code,omitempty" validate:"omitempty"`
	InventoryQuantity int                                     `json:"inventory_quantity,omitempty" validate:"omitempty"`
	AllowBackorder    bool                                    `json:"allow_backorder,omitempty" validate:"omitempty"`
	ManageInventory   bool                                    `json:"manage_inventory,omitempty" validate:"omitempty"`
	Weight            int                                     `json:"weight,omitempty" validate:"omitempty"`
	Length            int                                     `json:"length,omitempty" validate:"omitempty"`
	Height            int                                     `json:"height,omitempty" validate:"omitempty"`
	Width             int                                     `json:"width,omitempty" validate:"omitempty"`
	OriginCountry     string                                  `json:"origin_country,omitempty" validate:"omitempty"`
	MIdCode           uuid.UUID                               `json:"mid_code,omitempty" validate:"omitempty"`
	Material          string                                  `json:"material,omitempty" validate:"omitempty"`
	Metadata          core.JSONB                              `json:"metadata,omitempty" validate:"omitempty"`
	Prices            []CreateProductProductVariantPriceInput `json:"prices,omitempty" validate:"omitempty"`
	Options           []ProductVariantOption                  `json:"options,omitempty" validate:"omitempty"`
}

type CreateProductProductVariantPriceInput

type CreateProductProductVariantPriceInput struct {
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	Amount       float64   `json:"amount"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type CreateProductVariantInput

type CreateProductVariantInput struct {
	Title             string                 `json:"title,omitempty" validate:"omitempty"`
	ProductId         uuid.UUID              `json:"product_id,omitempty" validate:"omitempty"`
	SKU               string                 `json:"sku,omitempty" validate:"omitempty"`
	Barcode           string                 `json:"barcode,omitempty" validate:"omitempty"`
	EAN               string                 `json:"ean,omitempty" validate:"omitempty"`
	UPC               string                 `json:"upc,omitempty" validate:"omitempty"`
	VariantRank       int                    `json:"variant_rank,omitempty" validate:"omitempty"`
	InventoryQuantity int                    `json:"inventory_quantity,omitempty" validate:"omitempty"`
	AllowBackorder    bool                   `json:"allow_backorder,omitempty" validate:"omitempty"`
	ManageInventory   bool                   `json:"manage_inventory,omitempty" validate:"omitempty"`
	HSCode            string                 `json:"hs_code,omitempty" validate:"omitempty"`
	OriginCountry     string                 `json:"origin_country,omitempty" validate:"omitempty"`
	MIdCode           string                 `json:"mid_code,omitempty" validate:"omitempty"`
	Material          string                 `json:"material,omitempty" validate:"omitempty"`
	Weight            float64                `json:"weight,omitempty" validate:"omitempty"`
	Length            float64                `json:"length,omitempty" validate:"omitempty"`
	Height            float64                `json:"height,omitempty" validate:"omitempty"`
	Width             float64                `json:"width,omitempty" validate:"omitempty"`
	Options           []ProductVariantOption `json:"options"`
	Prices            []ProductVariantPrice  `json:"prices"`
	Metadata          core.JSONB             `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostProductsProductVariantsReq type: object description: "The details of the product variant to create." required:

  • title
  • prices
  • options

properties:

title:
  description: The title of the product variant.
  type: string
sku:
  description: The unique SKU of the product variant.
  type: string
ean:
  description: The EAN number of the product variant.
  type: string
upc:
  description: The UPC number of the product variant.
  type: string
barcode:
  description: A generic GTIN field of the product variant.
  type: string
hs_code:
  description: The Harmonized System code of the product variant.
  type: string
inventory_quantity:
  description: The amount of stock kept of the product variant.
  type: integer
  default: 0
allow_backorder:
  description: Whether the product variant can be purchased when out of stock.
  type: boolean
manage_inventory:
  description: Whether Medusa should keep track of the inventory of this product variant.
  type: boolean
  default: true
weight:
  description: The wieght of the product variant.
  type: number
length:
  description: The length of the product variant.
  type: number
height:
  description: The height of the product variant.
  type: number
width:
  description: The width of the product variant.
  type: number
origin_country:
  description: The country of origin of the product variant.
  type: string
mid_code:
  description: The Manufacturer Identification code of the product variant.
  type: string
material:
  description: The material composition of the product variant.
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
prices:
  type: array
  description: An array of product variant prices. A product variant can have different prices for each region or currency code.
  externalDocs:
    url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices
    description: Product variant pricing.
  items:
    type: object
    required:
      - amount
    properties:
      region_id:
        description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided.
        type: string
      currency_code:
        description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided.
        type: string
        externalDocs:
          url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
          description: See a list of codes.
      amount:
        description: The price amount.
        type: integer
      min_quantity:
       description: The minimum quantity required to be added to the cart for the price to be used.
       type: integer
      max_quantity:
        description: The maximum quantity required to be added to the cart for the price to be used.
        type: integer
options:
  type: array
  description: An array of Product Option values that the variant corresponds to.
  items:
    type: object
    required:
      - option_id
      - value
    properties:
      option_id:
        description: The ID of the Product Option.
        type: string
      value:
        description: A value to give to the Product Option.
        type: string

type CreatePublishableApiKeyInput

type CreatePublishableApiKeyInput struct {
	Title string `json:"title"`
}

@oas:schema:AdminPostPublishableApiKeysReq type: object description: "The details of the publishable API key to create." required:

  • title

properties:

title:
  description: The title of the publishable API key
  type: string

type CreateRegionInput

type CreateRegionInput struct {
	Name                 string     `json:"name"`
	CurrencyCode         string     `json:"currency_code"`
	TaxCode              string     `json:"tax_code,omitempty" validate:"omitempty"`
	TaxRate              float64    `json:"tax_rate"`
	PaymentProviders     uuid.UUIDs `json:"payment_providers"`
	FulfillmentProviders uuid.UUIDs `json:"fulfillment_providers"`
	Countries            []string   `json:"countries"`
	IncludesTax          bool       `json:"includes_tax,omitempty" validate:"omitempty"`
	Metadata             core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostRegionsReq type: object description: "The details of the region to create." required:

  • name
  • currency_code
  • tax_rate
  • payment_providers
  • fulfillment_providers
  • countries

properties:

name:
  description: "The name of the Region"
  type: string
currency_code:
  description: "The 3 character ISO currency code to use in the Region."
  type: string
  externalDocs:
    url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
    description: See a list of codes.
tax_code:
  description: "The tax code of the Region."
  type: string
tax_rate:
  description: "The tax rate to use in the Region."
  type: number
payment_providers:
  description: "A list of Payment Provider IDs that can be used in the Region"
  type: array
  items:
    type: string
fulfillment_providers:
  description: "A list of Fulfillment Provider IDs that can be used in the Region"
  type: array
  items:
    type: string
countries:
  description: "A list of countries' 2 ISO characters that should be included in the Region."
  example: ["US"]
  type: array
  items:
    type: string
includes_tax:
  x-featureFlag: "tax_inclusive_pricing"
  description: "Whether taxes are included in the prices of the region."
  type: boolean

type CreateReturn

type CreateReturn struct {
	OrderId        uuid.UUID             `json:"order_id"`
	Items          []OrderReturnItem     `json:"items,omitempty" validate:"omitempty"`
	ReturnShipping *ReturnShippingMethod `json:"return_shipping,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostReturnsReq type: object description: "The details of the return to create." required:

  • order_id
  • items

properties:

order_id:
  type: string
  description: The ID of the Order to create the return for.
items:
  description: "The items to include in the return."
  type: array
  items:
    type: object
    required:
      - item_id
      - quantity
    properties:
      item_id:
        description: The ID of the line item to return.
        type: string
      quantity:
        description: The quantity to return.
        type: integer
      reason_id:
        description: The ID of the return reason. Return reasons can be retrieved from the List Return Reasons API Route.
        type: string
      note:
        description: A note to add to the item returned.
        type: string
return_shipping:
  description: The return shipping method used to return the items. If provided, a fulfillment is automatically created for the return.
  type: object
  required:
    - option_id
  properties:
    option_id:
      type: string
      description: The ID of the Shipping Option to create the Shipping Method from.

type CreateReturnInput

type CreateReturnInput struct {
	OrderId        uuid.UUID                       `json:"order_id"`
	SwapId         uuid.UUID                       `json:"swap_id,omitempty" validate:"omitempty"`
	ClaimOrderId   uuid.UUID                       `json:"claim_order_id,omitempty" validate:"omitempty"`
	Items          []OrderReturnItem               `json:"items,omitempty" validate:"omitempty"`
	ShippingMethod *CreateClaimReturnShippingInput `json:"shipping_method,omitempty" validate:"omitempty"`
	NoNotification bool                            `json:"no_notification,omitempty" validate:"omitempty"`
	Metadata       core.JSONB                      `json:"metadata,omitempty" validate:"omitempty"`
	RefundAmount   float64                         `json:"refund_amount,omitempty" validate:"omitempty"`
	LocationId     uuid.UUID                       `json:"location_id,omitempty" validate:"omitempty"`
}

type CreateReturnReason

type CreateReturnReason struct {
	Value                string     `json:"value"`
	Label                string     `json:"label"`
	ParentReturnReasonId uuid.UUID  `json:"parent_return_reason_id,omitempty" validate:"omitempty"`
	Description          string     `json:"description,omitempty" validate:"omitempty"`
	Metadata             core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostReturnReasonsReq type: object description: "The details of the return reason to create." required:

  • label
  • value

properties:

label:
  description: "The label to display to the Customer."
  type: string
value:
  description: "A unique value of the return reason."
  type: string
parent_return_reason_id:
  description: "The ID of the parent return reason."
  type: string
description:
  description: "The description of the Reason."
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateRule

type CreateRule struct {
	RuleAttribute string `json:"rule_attribute"`
}

type CreateRuleTypeDTO

type CreateRuleTypeDTO struct {
	Id              uuid.UUID
	Name            string
	RuleAttribute   string
	DefaultPriority int
}

type CreateSalesChannelInput

type CreateSalesChannelInput struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty" validate:"omitempty"`
	IsDisabled  bool   `json:"is_disabled,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostSalesChannelsReq type: object description: "The details of the sales channel to create." required:

  • name

properties:

name:
  description: The name of the Sales Channel
  type: string
description:
  description: The description of the Sales Channel
  type: string
is_disabled:
  description: Whether the Sales Channel is disabled.
  type: boolean

type CreateShipmentConfig

type CreateShipmentConfig struct {
	Metadata       core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	NoNotification bool       `json:"no_notification,omitempty" validate:"omitempty"`
	LocationId     uuid.UUID  `json:"location_id,omitempty" validate:"omitempty"`
}

type CreateShippingMethod

type CreateShippingMethod struct {
	Data             core.JSONB `json:"data,omitempty" validate:"omitempty"`
	ShippingOptionId uuid.UUID  `json:"shipping_option_id,omitempty" validate:"omitempty"`
	Price            float64    `json:"price,omitempty" validate:"omitempty"`
	ReturnId         uuid.UUID  `json:"return_id,omitempty" validate:"omitempty"`
	SwapId           uuid.UUID  `json:"swap_id,omitempty" validate:"omitempty"`
	CartId           uuid.UUID  `json:"cart_id,omitempty" validate:"omitempty"`
	OrderId          uuid.UUID  `json:"order_id,omitempty" validate:"omitempty"`
	DraftOrderId     uuid.UUID  `json:"draft_order_id,omitempty" validate:"omitempty"`
	ClaimOrderId     uuid.UUID  `json:"claim_order_id,omitempty" validate:"omitempty"`
}

type CreateShippingMethodDto

type CreateShippingMethodDto struct {
	CreateShippingMethod
	Cart  *models.Cart  `json:"cart,omitempty" validate:"omitempty"`
	Order *models.Order `json:"order,omitempty" validate:"omitempty"`
}

type CreateShippingOptionInput

type CreateShippingOptionInput struct {
	PriceType    models.ShippingOptionPriceType `json:"price_type"`
	Name         string                         `json:"name"`
	RegionId     uuid.UUID                      `json:"region_id"`
	ProfileId    uuid.UUID                      `json:"profile_id"`
	ProviderId   uuid.UUID                      `json:"provider_id"`
	Data         core.JSONB                     `json:"data"`
	IncludesTax  bool                           `json:"includes_tax,omitempty" validate:"omitempty"`
	Amount       float64                        `json:"amount,omitempty" validate:"omitempty"`
	AdminOnly    bool                           `json:"admin_only,omitempty" validate:"omitempty"`
	IsReturn     bool                           `json:"is_return,omitempty" validate:"omitempty"`
	Metadata     core.JSONB                     `json:"metadata,omitempty" validate:"omitempty"`
	Requirements []RequirementInput             `json:"requirements,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostShippingOptionsReq type: object description: "The details of the shipping option to create." required:

  • name
  • region_id
  • provider_id
  • data
  • price_type

properties:

name:
  description: "The name of the Shipping Option"
  type: string
region_id:
  description: "The ID of the Region in which the Shipping Option will be available."
  type: string
provider_id:
  description: "The ID of the Fulfillment Provider that handles the Shipping Option."
  type: string
profile_id:
  description: "The ID of the Shipping Profile to add the Shipping Option to."
  type: number
data:
  description: "The data needed for the Fulfillment Provider to handle shipping with this Shipping Option."
  type: object
price_type:
  description: >-
    The type of the Shipping Option price. `flat_rate` indicates fixed pricing, whereas `calculated` indicates that the price will be calculated each time by the fulfillment provider.
  type: string
  enum:
    - flat_rate
    - calculated
amount:
  description: >-
    The amount to charge for the Shipping Option. If the `price_type` is set to `calculated`, this amount will not actually be used.
  type: integer
requirements:
  description: "The requirements that must be satisfied for the Shipping Option to be available."
  type: array
  items:
    type: object
    required:
      - type
      - amount
    properties:
      type:
        description: The type of the requirement
        type: string
        enum:
          - max_subtotal
          - min_subtotal
      amount:
        description: The amount to compare with.
        type: integer
is_return:
  description: Whether the Shipping Option can be used for returns or during checkout.
  type: boolean
  default: false
admin_only:
  description: >-
    If set to `true`, the shipping option can only be used when creating draft orders.
  type: boolean
  default: false
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
includes_tax:
  description: "Tax included in prices of shipping option"
  x-featureFlag: "tax_inclusive_pricing"
  type: boolean

type CreateShippingProfile

type CreateShippingProfile struct {
	Name     string                     `json:"name"`
	Type     models.ShippingProfileType `json:"type"`
	Metadata core.JSONB                 `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostShippingProfilesReq type: object description: "The details of the shipping profile to create." required:

  • name
  • type

properties:

name:
  description: The name of the Shipping Profile
  type: string
type:
  description: The type of the Shipping Profile
  type: string
  enum: [default, gift_card, custom]
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type CreateSwap

type CreateSwap struct {
	OrderId              uuid.UUID                            `json:"order_id" validate:"required"`
	ReturnItems          []OrderReturnItem                    `json:"return_items" validate:"dive"`
	AdditionalItems      []CreateClaimItemAdditionalItemInput `json:"additional_items" validate:"dive"`
	ReturnShippingOption uuid.UUID                            `json:"return_shipping_option,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostSwapsReq type: object description: "The details of the swap to create." required:

  • order_id
  • return_items
  • additional_items

properties:

order_id:
  type: string
  description: The ID of the Order to create the Swap for.
return_items:
  description: "The items to include in the Return."
  type: array
  items:
    type: object
    required:
      - item_id
      - quantity
    properties:
      item_id:
        description: The ID of the order's line item to return.
        type: string
      quantity:
        description: The quantity to return.
        type: integer
      reason_id:
        description: The ID of the reason of this return. Return reasons can be retrieved from the List Return Reasons API Route.
        type: string
      note:
        description: The note to add to the item being swapped.
        type: string
return_shipping_option:
  type: string
  description: The ID of the Shipping Option to create the Shipping Method from.
additional_items:
  description: "The items to exchange the returned items with."
  type: array
  items:
    type: object
    required:
      - variant_id
      - quantity
    properties:
      variant_id:
        description: The ID of the Product Variant.
        type: string
      quantity:
        description: The quantity of the variant.
        type: integer

type CreateTaxRateInput

type CreateTaxRateInput struct {
	RegionId uuid.UUID `json:"region_id"`
	Code     string    `json:"code"`
	Name     string    `json:"name"`
	Rate     float64   `json:"rate,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostTaxRatesReq type: object description: "The details of the tax rate to create." required:

  • code
  • name
  • region_id

properties:

code:
  type: string
  description: "The code of the tax rate."
name:
  type: string
  description: "The name of the tax rate."
region_id:
  type: string
  description: "The ID of the Region that the tax rate belongs to."
rate:
  type: number
  description: "The numeric rate to charge."
products:
  type: array
  description: "The IDs of the products associated with this tax rate."
  items:
    type: string
shipping_options:
  type: array
  description: "The IDs of the shipping options associated with this tax rate"
  items:
    type: string
product_types:
  type: array
  description: "The IDs of the types of products associated with this tax rate"
  items:
    type: string

type CreateUserInput

type CreateUserInput struct {
	Id        uuid.UUID       `json:"id,omitempty" validate:"omitempty"`
	Email     string          `json:"email"`
	FirstName string          `json:"first_name,omitempty" validate:"omitempty"`
	LastName  string          `json:"last_name,omitempty" validate:"omitempty"`
	APIToken  string          `json:"api_token,omitempty" validate:"omitempty"`
	Password  string          `json:"password,omitempty" validate:"omitempty"`
	Role      models.UserRole `json:"role,omitempty" validate:"omitempty"`
	Metadata  core.JSONB      `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminCreateUserRequest type: object required:

  • email
  • password

properties:

email:
  description: "The User's email."
  type: string
  format: email
first_name:
  description: "The first name of the User."
  type: string
last_name:
  description: "The last name of the User."
  type: string
role:
  description: "The role assigned to the user. These roles don't provide any different privileges."
  type: string
  enum: [admin, member, developer]
password:
  description: "The User's password."
  type: string
  format: password

type CustomerAcceptClaim

type CustomerAcceptClaim struct {
	Token string `json:"token"`
}

@oas:schema:StorePostCustomersCustomerAcceptClaimReq type: object description: "The details necessary to grant order access." required:

  • token

properties:

token:
  description: "The claim token generated by previous request to the Claim Order API Route."
  type: string

type CustomerAddAddress

type CustomerAddAddress struct {
	Address *AddressCreatePayload `json:"address"`
}

@oas:schema:StorePostCustomersCustomerAddressesReq type: object required:

  • address

properties:

address:
  description: "The Address to add to the Customer's saved addresses."
  $ref: "#/components/schemas/AddressCreatePayload"

type CustomerGroups

type CustomerGroups struct {
	Id uuid.UUID `json:"id"`
}

type CustomerGroupsBatchCustomer

type CustomerGroupsBatchCustomer struct {
	Id uuid.UUID `json:"id"`
}

type CustomerOrderClaim

type CustomerOrderClaim struct {
	OrderIds uuid.UUIDs `json:"order_ids"`
}

@oas:schema:StorePostCustomersCustomerOrderClaimReq type: object description: "The details of the orders to claim." required:

  • order_ids

properties:

order_ids:
  description: "The ID of the orders to claim"
  type: array
  items:
   type: string

type CustomersToCustomerGroup

type CustomersToCustomerGroup struct {
	CustomerIds []uuid.UUID `json:"customer_ids"`
}

@oas:schema:AdminPostCustomerGroupsGroupCustomersBatchReq type: object description: "The customers to add to the customer group." required:

  • customer_ids

properties:

customer_ids:
  description: "The ids of the customers to add"
  type: array
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: ID of the customer
        type: string

type DeletePriceListPrices

type DeletePriceListPrices struct {
	PriceIds uuid.UUIDs `json:"price_ids"`
}

@oas:schema:AdminDeletePriceListPricesPricesReq type: object description: "The details of the prices to delete." properties:

price_ids:
  description: The IDs of the prices to delete.
  type: array
  items:
    type: string

type DeletePriceListPricesBatch

type DeletePriceListPricesBatch struct {
	ProductIds uuid.UUIDs `json:"product_ids"`
}

@oas:schema:AdminDeletePriceListsPriceListProductsPricesBatchReq type: object description: "The details of the products' prices to delete." properties:

product_ids:
  description: The IDs of the products to delete their associated prices.
  type: array
  items:
    type: string

type Discount

type Discount struct {
	Code string `json:"code"`
}

type DiscountAllocation

type DiscountAllocation struct {
	Amount     float64 `json:"amount,omitempty" validate:"omitempty"`
	UnitAmount float64 `json:"unit_amount,omitempty" validate:"omitempty"`
}

DiscountAllocation represents the amount of a discount allocated to a line item

type DiscountConditionInput

type DiscountConditionInput struct {
	RuleId             uuid.UUID                        `json:"rule_id,omitempty" validate:"omitempty"`
	Id                 uuid.UUID                        `json:"id,omitempty" validate:"omitempty"`
	Operator           models.DiscountConditionOperator `json:"operator,omitempty" validate:"omitempty"`
	Products           []string                         `json:"products,omitempty" validate:"omitempty"`
	ProductCollections []string                         `json:"product_collections,omitempty" validate:"omitempty"`
	ProductTypes       []string                         `json:"product_types,omitempty" validate:"omitempty"`
	ProductTags        []string                         `json:"product_tags,omitempty" validate:"omitempty"`
	CustomerGroups     []string                         `json:"customer_groups,omitempty" validate:"omitempty"`
}

DiscountConditionInput represents the input for a discount condition.

type DraftOrderCreate

type DraftOrderCreate struct {
	Status              string           `json:"status,omitempty" validate:"omitempty"`
	Email               string           `json:"email"`
	BillingAddressId    uuid.UUID        `json:"billing_address_id,omitempty" validate:"omitempty"`
	BillingAddress      *AddressPayload  `json:"billing_address,omitempty" validate:"omitempty"`
	ShippingAddressId   uuid.UUID        `json:"shipping_address_id,omitempty" validate:"omitempty"`
	ShippingAddress     *AddressPayload  `json:"shipping_address,omitempty" validate:"omitempty"`
	Items               []Item           `json:"items,omitempty" validate:"omitempty"`
	RegionId            uuid.UUID        `json:"region_id"`
	Discounts           []Discount       `json:"discounts,omitempty" validate:"omitempty"`
	CustomerId          uuid.UUID        `json:"customer_id,omitempty" validate:"omitempty"`
	NoNotificationOrder bool             `json:"no_notification_order,omitempty" validate:"omitempty"`
	ShippingMethods     []ShippingMethod `json:"shipping_methods"`
	Metadata            core.JSONB       `json:"metadata,omitempty" validate:"omitempty"`
	IdempotencyKey      string           `json:"idempotency_key,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostDraftOrdersReq type: object description: "The details of the draft order to create." required:

  • email
  • region_id
  • shipping_methods

properties:

status:
  description: >-
    The status of the draft order. The draft order's default status is `open`. It's changed to `completed` when its payment is marked as paid.
  type: string
  enum: [open, completed]
email:
  description: "The email of the customer of the draft order"
  type: string
  format: email
billing_address:
  description: "The Address to be used for billing purposes."
  anyOf:
    - $ref: "#/components/schemas/AddressPayload"
    - type: string
shipping_address:
  description: "The Address to be used for shipping purposes."
  anyOf:
    - $ref: "#/components/schemas/AddressPayload"
    - type: string
items:
  description: The draft order's line items.
  type: array
  items:
    type: object
    required:
      - quantity
    properties:
      variant_id:
        description: The ID of the Product Variant associated with the line item. If the line item is custom, the `variant_id` should be omitted.
        type: string
      unit_price:
        description: The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price.
        type: integer
      title:
        description: The title of the line item if `variant_id` is not provided.
        type: string
      quantity:
        description: The quantity of the line item.
        type: integer
      metadata:
        description: The optional key-value map with additional details about the line item.
        type: object
        externalDocs:
          description: "Learn about the metadata attribute, and how to delete and update it."
          url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
region_id:
  description: The ID of the region for the draft order
  type: string
discounts:
  description: The discounts to add to the draft order
  type: array
  items:
    type: object
    required:
      - code
    properties:
      code:
        description: The code of the discount to apply
        type: string
customer_id:
  description: The ID of the customer this draft order is associated with.
  type: string
no_notification_order:
  description: An optional flag passed to the resulting order that indicates whether the customer should receive notifications about order updates.
  type: boolean
shipping_methods:
  description: The shipping methods for the draft order
  type: array
  items:
    type: object
    required:
       - option_id
    properties:
      option_id:
        description: The ID of the shipping option in use
        type: string
      data:
        description: The optional additional data needed for the shipping method
        type: object
      price:
        description: The price of the shipping method.
        type: integer
metadata:
  description: The optional key-value map with additional details about the Draft Order.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type DraftOrderListSelector

type DraftOrderListSelector struct {
	Q string `json:"q,omitempty" validate:"omitempty"`
}

type DraftOrderUpdate

type DraftOrderUpdate struct {
	RegionId            uuid.UUID       `json:"region_id,omitempty" validate:"omitempty,string"`
	CountryCode         string          `json:"country_code,omitempty" validate:"omitempty,string"`
	Email               string          `json:"email,omitempty" validate:"omitempty,email"`
	BillingAddressId    uuid.UUID       `json:"billing_address_id,omitempty" validate:"omitempty"`
	BillingAddress      *AddressPayload `json:"billing_address,omitempty" validate:"omitempty"`
	ShippingAddressId   uuid.UUID       `json:"shipping_address_id,omitempty" validate:"omitempty"`
	ShippingAddress     *AddressPayload `json:"shipping_address,omitempty" validate:"omitempty"`
	Discounts           []Discount      `json:"discounts,omitempty" validate:"omitempty,dive"`
	CustomerId          uuid.UUID       `json:"customer_id,omitempty" validate:"omitempty,string"`
	NoNotificationOrder bool            `json:"no_notification_order,omitempty" validate:"omitempty,boolean"`
}

@oas:schema:AdminPostDraftOrdersDraftOrderReq type: object description: "The details of the draft order to update." properties:

region_id:
  type: string
  description: The ID of the Region to create the Draft Order in.
country_code:
  type: string
  description: "The 2 character ISO code for the Country."
  externalDocs:
     url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
     description: See a list of codes.
email:
  type: string
  description: "An email to be used in the Draft Order."
  format: email
billing_address:
  description: "The Address to be used for billing purposes."
  anyOf:
    - $ref: "#/components/schemas/AddressPayload"
    - type: string
shipping_address:
  description: "The Address to be used for shipping purposes."
  anyOf:
    - $ref: "#/components/schemas/AddressPayload"
    - type: string
discounts:
  description: "An array of Discount codes to add to the Draft Order."
  type: array
  items:
    type: object
    required:
      - code
    properties:
      code:
        description: "The code that a Discount is identifed by."
        type: string
no_notification_order:
  description: "An optional flag passed to the resulting order that indicates whether the customer should receive notifications about order updates."
  type: boolean
customer_id:
  description: "The ID of the customer this draft order is associated with."
  type: string

type EmitData

type EmitData struct {
	EventName string
	Data      core.JSONB
	Options   core.JSONB
}

type EventHandler

type EventHandler func(data interface{}, eventName string) error

type FilterableBatchJob

type FilterableBatchJob struct {
	core.FilterModel

	Status         []models.BatchJobStatus `json:"status,omitempty" validate:"omitempty"`
	Type           []string                `json:"type,omitempty" validate:"omitempty"`
	CreatedBy      uuid.UUIDs              `json:"created_by,omitempty" validate:"omitempty"`
	ConfirmedAt    *core.TimeModel         `json:"confirmed_at,omitempty" validate:"omitempty"`
	PreProcessedAt *core.TimeModel         `json:"pre_processed_at,omitempty" validate:"omitempty"`
	CompletedAt    *core.TimeModel         `json:"completed_at,omitempty" validate:"omitempty"`
	FailedAt       *core.TimeModel         `json:"failed_at,omitempty" validate:"omitempty"`
	CanceledAt     *core.TimeModel         `json:"canceled_at,omitempty" validate:"omitempty"`
}

type FilterableCartProps

type FilterableCartProps struct {
	core.FilterModel
}

type FilterableCollection

type FilterableCollection struct {
	core.FilterModel
	Title               string    `json:"title,omitempty" validate:"omitempty"`
	Handle              string    `json:"handle,omitempty" validate:"omitempty"`
	DiscountConditionId uuid.UUID `json:"discount_condition_id,omitempty" validate:"omitempty"`
}

type FilterableCurrencyProps

type FilterableCurrencyProps struct {
	core.FilterModel
	Code        string `json:"code" validate:"omitempty,string"`
	IncludesTax bool   `json:"includes_tax" validate:"omitempty,bool"`
}

type FilterableCustomer

type FilterableCustomer struct {
	core.FilterModel
	Email      string     `json:"email,omitempty" validate:"omitempty"`
	FirstName  string     `json:"first_name,omitempty" validate:"omitempty"`
	LastName   string     `json:"last_name,omitempty" validate:"omitempty"`
	Phone      string     `json:"phone,omitempty" validate:"omitempty"`
	HasAccount bool       `json:"has_account,omitempty" validate:"omitempty"`
	Groups     uuid.UUIDs `json:"groups,omitempty" validate:"omitempty"`
}

AdminListCustomerSelector filters used to filter retrieved customers.

type FilterableCustomerGroup

type FilterableCustomerGroup struct {
	core.FilterModel

	Name                []string  `json:"name,omitempty" validate:"omitempty"`
	DiscountConditionId uuid.UUID `json:"discount_condition_id,omitempty" validate:"omitempty"`
}

type FilterableDiscount

type FilterableDiscount struct {
	core.FilterModel

	Q          string                         `json:"q,omitempty" validate:"omitempty"`
	IsDynamic  bool                           `json:"is_dynamic,omitempty" validate:"omitempty"`
	IsDisabled bool                           `json:"is_disabled,omitempty" validate:"omitempty"`
	Rule       *AdminGetDiscountsDiscountRule `json:"rule,omitempty" validate:"omitempty"`
}

type FilterableDraftOrder

type FilterableDraftOrder struct {
	core.FilterModel
}

type FilterableGiftCard

type FilterableGiftCard struct {
	core.FilterModel
}

type FilterableInvite

type FilterableInvite struct {
	core.FilterModel

	UserEmail string `json:"user_email,omitempty"`
}

type FilterableLineItemAdjustmentProps

type FilterableLineItemAdjustmentProps struct {
	core.FilterModel

	ItemId      uuid.UUID `json:"item_id,,omitempty" validate:"omitempty"`
	Description string    `json:"description,,omitempty" validate:"omitempty"`
	ResourceId  uuid.UUID `json:"resource_id,,omitempty" validate:"omitempty"`
}

type FilterableNote

type FilterableNote struct {
	core.FilterModel

	ResourceType string    `json:"resource_type,omitempty" validate:"omitempty"`
	ResourceId   uuid.UUID `json:"resource_id,omitempty" validate:"omitempty"`
	Value        string    `json:"value,omitempty" validate:"omitempty"`
	AuthorId     uuid.UUID `json:"author_id,omitempty" validate:"omitempty"`
}

type FilterableNotification

type FilterableNotification struct {
	core.FilterModel

	EventName      string    `json:"event_name,omitempty"`
	ResourceType   string    `json:"resource_type,omitempty"`
	ResourceId     uuid.UUID `json:"resource_id,omitempty"`
	To             string    `json:"to,omitempty"`
	IncludeResends bool      `json:"include_resends,omitempty"`
}

type FilterableOrder

type FilterableOrder struct {
	core.FilterModel

	DisplayId       string           `json:"display_id,omitempty" validate:"omitempty"`
	Email           string           `json:"email,omitempty" validate:"omitempty"`
	BillingAddress  *AddressPayload  `json:"billing_address,omitempty" validate:"omitempty"`
	ShippingAddress *AddressPayload  `json:"shipping_address,omitempty" validate:"omitempty"`
	Customer        *models.Customer `json:"customer,omitempty" validate:"omitempty"`

	Status            []models.OrderStatus       `json:"status,omitempty" validate:"omitempty"`
	FulfillmentStatus []models.FulfillmentStatus `json:"fulfillment_status,omitempty" validate:"omitempty"`
	PaymentStatus     []models.PaymentStatus     `json:"payment_status,omitempty" validate:"omitempty"`
	CartId            uuid.UUID                  `json:"cart_id,omitempty" validate:"omitempty"`
	RegionId          uuid.UUID                  `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode      string                     `json:"currency_code,omitempty" validate:"omitempty"`
	TaxRate           string                     `json:"tax_rate,omitempty" validate:"omitempty"`

	CustomerId uuid.UUID `json:"customer_id,omitempty" validate:"omitempty"`
}

type FilterableOrderEdit

type FilterableOrderEdit struct {
	core.FilterModel
	OrderId      uuid.UUID `json:"order_id,omitempty" validate:"omitempty"`
	InternalNote string    `json:"internal_note,omitempty" validate:"omitempty"`
}

type FilterablePriceList

type FilterablePriceList struct {
	core.FilterModel

	Q              string                   `json:"q,omitempty" validate:"omitempty"`
	Status         []models.PriceListStatus `json:"status,omitempty" validate:"omitempty"`
	Name           string                   `json:"name,omitempty" validate:"omitempty"`
	CustomerGroups []string                 `json:"customer_groups,omitempty" validate:"omitempty"`
	Description    string                   `json:"description,omitempty" validate:"omitempty"`
	Type           []models.PriceListType   `json:"type,omitempty" validate:"omitempty"`
}

type FilterablePriceSetProps

type FilterablePriceSetProps struct {
	Id           uuid.UUIDs          `json:"id,omitempty" validate:"omitempty"`
	MoneyAmounts *models.MoneyAmount `json:"money_amounts,omitempty" validate:"omitempty"`
}

type FilterableProduct

type FilterableProduct struct {
	core.FilterModel
	PriceSelectionParams
	Q                       string                 `json:"q,omitempty" validate:"omitempty"`
	Status                  []models.ProductStatus `json:"status,omitempty" validate:"omitempty"`
	PriceListId             uuid.UUIDs             `json:"price_list_id,omitempty" validate:"omitempty"`
	CollectionId            uuid.UUIDs             `json:"collection_id,omitempty" validate:"omitempty"`
	Tags                    []string               `json:"tags,omitempty" validate:"omitempty"`
	Title                   string                 `json:"title,omitempty" validate:"omitempty"`
	Description             string                 `json:"description,omitempty" validate:"omitempty"`
	Handle                  string                 `json:"handle,omitempty" validate:"omitempty"`
	IsGiftcard              bool                   `json:"is_giftcard,omitempty" validate:"omitempty"`
	TypeId                  uuid.UUIDs             `json:"type_id,omitempty" validate:"omitempty"`
	SalesChannelId          uuid.UUIDs             `json:"sales_channel_id,omitempty" validate:"omitempty"`
	DiscountConditionId     uuid.UUID              `json:"discount_condition_id,omitempty" validate:"omitempty"`
	CategoryId              uuid.UUIDs             `json:"category_id,omitempty" validate:"omitempty"`
	IncludeCategoryChildren bool                   `json:"include_category_children,omitempty" validate:"omitempty"`
}

type FilterableProductCategory

type FilterableProductCategory struct {
	core.FilterModel
	Handle                 string    `json:"handle,omitempty" validate:"omitempty,string"`
	IncludeDescendantsTree bool      `json:"include_descendants_tree,omitempty" validate:"omitempty,bool"`
	IsInternal             bool      `json:"is_internal,omitempty" validate:"omitempty,bool"`
	IsActive               bool      `json:"is_active,omitempty" validate:"omitempty,bool"`
	ParentCategoryId       uuid.UUID `json:"parent_category_id,omitempty" validate:"omitempty,string"`
}

type FilterableProductTag

type FilterableProductTag struct {
	core.FilterModel
	Value               string    `json:"value,omitempty" validate:"omitempty"`
	DiscountConditionId uuid.UUID `json:"discount_condition_id,omitempty" validate:"omitempty"`
}

type FilterableProductTaxRate

type FilterableProductTaxRate struct {
	core.FilterModel
	ProductId uuid.UUIDs `json:"product_id,omitempty" validate:"omitempty"`
	RateId    uuid.UUIDs `json:"rate_id,omitempty" validate:"omitempty"`
}

FilterableProductTaxRate represents the filters that can be applied when querying for shipping tax rates.

type FilterableProductType

type FilterableProductType struct {
	core.FilterModel
	Value               string    `json:"value,omitempty" validate:"omitempty"`
	DiscountConditionId uuid.UUID `json:"discount_condition_id,omitempty" validate:"omitempty"`
}

type FilterableProductVariant

type FilterableProductVariant struct {
	core.FilterModel
	Title             []string         `json:"title,omitempty" validate:"omitempty"`
	ProductId         uuid.UUIDs       `json:"product_id,omitempty" validate:"omitempty"`
	Product           *models.Product  `json:"product,omitempty" validate:"omitempty"`
	SKU               []string         `json:"sku,omitempty" validate:"omitempty"`
	Barcode           []string         `json:"barcode,omitempty" validate:"omitempty"`
	EAN               []string         `json:"ean,omitempty" validate:"omitempty"`
	UPC               string           `json:"upc,omitempty" validate:"omitempty"`
	InventoryQuantity core.NumberModel `json:"inventory_quantity,omitempty" validate:"omitempty"`
	AllowBackorder    bool             `json:"allow_backorder,omitempty" validate:"omitempty"`
	ManageInventory   bool             `json:"manage_inventory,omitempty" validate:"omitempty"`
	HSCode            []string         `json:"hs_code,omitempty" validate:"omitempty"`
	OriginCountry     []string         `json:"origin_country,omitempty" validate:"omitempty"`
	MidCode           []string         `json:"mid_code,omitempty" validate:"omitempty"`
	Material          string           `json:"material,omitempty" validate:"omitempty"`
	Weight            core.NumberModel `json:"weight,omitempty" validate:"omitempty"`
	Length            core.NumberModel `json:"length,omitempty" validate:"omitempty"`
	Height            core.NumberModel `json:"height,omitempty" validate:"omitempty"`
	Width             core.NumberModel `json:"width,omitempty" validate:"omitempty"`
	Q                 string           `json:"q,omitempty" validate:"omitempty"`
}

type FilterableRegion

type FilterableRegion struct {
	core.FilterModel
	Name string `json:"name,omitempty" validate:"omitempty"`
}

type FilterableReturn

type FilterableReturn struct {
	core.FilterModel

	IdempotencyKey string `json:"idempotency_key,omitempty" validate:"omitempty"`
}

type FilterableReturnReason

type FilterableReturnReason struct {
	core.FilterModel
	ParentReturnReasonId uuid.UUID `json:"parent_return_reason_id,omitempty" validate:"omitempty"`
}

type FilterableRuleTypeProps

type FilterableRuleTypeProps struct {
	Id            uuid.UUIDs
	Name          []string
	RuleAttribute []string
}

type FilterableSalesChannel

type FilterableSalesChannel struct {
	core.FilterModel
	Name        string `json:"name,omitempty" validate:"omitempty"`
	Description string `json:"description,omitempty" validate:"omitempty"`
}

type FilterableShippingOption

type FilterableShippingOption struct {
	core.FilterModel
	RegionId  uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	IsReturn  bool      `json:"is_return,omitempty" validate:"omitempty"`
	AdminOnly bool      `json:"admin_only,omitempty" validate:"omitempty"`

	ProfileId uuid.UUIDs `json:"profile_id,omitempty" validate:"omitempty"`
}

type FilterableShippingProfile

type FilterableShippingProfile struct {
	core.FilterModel
}

type FilterableShippingTaxRate

type FilterableShippingTaxRate struct {
	core.FilterModel

	ShippingOptionId uuid.UUID `json:"shipping_option_id,omitempty" validate:"omitempty"`
	RateId           uuid.UUID `json:"rate_id,omitempty" validate:"omitempty"`
}

type FilterableSwap

type FilterableSwap struct {
	core.FilterModel

	IdempotencyKey string `json:"idempotency_key,omitempty" validate:"omitempty"`
}

type FilterableTaxRate

type FilterableTaxRate struct {
	core.FilterModel

	RegionId uuid.UUIDs       `json:"region_id,omitempty" validate:"omitempty"`
	Code     []string         `json:"code,omitempty" validate:"omitempty"`
	Name     []string         `json:"name,omitempty" validate:"omitempty"`
	Rate     core.NumberModel `json:"rate,omitempty" validate:"omitempty"`
}

type FilterableUser

type FilterableUser struct {
	core.FilterModel

	Email     string `json:"email,omitempty" validate:"omitempty"`
	FirstName string `json:"first_name,omitempty" validate:"omitempty"`
	LastName  string `json:"last_name,omitempty" validate:"omitempty"`
}

type FindParams

type FindParams struct {
	Expand string `json:"expand,omitempty" validate:"omitempty"`
	Fields string `json:"fields,omitempty" validate:"omitempty"`
}

FindParams is used to configure how data is retrieved.

type FulFillmentItemType

type FulFillmentItemType struct {
	ItemId   uuid.UUID `json:"item_id"`
	Quantity int       `json:"quantity"`
}

type FulfillmentItemPartition

type FulfillmentItemPartition struct {
	ShippingMethod *models.ShippingMethod `json:"shipping_method"`
	Items          []models.LineItem      `json:"items"`
}

type FulfillmentOptions

type FulfillmentOptions struct {
	ProviderId uuid.UUID  `json:"provider_id"`
	Options    core.JSONB `json:"options"`
}

type GenerateInputData

type GenerateInputData struct {
	VariantId uuid.UUID  `json:"variantId uuid.UUID"`
	Quantity  int        `json:"quantity"`
	Metadata  core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	UnitPrice float64    `json:"unit_price,omitempty" validate:"omitempty"`
}

type GenerateLineItemContext

type GenerateLineItemContext struct {
	RegionId       uuid.UUID              `json:"region_id,omitempty" validate:"omitempty"`
	UnitPrice      float64                `json:"unit_price,omitempty" validate:"omitempty"`
	IncludesTax    bool                   `json:"includes_tax,omitempty" validate:"omitempty"`
	Metadata       core.JSONB             `json:"metadata,omitempty" validate:"omitempty"`
	CustomerId     uuid.UUID              `json:"customer_id,omitempty" validate:"omitempty"`
	OrderEditId    uuid.UUID              `json:"order_edit_id,omitempty" validate:"omitempty"`
	Cart           *models.Cart           `json:"cart,omitempty" validate:"omitempty"`
	VariantPricing *ProductVariantPricing `json:"variant_pricing,omitempty" validate:"omitempty"`
}

type GetRegionPriceContext

type GetRegionPriceContext struct {
	RegionId              uuid.UUID `json:"regionId uuid.UUID"`
	Quantity              int       `json:"quantity,omitempty" validate:"omitempty"`
	CustomerId            uuid.UUID `json:"customer_id,omitempty" validate:"omitempty"`
	IncludeDiscountPrices bool      `json:"include_discount_prices,omitempty" validate:"omitempty"`
}

type GiftCard

type GiftCard struct {
	Code string `json:"code"`
}

type GiftCardAllocation

type GiftCardAllocation struct {
	Amount     float64 `json:"amount,omitempty" validate:"omitempty"`
	UnitAmount float64 `json:"unit_amount,omitempty" validate:"omitempty"`
}

GiftCardAllocation represents the amount of a gift card allocated to a line item

type Group

type Group struct {
	Id uuid.UUID `json:"id,omitempty" validate:"omitempty"`
}

type IdempotencyCallbackResult

type IdempotencyCallbackResult struct {
	RecoveryPoint string     `json:"recovery_point,omitempty"`
	ResponseCode  int        `json:"response_code,omitempty"`
	ResponseBody  core.JSONB `json:"response_body,omitempty"`
}

type Item

type Item struct {
	Title     string     `json:"title,omitempty" validate:"omitempty"`
	UnitPrice float64    `json:"unit_price,omitempty" validate:"omitempty"`
	VariantId uuid.UUID  `json:"variant_id,omitempty" validate:"omitempty"`
	Quantity  int        `json:"quantity"`
	Metadata  core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostDraftOrdersDraftOrderLineItemsReq type: object description: "The details of the line item to create." required:

  • quantity

properties:

variant_id:
  description: The ID of the Product Variant associated with the line item. If the line item is custom, the `variant_id` should be omitted.
  type: string
unit_price:
  description: The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price.
  type: integer
title:
  description: The title of the line item if `variant_id` is not provided.
  type: string
  default: "Custom item"
quantity:
  description: The quantity of the line item.
  type: integer
metadata:
  description: The optional key-value map with additional details about the Line Item.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type LineAllocations

type LineAllocations struct {
	GiftCard *GiftCardAllocation `json:"gift_card,omitempty" validate:"omitempty"`
	Discount *DiscountAllocation `json:"discount,omitempty" validate:"omitempty"`
}

LineAllocationsMap represents a map of line item ids and its corresponding gift card and discount allocations

type LineAllocationsMap

type LineAllocationsMap map[uuid.UUID]LineAllocations

LineAllocationsMap represents a map of line item ids and its corresponding gift card and discount allocations

type LineDiscount

type LineDiscount struct {
	LineItem *models.LineItem `json:"lineItem,omitempty" validate:"omitempty"`
	Variant  uuid.UUID        `json:"variant,omitempty" validate:"omitempty"`
	Amount   float64          `json:"amount,omitempty" validate:"omitempty"`
}

LineDiscount associates a line item and discount allocation

type LineDiscountAmount

type LineDiscountAmount struct {
	Item                    *models.LineItem `json:"item,omitempty" validate:"omitempty"`
	Amount                  float64          `json:"amount,omitempty" validate:"omitempty"`
	CustomAdjustmentsAmount float64          `json:"customAdjustmentsAmount,omitempty" validate:"omitempty"`
}

LineDiscountAmount associates a line item and discount allocation

type LineItemUpdate

type LineItemUpdate struct {
	Title                 string     `json:"title,omitempty" validate:"omitempty"`
	UnitPrice             float64    `json:"unit_price,omitempty" validate:"omitempty"`
	Quantity              int        `json:"quantity,omitempty" validate:"omitempty"`
	Metadata              core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	RegionId              uuid.UUID  `json:"region_id,omitempty" validate:"omitempty"`
	VariantId             uuid.UUID  `json:"variant_id,omitempty" validate:"omitempty"`
	ShouldCalculatePrices bool       `json:"should_calculate_prices,omitempty" validate:"omitempty"`
	HasShipping           bool       `json:"has_shipping"`
}

type LineItemValidateData

type LineItemValidateData struct {
	Variant   *struct{ ProductId uuid.UUID }
	VariantId uuid.UUID
}

type ListInvite

type ListInvite struct {
	*models.Invite
	Token string `json:"token"`
}

type Metadata

type Metadata struct {
	Key   string `json:"key,omitempty" validate:"omitempty"`
	Value string `json:"value,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostProductsProductMetadataReq type: object required:

  • key
  • value

properties:

key:
  description: The metadata key
  type: string
value:
  description: The metadata value
  type: string

type OauthAuthorize

type OauthAuthorize struct {
	ApplicationName string `json:"application_name"`
	State           string `json:"state"`
	Code            string `json:"code"`
}

type OrderClaimFulfillments

type OrderClaimFulfillments struct {
	LocationId     uuid.UUID  `json:"location_id,omitempty" validate:"omitempty"`
	NoNotification bool       `json:"no_notification,omitempty" validate:"omitempty"`
	Metadata       core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderClaimsClaimFulfillmentsReq type: object properties:

metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
no_notification:
  description: >-
    If set to `true`, no notification will be sent to the customer related to this Claim.
  type: boolean
location_id:
  description: "The ID of the fulfillment's location."
  type: string

type OrderClaimShipments

type OrderClaimShipments struct {
	FulfillmentId   uuid.UUID `json:"fulfillment_id"`
	TrackingNumbers []string  `json:"tracking_numbers,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderClaimsClaimShipmentsReq type: object required:

  • fulfillment_id

properties:

fulfillment_id:
  description: The ID of the Fulfillment.
  type: string
tracking_numbers:
  description: An array of tracking numbers for the shipment.
  type: array
  items:
    type: string

type OrderEditsDecline

type OrderEditsDecline struct {
	DeclinedReason string `json:"declined_reason,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostOrderEditsOrderEditDecline type: object description: "The details of the order edit's decline." properties:

declined_reason:
  type: string
  description: The reason for declining the Order Edit.

type OrderEditsEditLineItem

type OrderEditsEditLineItem struct {
	Quantity int `json:"quantity"`
}

@oas:schema:AdminPostOrderEditsEditLineItemsLineItemReq type: object description: "The details to create or update of the line item change." required:

  • quantity

properties:

quantity:
  description: The quantity to update
  type: number

type OrderEditsRequestConfirmation

type OrderEditsRequestConfirmation struct {
	PaymentCollectionDescription string `json:"payment_collection_description,omitempty" validate:"omitempty"`
}

type OrderFulfillments

type OrderFulfillments struct {
	Items          []FulFillmentItemType `json:"items"`
	LocationId     uuid.UUID             `json:"location_id,omitempty" validate:"omitempty"`
	NoNotification bool                  `json:"no_notification,omitempty" validate:"omitempty"`
	Metadata       core.JSONB            `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderFulfillmentsReq type: object description: "The details of the fulfillment to be created." required:

  • items

properties:

items:
  description: The Line Items to include in the Fulfillment.
  type: array
  items:
    type: object
    required:
      - item_id
      - quantity
    properties:
      item_id:
        description: The ID of the Line Item to fulfill.
        type: string
      quantity:
        description: The quantity of the Line Item to fulfill.
        type: integer
location_id:
  type: string
  description: "The ID of the location where the items will be fulfilled from."
no_notification:
  description: >-
    If set to `true`, no notification will be sent to the customer related to this fulfillment.
  type: boolean
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type OrderLineItemReservation

type OrderLineItemReservation struct {
	LocationId uuid.UUID `json:"location_id"`
	Quantity   int       `json:"quantity,omitempty" validate:"omitempty"`
}

@oas:schema:AdminOrdersOrderLineItemReservationReq type: object required: - location_id properties:

location_id:
  description: "The ID of the location of the reservation"
  type: string
quantity:
  description: "The quantity to reserve"
  type: number

type OrderLookup

type OrderLookup struct {
	DisplayId       string          `json:"display_id"`
	Email           string          `json:"email" validate:"email"`
	ShippingAddress *AddressPayload `json:"shipping_address,omitempty" validate:"omitempty"`
}

type OrderRefunds

type OrderRefunds struct {
	Amount         float64             `json:"amount"`
	Reason         models.RefundReason `json:"reason"`
	Note           string              `json:"note,omitempty" validate:"omitempty"`
	NoNotification bool                `json:"no_notification,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderRefundsReq type: object description: "The details of the order refund." required:

  • amount
  • reason

properties:

amount:
  description: The amount to refund. It should be less than or equal the `refundable_amount` of the order.
  type: integer
reason:
  description: The reason for the Refund.
  type: string
note:
  description: A note with additional details about the Refund.
  type: string
no_notification:
  description: >-
    If set to `true`, no notification will be sent to the customer related to this Refund.
  type: boolean

type OrderReturnItem

type OrderReturnItem struct {
	ItemId   uuid.UUID `json:"item_id"`
	Quantity int       `json:"quantity"`
	ReasonId uuid.UUID `json:"reason_id,omitempty" validate:"omitempty"`
	Note     string    `json:"note,omitempty" validate:"omitempty"`
}

type OrderReturns

type OrderReturns struct {
	Items          []OrderReturnItem              `json:"items" validate:"dive"`
	ReturnShipping CreateClaimReturnShippingInput `json:"return_shipping,omitempty" validate:"omitempty,nested"`
	Note           string                         `json:"note,omitempty" validate:"omitempty,alphanum"`
	ReceiveNow     bool                           `json:"receive_now,omitempty" validate:"omitempty,boolean"`
	NoNotification bool                           `json:"no_notification,omitempty" validate:"omitempty,boolean"`
	Refund         float64                        `json:"refund,omitempty" validate:"omitempty,numeric"`
	LocationId     uuid.UUID                      `json:"location_id,omitempty" validate:"omitempty,alphanum"`
}

@oas:schema:AdminPostOrdersOrderReturnsReq type: object description: "The details of the requested return." required:

  • items

properties:

items:
  description: The line items that will be returned.
  type: array
  items:
    type: object
    required:
      - item_id
      - quantity
    properties:
      item_id:
        description: The ID of the Line Item.
        type: string
      reason_id:
        description: The ID of the Return Reason to use.
        type: string
      note:
        description: An optional note with information about the Return.
        type: string
      quantity:
        description: The quantity of the Line Item.
        type: integer
return_shipping:
  description: The Shipping Method to be used to handle the return shipment.
  type: object
  properties:
    option_id:
      type: string
      description: The ID of the Shipping Option to create the Shipping Method from.
    price:
      type: integer
      description: The price to charge for the Shipping Method.
note:
  description: An optional note with information about the Return.
  type: string
receive_now:
  description: A flag to indicate if the Return should be registerd as received immediately.
  type: boolean
  default: false
no_notification:
  description: >-
    If set to `true`, no notification will be sent to the customer related to this Return.
  type: boolean
refund:
  description: The amount to refund.
  type: integer
location_id:
  description: "The ID of the location used for the return."
  type: string

type OrderShippingMethod

type OrderShippingMethod struct {
	OptionId uuid.UUID  `json:"option_id"`
	Data     core.JSONB `json:"data,omitempty" validate:"omitempty"`
	Price    float64    `json:"price"`
}

@oas:schema:AdminPostOrdersOrderShippingMethodsReq type: object description: "The shipping method's details." required:

  • price
  • option_id

properties:

price:
  type: number
  description: The price (excluding VAT) that should be charged for the Shipping Method
option_id:
  type: string
  description: The ID of the Shipping Option to create the Shipping Method from.
data:
  type: object
  description: The data required for the Shipping Option to create a Shipping Method. This depends on the Fulfillment Provider.

type OrderSwap

type OrderSwap struct {
	ReturnItems           []OrderReturnItem                    `json:"return_items" validate:"required,dive"`
	ReturnShipping        CreateClaimReturnShippingInput       `json:"return_shipping,omitempty" validate:"omitempty,dive"`
	SalesChannelId        string                               `json:"sales_channel_id,omitempty" validate:"omitempty,uuid"`
	AdditionalItems       []CreateClaimItemAdditionalItemInput `json:"additional_items,omitempty" validate:"omitempty,dive"`
	CustomShippingOptions []CreateCustomShippingOptionInput    `json:"custom_shipping_options,omitempty" validate:"omitempty,dive"`
	NoNotification        bool                                 `json:"no_notification,omitempty" validate:"omitempty"`
	ReturnLocationId      string                               `json:"return_location_id,omitempty" validate:"omitempty,uuid"`
	AllowBackorder        bool                                 `json:"allow_backorder,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderSwapsReq type: object description: "The details of the swap to create." required:

  • return_items

properties:

return_items:
  description: The Line Items to associate with the swap's return.
  type: array
  items:
    type: object
    required:
      - item_id
      - quantity
    properties:
      item_id:
        description: The ID of the Line Item that will be returned.
        type: string
      quantity:
        description: The number of items that will be returned
        type: integer
      reason_id:
        description: The ID of the Return Reason to use.
        type: string
      note:
        description: An optional note with information about the Return.
        type: string
return_shipping:
  description: The shipping method associated with the swap's return.
  type: object
  required:
    - option_id
  properties:
    option_id:
      type: string
      description: The ID of the Shipping Option to create the Shipping Method from.
    price:
      type: integer
      description: The price to charge for the Shipping Method.
additional_items:
  description: The new items to send to the Customer.
  type: array
  items:
    type: object
    required:
      - variant_id
      - quantity
    properties:
      variant_id:
        description: The ID of the Product Variant.
        type: string
      quantity:
        description: The quantity of the Product Variant.
        type: integer
sales_channel_id:
  type: string
  description: "The ID of the sales channel associated with the swap."
custom_shipping_options:
  description: An array of custom shipping options to potentially create a Shipping Method from to send the additional items.
  type: array
  items:
    type: object
    required:
      - option_id
      - price
    properties:
      option_id:
        description: The ID of the Shipping Option.
        type: string
      price:
        description: The custom price of the Shipping Option.
        type: integer
no_notification:
  description: >-
    If set to `true`, no notification will be sent to the customer related to this Swap.
  type: boolean
return_location_id:
  type: string
  description: "The ID of the location used for the associated return."
allow_backorder:
  description: >-
    If set to `true`, swaps can be completed with items out of stock
  type: boolean
  default: true

type OrdersReturnItem

type OrdersReturnItem struct {
	ItemId   uuid.UUID `json:"item_id"`
	Quantity int       `json:"quantity"`
	ReasonId uuid.UUID `json:"reason_id,omitempty" validate:"omitempty"`
	Note     string    `json:"note,omitempty" validate:"omitempty"`
}

type OriginalPrice

type OriginalPrice struct {
	MoneyAmountId uuid.UUID `json:"money_amount_id,omitempty" validate:"omitempty"`
	PriceListId   uuid.UUID `json:"price_list_id,omitempty" validate:"omitempty"`
	PriceListType string    `json:"price_list_type,omitempty" validate:"omitempty"`
	MinQuantity   int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity   int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type PaymentCollectionsAuthorizeBatch

type PaymentCollectionsAuthorizeBatch struct {
	SessionIds uuid.UUIDs `json:"session_ids"`
}

@oas:schema:StorePostPaymentCollectionsBatchSessionsAuthorizeReq type: object description: "The details of the payment sessions to authorize." required:

  • session_ids

properties:

session_ids:
  description: "List of Payment Session IDs to authorize."
  type: array
  items:
    type: string

type PaymentCollectionsSessionsBatch

type PaymentCollectionsSessionsBatch struct {
	Sessions []PaymentCollectionsSessionsBatchInput `json:"sessions"`
}

@oas:schema:StorePostPaymentCollectionsBatchSessionsReq type: object description: "The details of the payment sessions to manage." required:

  • sessions

properties:

sessions:
  description: "Payment sessions related to the Payment Collection. Existing sessions that are not added in this array will be deleted."
  type: array
  items:
    type: object
    required:
      - provider_id
      - amount
    properties:
      provider_id:
        type: string
        description: The ID of the Payment Provider.
      amount:
        type: integer
        description: "The payment amount"
      session_id:
        type: string
        description: "The ID of the Payment Session to be updated. If no ID is provided, a new payment session is created."

type PaymentCollectionsSessionsBatchInput

type PaymentCollectionsSessionsBatchInput struct {
	ProviderId uuid.UUID `json:"provider_id"`
	Amount     float64   `json:"amount"`
	SessionId  uuid.UUID `json:"session_id,omitempty" validate:"omitempty"`
}

type PaymentMethod

type PaymentMethod struct {
	ProviderId uuid.UUID  `json:"provider_id,omitempty" validate:"omitempty"`
	Data       core.JSONB `json:"data,omitempty" validate:"omitempty"`
}

type PaymentRefund

type PaymentRefund struct {
	Amount float64             `json:"amount"`
	Reason models.RefundReason `json:"reason,omitempty"`
	Note   string              `json:"note,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostPaymentRefundsReq type: object description: "The details of the refund to create." required:

  • amount
  • reason

properties:

amount:
  description: The amount to refund.
  type: integer
reason:
  description: The reason for the Refund.
  type: string
note:
  description: A note with additional details about the Refund.
  type: string

type PaymentSessionInput

type PaymentSessionInput struct {
	PaymentSessionId   uuid.UUID        `json:"payment_session_id,omitempty" validate:"omitempty"`
	ProviderId         uuid.UUID        `json:"provider_id"`
	Cart               *models.Cart     `json:"cart"`
	Customer           *models.Customer `json:"customer,omitempty" validate:"omitempty"`
	CurrencyCode       string           `json:"currency_code"`
	Amount             float64          `json:"amount"`
	ResourceId         uuid.UUID        `json:"resource_id,omitempty" validate:"omitempty"`
	PaymentSessionData core.JSONB       `json:"paymentSessionData,omitempty" validate:"omitempty"`
	Context            core.JSONB
}

type PriceListLoadConfig

type PriceListLoadConfig struct {
	IncludeDiscountPrices bool      `json:"include_discount_prices,omitempty" validate:"omitempty"`
	CustomerId            uuid.UUID `json:"customer_id,omitempty" validate:"omitempty"`
	CartId                uuid.UUID `json:"cart_id,omitempty" validate:"omitempty"`
	RegionId              uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode          string    `json:"currency_code,omitempty" validate:"omitempty"`
}

type PriceListPriceCreateInput

type PriceListPriceCreateInput struct {
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	VariantId    uuid.UUID `json:"variant_id"`
	Amount       float64   `json:"amount"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type PriceListPriceUpdateInput

type PriceListPriceUpdateInput struct {
	Id           uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	VariantId    uuid.UUID `json:"variant_id,omitempty" validate:"omitempty"`
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	Amount       float64   `json:"amount,omitempty" validate:"omitempty"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type PriceSelectionParams

type PriceSelectionParams struct {
	FindParams
	// Retrieve prices for a cart Id uuid.UUID.
	CartId uuid.UUID `json:"cart_id,omitempty" validate:"omitempty"`
	// Retrieve prices for a region Id uuid.UUID.
	RegionId uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	// Retrieve prices for a currency code.
	CurrencyCode string `json:"currency_code,omitempty" validate:"omitempty"`
}

The context to apply on retrieved prices.

type PriceSetDTO

type PriceSetDTO struct {
	Id           uuid.UUID            `json:"id"`
	MoneyAmounts []models.MoneyAmount `json:"money_amounts,omitempty" validate:"omitempty"`
	RuleTypes    []RuleTypeDTO        `json:"rule_types,omitempty" validate:"omitempty"`
}

type PricedShippingOption

type PricedShippingOption struct {
	*models.ShippingOption
	PriceInclTax float64          `json:"price_incl_tax"`
	TaxRates     []TaxServiceRate `json:"tax_rates"`
	TaxAmount    float64          `json:"tax_amount"`
}

type PricingContext

type PricingContext struct {
	Context core.JSONB `json:"context"`
}

type PricingFilters

type PricingFilters struct {
	Id uuid.UUIDs `json:"id"`
}

type ProductBatchProductCategory

type ProductBatchProductCategory struct {
	Id uuid.UUID `json:"id"`
}

type ProductBatchSalesChannel

type ProductBatchSalesChannel struct {
	Id uuid.UUID `json:"id"`
}

type ProductCategoryInput

type ProductCategoryInput struct {
	Handle           string                  `json:"handle,omitempty" validate:"omitempty"`
	IsInternal       bool                    `json:"is_internal,omitempty" validate:"omitempty"`
	IsActive         bool                    `json:"is_active,omitempty" validate:"omitempty"`
	ParentCategoryId uuid.UUID               `json:"parent_category_id,omitempty" validate:"omitempty"`
	ParentCategory   *models.ProductCategory `json:"parent_category,omitempty" validate:"omitempty"`
	Rank             int64                   `json:"rank,omitempty" validate:"omitempty"`
	Metadata         core.JSONB              `json:"metadata,omitempty" validate:"omitempty"`
}

type ProductOptionInput

type ProductOptionInput struct {
	Title  string                      `json:"title"`
	Values []models.ProductOptionValue `json:"values,omitempty" validate:"omitempty"`
}

type ProductProductCategoryReq

type ProductProductCategoryReq struct {
	Id uuid.UUID `json:"id"`
}

type ProductSalesChannelReq

type ProductSalesChannelReq struct {
	Id uuid.UUID `json:"id"`
}

type ProductSearch

type ProductSearch struct {
	Q      string      `json:"q,omitempty" validate:"omitempty"`
	Offset int         `json:"offset,omitempty" validate:"omitempty"`
	Limit  int         `json:"limit,omitempty" validate:"omitempty"`
	Filter interface{} `json:"filter,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostSearchReq type: object properties:

q:
  type: string
  description: The search query.
offset:
  type: number
  description: The number of products to skip when retrieving the products.
limit:
  type: number
  description: Limit the number of products returned.
filter:
  description: Pass filters based on the search service.

type ProductTagReq

type ProductTagReq struct {
	Id    uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	Value string    `json:"value"`
}

type ProductTypeReq

type ProductTypeReq struct {
	Id    uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	Value string    `json:"value"`
}

type ProductVariantOption

type ProductVariantOption struct {
	OptionId uuid.UUID `json:"option_id"`
	Value    string    `json:"value"`
}

type ProductVariantParams

type ProductVariantParams struct {
	PriceSelectionParams
	Ids               uuid.UUIDs       `json:"ids,omitempty" validate:"omitempty,alphanum"`
	SalesChannelId    uuid.UUID        `json:"sales_channel_id,omitempty" validate:"omitempty,alphanum"`
	Id                uuid.UUID        `json:"id,omitempty" validate:"omitempty"`
	Title             []string         `json:"title,omitempty" validate:"omitempty"`
	InventoryQuantity core.NumberModel `json:"inventory_quantity,omitempty" validate:"omitempty"`
}

type ProductVariantPrice

type ProductVariantPrice struct {
	Id           uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	Amount       float64   `json:"amount"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type ProductVariantPricesCreateReq

type ProductVariantPricesCreateReq struct {
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	Amount       int       `json:"amount"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type ProductVariantPricesUpdateReq

type ProductVariantPricesUpdateReq struct {
	Id           uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	RegionId     uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	CurrencyCode string    `json:"currency_code,omitempty" validate:"omitempty"`
	Amount       int       `json:"amount"`
	MinQuantity  int       `json:"min_quantity,omitempty" validate:"omitempty"`
	MaxQuantity  int       `json:"max_quantity,omitempty" validate:"omitempty"`
}

type ProductVariantPricing

type ProductVariantPricing struct {
	TaxedPricing
	Prices                     []models.MoneyAmount `json:"prices"`
	OriginalPrice              float64              `json:"original_price,omitempty" validate:"omitempty"`
	CalculatedPrice            float64              `json:"calculated_price,omitempty" validate:"omitempty"`
	OriginalPriceIncludesTax   bool                 `json:"original_price_includes_tax,omitempty" validate:"omitempty"`
	CalculatedPriceIncludesTax bool                 `json:"calculated_price_includes_tax,omitempty" validate:"omitempty"`
	CalculatedPriceType        string               `json:"calculated_price_type,omitempty" validate:"omitempty"`
}

type ProductVariantVariant

type ProductVariantVariant struct {
	PriceSelectionParams
	SalesChannelId uuid.UUID `json:"sales_channel_id,omitempty" validate:"omitempty"`
}

type ProviderLineItemTaxLine

type ProviderLineItemTaxLine struct {
	Rate     float64    `json:"rate"`
	Name     string     `json:"name"`
	Code     string     `json:"code"`
	ItemId   uuid.UUID  `json:"item_id"`
	Metadata core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

type ProviderShippingMethodTaxLine

type ProviderShippingMethodTaxLine struct {
	Rate             float64    `json:"rate"`
	Name             string     `json:"name"`
	Code             string     `json:"code"`
	ShippingMethodId uuid.UUID  `json:"shipping_method_id"`
	Metadata         core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

type ProviderTaxLine

type ProviderTaxLine struct {
	Rate             float64    `json:"rate"`
	Name             string     `json:"name"`
	Code             string     `json:"code"`
	ItemId           uuid.UUID  `json:"item_id"`
	ShippingMethodId uuid.UUID  `json:"shipping_method_id"`
	Metadata         core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

type PublishableApiKeySalesChannelsBatch

type PublishableApiKeySalesChannelsBatch struct {
	SalesChannelIds []ProductBatchSalesChannel `json:"sales_channel_ids"`
}

@oas:schema:AdminPostPublishableApiKeySalesChannelsBatchReq type: object description: "The details of the sales channels to add to the publishable API key." required:

  • sales_channel_ids

properties:

sales_channel_ids:
  description: The IDs of the sales channels to add to the publishable API key
  type: array
  items:
    type: object
    required:
      - id
    properties:
      id:
        type: string
        description: The ID of the sales channel

type PublishableApiKeyScopes

type PublishableApiKeyScopes struct {
	SalesChannelIds uuid.UUIDs `json:"sales_channel_ids"`
}

type RegionCountries

type RegionCountries struct {
	CountryCode string `json:"country_code"`
}

@oas:schema:AdminPostRegionsRegionCountriesReq type: object description: "The details of the country to add to the region." required:

  • country_code

properties:

country_code:
  description: "The 2 character ISO code for the Country."
  type: string
  externalDocs:
    url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
    description: See a list of codes.

type RegionDetails

type RegionDetails struct {
	Id      uuid.UUID
	TaxRate float64
}

type RegionFulfillmentProvider

type RegionFulfillmentProvider struct {
	ProviderId uuid.UUID `json:"provider_id"`
}

@oas:schema:AdminPostRegionsRegionFulfillmentProvidersReq type: object description: "The details of the fulfillment provider to add to the region." required:

  • provider_id

properties:

provider_id:
  description: "The ID of the Fulfillment Provider."
  type: string

type RegionPaymentProvider

type RegionPaymentProvider struct {
	ProviderId uuid.UUID `json:"provider_id"`
}

@oas:schema:AdminPostRegionsRegionPaymentProvidersReq type: object description: "The details of the payment provider to add to the region." required:

  • provider_id

properties:

provider_id:
  description: "The ID of the Payment Provider."
  type: string

type RemovePriceSetRulesDTO

type RemovePriceSetRulesDTO struct {
	Id    uuid.UUID `json:"id"`
	Rules []string  `json:"rules"`
}

type ReorderConditions

type ReorderConditions struct {
	TargetCategoryId    uuid.UUID `json:"targetCategoryId uuid.UUID"`
	OriginalParentId    uuid.UUID `json:"originalParentId uuid.UUID,omitempty" validate:"omitempty"`
	TargetParentId      uuid.UUID `json:"targetParentId uuid.UUID,omitempty" validate:"omitempty"`
	OriginalRank        int64     `json:"originalRank"`
	TargetRank          int64     `json:"targetRank,omitempty" validate:"omitempty"`
	ShouldChangeParent  bool      `json:"shouldChangeParent"`
	ShouldChangeRank    bool      `json:"shouldChangeRank"`
	ShouldIncrementRank bool      `json:"shouldIncrementRank"`
	ShouldDeleteElement bool      `json:"shouldDeleteElement"`
}

type RequestContext

type RequestContext struct {
	Ip string
}

type RequirementInput

type RequirementInput struct {
	Type   models.ShippingOptionRequirementType `json:"type,omitempty" validate:"omitempty"`
	Amount float64                              `json:"amount,omitempty" validate:"omitempty"`
}

type ResendNotification

type ResendNotification struct {
	To string `json:"to,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostNotificationsNotificationResendReq type: object description: "The resend details." properties:

to:
  description: >-
    A new address or user identifier that the Notification should be sent to. If not provided, the previous `to` field of the notification will be used.
  type: string

type ReturnReceive

type ReturnReceive struct {
	Items      []OrderReturnItem `json:"items"`
	Refund     float64           `json:"refund,omitempty" validate:"omitempty"`
	LocationId uuid.UUID         `json:"location_id,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostReturnsReturnReceiveReq type: object description: "The details of the received return." required:

  • items

properties:

items:
  description: The Line Items that have been received.
  type: array
  items:
    type: object
    required:
      - item_id
      - quantity
    properties:
      item_id:
        description: The ID of the Line Item.
        type: string
      quantity:
        description: The quantity of the Line Item.
        type: integer
refund:
  description: The amount to refund.
  type: number
location_id:
  description: The ID of the location to return items from.
  type: string

type ReturnShippingMethod

type ReturnShippingMethod struct {
	OptionId uuid.UUID `json:"option_id"`
}

type RuleTypeDTO

type RuleTypeDTO struct {
	Id              uuid.UUID
	Name            string
	RuleAttribute   string
	DefaultPriority int
}

type SalesChannelStockLocations

type SalesChannelStockLocations struct {
	LocationId uuid.UUID `json:"location_id"`
}

@oas:schema:AdminPostSalesChannelsChannelStockLocationsReq type: object required:

  • location_id

properties:

location_id:
  description: The ID of the stock location
  type: string

type Selector

type Selector struct {
	ResourceId uuid.UUID `json:"resource_id,omitempty" validate:"omitempty"`
}

type SessionsInput

type SessionsInput struct {
	ProviderId uuid.UUID `json:"provider_id"`
}

@oas:schema:StorePostCartsCartPaymentSessionReq type: object description: "The details of the payment session to set." required:

  • provider_id

properties:

provider_id:
  type: string
  description: The ID of the Payment Provider.

type ShippingMethod

type ShippingMethod struct {
	OptionId uuid.UUID  `json:"option_id"`
	Data     core.JSONB `json:"data,omitempty" validate:"omitempty"`
	Price    float64    `json:"price,omitempty" validate:"omitempty"`
}

type ShippingMethodOrder

type ShippingMethodOrder struct {
	ProviderId uuid.UUID    `json:"provider_id,omitempty" validate:"omitempty"`
	ProfileId  uuid.UUID    `json:"profile_id,omitempty" validate:"omitempty"`
	Price      float64      `json:"price,omitempty" validate:"omitempty"`
	Data       core.JSONB   `json:"data,omitempty" validate:"omitempty"`
	Items      []core.JSONB `json:"items,omitempty" validate:"omitempty"`
}

type ShippingMethodUpdate

type ShippingMethodUpdate struct {
	Data         core.JSONB `json:"data,omitempty" validate:"omitempty"`
	Price        float64    `json:"price,omitempty" validate:"omitempty"`
	ReturnId     uuid.UUID  `json:"return_id,omitempty" validate:"omitempty"`
	SwapId       uuid.UUID  `json:"swap_id,omitempty" validate:"omitempty"`
	OrderId      uuid.UUID  `json:"order_id,omitempty" validate:"omitempty"`
	ClaimOrderId uuid.UUID  `json:"claim_order_id,omitempty" validate:"omitempty"`
}

type ShippingOptionParams

type ShippingOptionParams struct {
	ProductIds []uuid.UUID `json:"product_ids,omitempty" validate:"omitempty"`
	RegionId   uuid.UUID   `json:"region_id,omitempty" validate:"omitempty"`
	IsReturn   string      `json:"is_return,omitempty" validate:"omitempty"`
}

type ShippingRequirement

type ShippingRequirement struct {
	Type   models.ShippingOptionRequirementType `json:"type"`
	Amount int                                  `json:"amount"`
	Id     uuid.UUID                            `json:"id"`
}

type Subscriber

type Subscriber func(data interface{}, eventName string) error

type SubscriberContext

type SubscriberContext struct {
	SubscriberId uuid.UUID
}

type SubscriberDescriptor

type SubscriberDescriptor struct {
	Id         uuid.UUID
	Subscriber Subscriber
}

type SubtotalOptions

type SubtotalOptions struct {
	ExcludeNonDiscounts bool `json:"excludeNonDiscounts,omitempty" validate:"omitempty"`
}

SubtotalOptions represents options to use for subtotal calculations

type TaxLinesMaps

type TaxLinesMaps struct {
	LineItemsTaxLines       map[uuid.UUID][]models.LineItemTaxLine
	ShippingMethodsTaxLines map[uuid.UUID][]models.ShippingMethodTaxLine
}

type TaxRateListByConfig

type TaxRateListByConfig struct {
	RegionId uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
}

type TaxRateProductTypes

type TaxRateProductTypes struct {
	ProductTypes uuid.UUIDs `json:"product_types"`
}

@oas:schema:AdminPostTaxRatesTaxRateProductTypesReq type: object description: "The product types to add to the tax rate." required:

  • product_types

properties:

product_types:
  type: array
  description: "The IDs of the types of products to associate with this tax rate"
  items:
    type: string

type TaxRateProducts

type TaxRateProducts struct {
	Products uuid.UUIDs `json:"products"`
}

@oas:schema:AdminPostTaxRatesTaxRateProductsReq type: object description: "The details of the products to associat with the tax rate." required:

  • products

properties:

products:
  type: array
  description: "The IDs of the products to associate with this tax rate"
  items:
    type: string

type TaxRateShippingOptions

type TaxRateShippingOptions struct {
	ShippingOptions uuid.UUIDs `json:"shipping_options"`
}

@oas:schema:AdminPostTaxRatesTaxRateShippingOptionsReq type: object description: "The details of the shipping options to associate with the tax rate." required:

  • shipping_options

properties:

shipping_options:
  type: array
  description: "The IDs of the shipping options to associate with this tax rate"
  items:
    type: string

type TaxServiceRate

type TaxServiceRate struct {
	Rate float64
	Name string
	Code string
}

type TaxedPricing

type TaxedPricing struct {
	OriginalPriceInclTax   float64          `json:"original_price_incl_tax,omitempty" validate:"omitempty"`
	CalculatedPriceInclTax float64          `json:"calculated_price_incl_tax,omitempty" validate:"omitempty"`
	OriginalTax            float64          `json:"original_tax,omitempty" validate:"omitempty"`
	CalculatedTax          float64          `json:"calculated_tax,omitempty" validate:"omitempty"`
	TaxRates               []TaxServiceRate `json:"tax_rates,omitempty" validate:"omitempty"`
}

type TotalField

type TotalField string
const (
	TotalFieldShippingTotal    TotalField = "shipping_total"
	TotalFieldDiscountTotal    TotalField = "discount_total"
	TotalFieldTaxTotal         TotalField = "tax_total"
	TotalFieldRefundedTotal    TotalField = "refunded_total"
	TotalFieldTotal            TotalField = "total"
	TotalFieldSubtotal         TotalField = "subtotal"
	TotalFieldRefundableAmount TotalField = "refundable_amount"
	TotalFieldGiftCardTotal    TotalField = "gift_card_total"
	TotalFieldGiftCardTaxTotal TotalField = "gift_card_tax_total"
)

type TotalsContext

type TotalsContext struct {
	ForceTaxes      bool `json:"force_taxes,omitempty" validate:"omitempty"`
	ReturnableItems bool `json:"returnable_items,omitempty" validate:"omitempty"`
}

type UpdateAnalyticsConfig

type UpdateAnalyticsConfig struct {
	OptOut    bool `json:"opt_out,omitempty" validate:"omitempty"`
	Anonymize bool `json:"anonymize,omitempty" validate:"omitempty"`
}

type UpdateClaimInput

type UpdateClaimInput struct {
	ClaimItems      []UpdateClaimItemInput           `json:"claim_items,omitempty" validate:"omitempty"`
	ShippingMethods []UpdateClaimShippingMethodInput `json:"shipping_methods,omitempty" validate:"omitempty"`
	NoNotification  bool                             `json:"no_notification,omitempty" validate:"omitempty"`
	Metadata        core.JSONB                       `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderClaimsClaimReq type: object properties:

claim_items:
  description: The Claim Items that the Claim will consist of.
  type: array
  items:
    type: object
    required:
      - id
      - images
      - tags
    properties:
      id:
        description: The ID of the Claim Item.
        type: string
      item_id:
        description: The ID of the Line Item that will be claimed.
        type: string
      quantity:
        description: The number of items that will be returned
        type: integer
      note:
        description: Short text describing the Claim Item in further detail.
        type: string
      reason:
        description: The reason for the Claim
        type: string
        enum:
          - missing_item
          - wrong_item
          - production_failure
          - other
      tags:
        description: A list o tags to add to the Claim Item
        type: array
        items:
          type: object
          properties:
            id:
              type: string
              description: Tag ID
            value:
              type: string
              description: Tag value
      images:
        description: A list of image URL's that will be associated with the Claim
        type: array
        items:
          type: object
          properties:
            id:
              type: string
              description: Image ID
            url:
              type: string
              description: Image URL
      metadata:
        description: An optional set of key-value pairs to hold additional information.
        type: object
        externalDocs:
          description: "Learn about the metadata attribute, and how to delete and update it."
          url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
shipping_methods:
  description: The Shipping Methods to send the additional Line Items with.
  type: array
  items:
     type: object
     properties:
       id:
         description: The ID of an existing Shipping Method
         type: string
       option_id:
         description: The ID of the Shipping Option to create a Shipping Method from
         type: string
       price:
         description: The price to charge for the Shipping Method
         type: integer
       data:
         description: An optional set of key-value pairs to hold additional information.
         type: object
no_notification:
  description: If set to true no notification will be send related to this Swap.
  type: boolean
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateClaimItemImageInput

type UpdateClaimItemImageInput struct {
	Id  uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	URL string    `json:"url,omitempty" validate:"omitempty"`
}

type UpdateClaimItemInput

type UpdateClaimItemInput struct {
	Id       uuid.UUID                   `json:"id,omitempty" validate:"omitempty"`
	Note     string                      `json:"note,omitempty" validate:"omitempty"`
	Reason   models.ClaimReasonType      `json:"reason,omitempty" validate:"omitempty"`
	Images   []UpdateClaimItemImageInput `json:"images,omitempty" validate:"omitempty"`
	Tags     []UpdateClaimItemTagInput   `json:"tags,omitempty" validate:"omitempty"`
	Metadata core.JSONB                  `json:"metadata,omitempty" validate:"omitempty"`
}

type UpdateClaimItemTagInput

type UpdateClaimItemTagInput struct {
	Id    uuid.UUID `json:"id,omitempty" validate:"omitempty"`
	Value string    `json:"value,omitempty" validate:"omitempty"`
}

type UpdateClaimShippingMethodInput

type UpdateClaimShippingMethodInput struct {
	Id       uuid.UUID  `json:"id,omitempty" validate:"omitempty"`
	OptionId uuid.UUID  `json:"option_id,omitempty" validate:"omitempty"`
	Price    float64    `json:"price,omitempty" validate:"omitempty"`
	Data     core.JSONB `json:"data,omitempty" validate:"omitempty"`
}

type UpdateCurrencyInput

type UpdateCurrencyInput struct {
	IncludesTax bool `json:"includes_tax,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostCurrenciesCurrencyReq type: object description: "The details to update in the currency" properties:

includes_tax:
  type: boolean
  x-featureFlag: "tax_inclusive_pricing"
  description: "Tax included in prices of currency."

type UpdateCustomerGroup

type UpdateCustomerGroup struct {
	Name     string     `json:"name,omitempty" validate:"omitempty"`
	Metadata core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostCustomerGroupsGroupReq type: object description: "The details to update in the customer group." properties:

name:
  description: "Name of the customer group"
  type: string
metadata:
  description: "Metadata of the customer group."
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateCustomerInput

type UpdateCustomerInput struct {
	Password         string          `json:"password,omitempty" validate:"omitempty"`
	Metadata         core.JSONB      `json:"metadata,omitempty" validate:"omitempty"`
	BillingAddress   *AddressPayload `json:"billing_address,omitempty" validate:"omitempty"`
	BillingAddressId uuid.UUID       `json:"billing_address_id,omitempty" validate:"omitempty"`
	Groups           []Group         `json:"groups,omitempty" validate:"omitempty"`
	Email            string          `json:"email,omitempty" validate:"omitempty"`
	FirstName        string          `json:"first_name,omitempty" validate:"omitempty"`
	LastName         string          `json:"last_name,omitempty" validate:"omitempty"`
	Phone            string          `json:"phone,omitempty" validate:"omitempty"`
}

@oas:schema:PostCustomersCustomerReq type: object description: "The details of the customer to update." properties:

email:
  type: string
  description: The Customer's email. You can't update the email of a registered customer.
  format: email
first_name:
  type: string
  description:  The Customer's first name.
last_name:
  type: string
  description:  The Customer's last name.
phone:
  type: string
  description: The Customer's phone number.
password:
  type: string
  description: The Customer's password.
  format: password
groups:
  type: array
  description: A list of customer groups to which the customer belongs.
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: The ID of a customer group
        type: string
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateDiscountInput

type UpdateDiscountInput struct {
	Code          string                   `json:"code,omitempty" validate:"omitempty"`
	Rule          *UpdateDiscountRuleInput `json:"rule,omitempty" validate:"omitempty"`
	IsDisabled    bool                     `json:"is_disabled,omitempty" validate:"omitempty"`
	StartsAt      *time.Time               `json:"starts_at,omitempty" validate:"omitempty"`
	EndsAt        *time.Time               `json:"ends_at,omitempty" validate:"omitempty"`
	ValidDuration *time.Time               `json:"valid_duration,omitempty" validate:"omitempty"`
	UsageLimit    int                      `json:"usage_limit,omitempty" validate:"omitempty"`
	Regions       uuid.UUIDs               `json:"regions,omitempty" validate:"omitempty"`
	Metadata      core.JSONB               `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostDiscountsDiscountReq type: object description: "The details of the discount to update." properties:

code:
  type: string
  description: A unique code that will be used to redeem the discount
rule:
  description: The discount rule that defines how discounts are calculated
  type: object
  required:
    - id
  properties:
    id:
      type: string
      description: "The ID of the Rule"
    description:
      type: string
      description: "A short description of the discount"
    value:
      type: number
      description: "The value that the discount represents. This will depend on the type of the discount."
    allocation:
      type: string
      description: >-
        The scope that the discount should apply to. `total` indicates that the discount should be applied on the cart total, and `item` indicates that the discount should be applied to each discountable item in the cart.
      enum: [total, item]
    conditions:
      type: array
      description: "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided based on the discount condition's type."
      items:
        type: object
        required:
          - operator
        properties:
          id:
            type: string
            description: "The ID of the condition"
          operator:
            type: string
            description: >-
              Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that
              discountable resources are everything but the specified resources.
            enum: [in, not_in]
          products:
            type: array
            description: list of product IDs if the condition's type is `products`.
            items:
              type: string
          product_types:
            type: array
            description: list of product type IDs if the condition's type is `product_types`.
            items:
              type: string
          product_collections:
            type: array
            description: list of product collection IDs if the condition's type is `product_collections`.
            items:
              type: string
          product_tags:
            type: array
            description: list of product tag IDs if the condition's type is `product_tags`.
            items:
              type: string
          customer_groups:
            type: array
            description: list of customer group IDs if the condition's type is `customer_groups`.
            items:
              type: string
is_disabled:
  type: boolean
  description: >-
    Whether the discount code is disabled on creation. If set to `true`, it will not be available for customers.
starts_at:
  type: string
  format: date-time
  description: The date and time at which the discount should be available.
ends_at:
  type: string
  format: date-time
  description: The date and time at which the discount should no longer be available.
valid_duration:
  type: string
  description: The duration the discount runs between
  example: P3Y6M4DT12H30M5S
usage_limit:
  type: number
  description: Maximum number of times the discount can be used
regions:
  description: A list of region IDs representing the Regions in which the Discount can be used.
  type: array
  items:
    type: string
metadata:
   description: An object containing metadata of the discount
   type: object
   externalDocs:
     description: "Learn about the metadata attribute, and how to delete and update it."
     url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateDiscountRuleInput

type UpdateDiscountRuleInput struct {
	Id          uuid.UUID                `json:"id"`
	Description string                   `json:"description,omitempty" validate:"omitempty"`
	Value       float64                  `json:"value,omitempty" validate:"omitempty"`
	Allocation  *models.AllocationType   `json:"allocation,omitempty" validate:"omitempty"`
	Conditions  []DiscountConditionInput `json:"conditions,omitempty" validate:"omitempty"`
}

UpdateDiscountRuleInput represents the input for updating a discount rule.

type UpdateGiftCardInput

type UpdateGiftCardInput struct {
	Balance    float64    `json:"balance,omitempty" validate:"omitempty"`
	EndsAt     *time.Time `json:"ends_at,omitempty" validate:"omitempty"`
	IsDisabled bool       `json:"is_disabled,omitempty" validate:"omitempty"`
	RegionId   uuid.UUID  `json:"region_id,omitempty" validate:"omitempty"`
	Metadata   core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostGiftCardsGiftCardReq type: object description: "The details to update of the gift card." properties:

balance:
  type: integer
  description: The value (excluding VAT) that the Gift Card should represent.
is_disabled:
  type: boolean
  description: >-
    Whether the Gift Card is disabled on creation. If set to `true`, the gift card will not be available for customers.
ends_at:
  type: string
  format: date-time
  description: The date and time at which the Gift Card should no longer be available.
region_id:
  description: The ID of the Region in which the Gift Card can be used.
  type: string
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateLineItem

type UpdateLineItem struct {
	Quantity int        `json:"quantity"`
	Metadata core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:StorePostCartsCartLineItemsItemReq type: object description: "The details to update of the line item." required:

  • quantity

properties:

quantity:
  type: number
  description: The quantity of the line item in the cart.
metadata:
  type: object
  description: An optional key-value map with additional details about the Line Item. If omitted, the metadata will remain unchanged."
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateNoteInput

type UpdateNoteInput struct {
	Value string `json:"value"`
}

@oas:schema:AdminPostNotesNoteReq type: object description: "The details to update of the note." required:

  • value

properties:

value:
  type: string
  description: The description of the Note.

type UpdateOauthInput

type UpdateOauthInput struct {
	Data core.JSONB `json:"data"`
}

type UpdateOrderEditInput

type UpdateOrderEditInput struct {
	InternalNote string `json:"internal_note"`
}

@oas:schema:AdminPostOrderEditsOrderEditReq type: object description: "The details to update of the order edit." properties:

internal_note:
  description: An optional note to create or update in the order edit.
  type: string

type UpdateOrderInput

type UpdateOrderInput struct {
	Email             string                   `json:"email,omitempty" validate:"omitempty"`
	BillingAddress    *AddressPayload          `json:"billing_address,omitempty" validate:"omitempty"`
	ShippingAddress   *AddressPayload          `json:"shipping_address,omitempty" validate:"omitempty"`
	Items             []models.LineItem        `json:"items,omitempty" validate:"omitempty"`
	Region            string                   `json:"region,omitempty" validate:"omitempty"`
	Discounts         []models.Discount        `json:"discounts,omitempty" validate:"omitempty"`
	CustomerId        uuid.UUID                `json:"customer_id,omitempty" validate:"omitempty"`
	PaymentMethod     *PaymentMethod           `json:"payment_method,omitempty" validate:"omitempty"`
	ShippingMethod    []ShippingMethodOrder    `json:"shipping_method,omitempty" validate:"omitempty"`
	NoNotification    bool                     `json:"no_notification,omitempty" validate:"omitempty"`
	Payment           *models.Payment          `json:"payment,omitempty" validate:"omitempty"`
	Status            models.OrderStatus       `json:"status,omitempty" validate:"omitempty"`
	FulfillmentStatus models.FulfillmentStatus `json:"fulfillment_status,omitempty" validate:"omitempty"`
	PaymentStatus     models.PaymentStatus     `json:"payment_status,omitempty" validate:"omitempty"`
	Metadata          core.JSONB               `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostOrdersOrderReq type: object description: "The details to update of the order." properties:

email:
  description: The email associated with the order
  type: string
billing_address:
  description: The order's billing address
  $ref: "#/components/schemas/AddressPayload"
shipping_address:
  description: The order's shipping address
  $ref: "#/components/schemas/AddressPayload"
items:
  description: The line items of the order
  type: array
  items:
    $ref: "#/components/schemas/LineItem"
region:
  description: ID of the region that the order is associated with.
  type: string
discounts:
  description: The discounts applied to the order
  type: array
  items:
    $ref: "#/components/schemas/Discount"
customer_id:
  description: The ID of the customer associated with the order.
  type: string
payment_method:
  description: The payment method chosen for the order.
  type: object
  properties:
    provider_id:
      type: string
      description: The ID of the payment provider.
    data:
      description: Any data relevant for the given payment method.
      type: object
shipping_method:
  description: The Shipping Method used for shipping the order.
  type: object
  properties:
    provider_id:
      type: string
      description: The ID of the shipping provider.
    profile_id:
      type: string
      description: The ID of the shipping profile.
    price:
      type: integer
      description: The price of the shipping.
    data:
      type: object
      description: Any data relevant to the specific shipping method.
    items:
      type: array
      items:
        $ref: "#/components/schemas/LineItem"
      description: Items to ship
no_notification:
  description: >-
    If set to `true`, no notification will be sent to the customer related to this order.
  type: boolean

type UpdatePaymentCollectionInput

type UpdatePaymentCollectionInput struct {
	Metadata    core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	Description string     `json:"description,omitempty" validate:"omitempty"`
}

@oas:schema:AdminUpdatePaymentCollectionsReq type: object description: "The details to update of the payment collection." properties:

description:
  description: A description to create or update the payment collection.
  type: string
metadata:
  description: A set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdatePaymentInput

type UpdatePaymentInput struct {
	OrderId uuid.UUID `json:"order_id,omitempty" validate:"omitempty"`
	SwapId  uuid.UUID `json:"swap_id,omitempty" validate:"omitempty"`
}

type UpdatePaymentSession

type UpdatePaymentSession struct {
	Data core.JSONB `json:"data"`
}

@oas:schema:StorePostCartsCartPaymentSessionUpdateReq type: object required:

  • data

properties:

data:
  type: object
  description: The data to update the payment session with.

type UpdatePriceListInput

type UpdatePriceListInput struct {
	Name           string                      `json:"name,omitempty" validate:"omitempty"`
	Description    string                      `json:"description,omitempty" validate:"omitempty"`
	StartsAt       *time.Time                  `json:"starts_at,omitempty" validate:"omitempty"`
	EndsAt         *time.Time                  `json:"ends_at,omitempty" validate:"omitempty"`
	Status         models.PriceListStatus      `json:"status,omitempty" validate:"omitempty"`
	Type           models.PriceListType        `json:"type,omitempty" validate:"omitempty"`
	IncludesTax    bool                        `json:"includes_tax,omitempty" validate:"omitempty"`
	Prices         []PriceListPriceCreateInput `json:"prices,omitempty" validate:"omitempty"`
	CustomerGroups []CustomerGroups            `json:"customer_groups,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostPriceListsPriceListPriceListReq type: object description: "The details to update of the payment collection." properties:

name:
  description: "The name of the Price List"
  type: string
description:
  description: "The description of the Price List."
  type: string
starts_at:
  description: "The date with timezone that the Price List starts being valid."
  type: string
  format: date
ends_at:
  description: "The date with timezone that the Price List ends being valid."
  type: string
  format: date
type:
  description: The type of the Price List.
  type: string
  enum:
   - sale
   - override
status:
  description: >-
    The status of the Price List. If the status is set to `draft`, the prices created in the price list will not be available of the customer.
  type: string
  enum:
   - active
   - draft
prices:
  description: The prices of the Price List.
  type: array
  items:
    type: object
    required:
      - amount
      - variant_id
    properties:
      id:
        description: The ID of the price.
        type: string
      region_id:
        description: The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided.
        type: string
      currency_code:
        description: The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided.
        type: string
        externalDocs:
           url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
           description: See a list of codes.
      variant_id:
        description: The ID of the Variant for which the price is used.
        type: string
      amount:
        description: The amount to charge for the Product Variant.
        type: integer
      min_quantity:
        description: The minimum quantity for which the price will be used.
        type: integer
      max_quantity:
        description: The maximum quantity for which the price will be used.
        type: integer
customer_groups:
  type: array
  description: An array of customer groups that the Price List applies to.
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: The ID of a customer group
        type: string
includes_tax:
  description: "Tax included in prices of price list"
  x-featureFlag: "tax_inclusive_pricing"
  type: boolean

type UpdatePriceSetDTO

type UpdatePriceSetDTO struct {
	Id uuid.UUID `json:"id"`
}

type UpdateProductCategoryInput

type UpdateProductCategoryInput struct {
	ProductCategoryInput
	Name string `json:"name,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostProductCategoriesCategoryReq type: object description: "The details to update of the product category." properties:

name:
  type: string
  description:  The name to identify the Product Category by.
description:
  type: string
  description: An optional text field to describe the Product Category by.
handle:
  type: string
  description:  A handle to be used in slugs.
is_internal:
  type: boolean
  description: A flag to make product category an internal category for admins
is_active:
  type: boolean
  description: A flag to make product category visible/hidden in the store front
parent_category_id:
  type: string
  description: The ID of the parent product category
rank:
  type: number
  description: The rank of the category in the tree node (starting from 0)
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateProductCollection

type UpdateProductCollection struct {
	Title    string     `json:"title,omitempty" validate:"omitempty"`
	Handle   string     `json:"handle,omitempty" validate:"omitempty"`
	Metadata core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostCollectionsCollectionReq type: object description: The product collection's details to update. properties:

title:
  type: string
  description: The title of the collection.
handle:
  type: string
  description: An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used.
metadata:
  description: An optional set of key-value pairs to hold additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateProductInput

type UpdateProductInput struct {
	Title         string                                  `json:"title,omitempty" validate:"omitempty"`
	Subtitle      string                                  `json:"subtitle,omitempty" validate:"omitempty"`
	ProfileId     uuid.UUID                               `json:"profile_id,omitempty" validate:"omitempty"`
	Description   string                                  `json:"description,omitempty" validate:"omitempty"`
	IsGiftcard    bool                                    `json:"is_giftcard,omitempty" validate:"omitempty"`
	Discountable  bool                                    `json:"discountable,omitempty" validate:"omitempty"`
	Images        []string                                `json:"images,omitempty" validate:"omitempty"`
	Thumbnail     string                                  `json:"thumbnail,omitempty" validate:"omitempty"`
	Handle        string                                  `json:"handle,omitempty" validate:"omitempty"`
	Status        models.ProductStatus                    `json:"status,omitempty" validate:"omitempty"`
	Type          *CreateProductProductTypeInput          `json:"type,omitempty" validate:"omitempty"`
	CollectionId  uuid.UUID                               `json:"collection_id,omitempty" validate:"omitempty"`
	Tags          []CreateProductProductTagInput          `json:"tags,omitempty" validate:"omitempty"`
	Options       []CreateProductProductOption            `json:"options,omitempty" validate:"omitempty"`
	SalesChannels []CreateProductProductSalesChannelInput `json:"sales_channels,omitempty" validate:"omitempty"`
	Categories    []CreateProductProductCategoryInput     `json:"categories,omitempty" validate:"omitempty"`
	Weight        float64                                 `json:"weight,omitempty" validate:"omitempty"`
	Length        float64                                 `json:"length,omitempty" validate:"omitempty"`
	Height        float64                                 `json:"height,omitempty" validate:"omitempty"`
	Width         float64                                 `json:"width,omitempty" validate:"omitempty"`
	HSCode        string                                  `json:"hs_code,omitempty" validate:"omitempty"`
	OriginCountry string                                  `json:"origin_country,omitempty" validate:"omitempty"`
	MIdCode       uuid.UUID                               `json:"mid_code,omitempty" validate:"omitempty"`
	Material      string                                  `json:"material,omitempty" validate:"omitempty"`
	Metadata      core.JSONB                              `json:"metadata,omitempty" validate:"omitempty"`
	ExternalId    string                                  `json:"external_id,omitempty" validate:"omitempty"`
	Variants      []UpdateProductProductVariantDTO        `json:"variants,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostProductsProductReq type: object description: "The details to update of the product." properties:

title:
  description: "The title of the Product"
  type: string
subtitle:
  description: "The subtitle of the Product"
  type: string
description:
  description: "The description of the Product."
  type: string
discountable:
  description: A flag to indicate if discounts can be applied to the Line Items generated from this Product
  type: boolean
images:
  description: An array of images of the Product. Each value in the array is a URL to the image. You can use the upload API Routes to upload the image and obtain a URL.
  type: array
  items:
    type: string
thumbnail:
  description: The thumbnail to use for the Product. The value is a URL to the thumbnail. You can use the upload API Routes to upload the thumbnail and obtain a URL.
  type: string
handle:
  description: A unique handle to identify the Product by. If not provided, the kebab-case version of the product title will be used. This can be used as a slug in URLs.
  type: string
status:
  description: The status of the product. The product is shown to the customer only if its status is `published`.
  type: string
  enum: [draft, proposed, published, rejected]
type:
  description: The Product Type to associate the Product with.
  type: object
  required:
    - value
  properties:
    id:
      description: The ID of an existing Product Type. If not provided, a new product type will be created.
      type: string
    value:
      description: The value of the Product Type.
      type: string
collection_id:
  description: The ID of the Product Collection the Product belongs to.
  type: string
tags:
  description: Product Tags to associate the Product with.
  type: array
  items:
    type: object
    required:
      - value
    properties:
      id:
        description: The ID of an existing Product Tag. If not provided, a new product tag will be created.
        type: string
      value:
        description: The value of the Tag. If the `id` is provided, the value of the existing tag will be updated.
        type: string
sales_channels:
  description: "Sales channels to associate the Product with."
  type: array
  items:
    type: object
    required:
      - id
    properties:
      id:
        description: The ID of an existing Sales channel.
        type: string
categories:
  description: "Product categories to add the Product to."
  x-featureFlag: "product_categories"
  type: array
  items:
    required:
      - id
    properties:
      id:
        description: The ID of a Product Category.
        type: string
variants:
  description: An array of Product Variants to create with the Product. Each product variant must have a unique combination of Product Option values.
  type: array
  items:
    type: object
    properties:
      id:
        description: The id of an existing product variant. If provided, the details of the product variant will be updated. If not, a new product variant will be created.
        type: string
      title:
        description: The title of the product variant.
        type: string
      sku:
        description: The unique SKU of the product variant.
        type: string
      ean:
        description: The EAN number of the product variant.
        type: string
      upc:
        description: The UPC number of the product variant.
        type: string
      barcode:
        description: A generic GTIN field of the product variant.
        type: string
      hs_code:
        description: The Harmonized System code of the product variant.
        type: string
      inventory_quantity:
        description: The amount of stock kept of the product variant.
        type: integer
      allow_backorder:
        description: Whether the product variant can be purchased when out of stock.
        type: boolean
      manage_inventory:
        description: Whether Medusa should keep track of the inventory of this product variant.
        type: boolean
      weight:
        description: The weight of the product variant.
        type: number
      length:
        description: The length of the product variant.
        type: number
      height:
        description: The height of the product variant.
        type: number
      width:
        description: The width of the product variant.
        type: number
      origin_country:
        description: The country of origin of the product variant.
        type: string
      mid_code:
        description: The Manufacturer Identification code of the product variant.
        type: string
      material:
        description: The material composition of the product variant.
        type: string
      metadata:
        description: An optional set of key-value pairs with additional information.
        type: object
        externalDocs:
          description: "Learn about the metadata attribute, and how to delete and update it."
          url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
      prices:
        type: array
        description: An array of product variant prices. A product variant can have different prices for each region or currency code.
        externalDocs:
          url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices
          description: Product variant pricing.
        items:
          type: object
          required:
            - amount
          properties:
            id:
              description: The ID of the Price. If provided, the existing price will be updated. Otherwise, a new price will be created.
              type: string
            region_id:
              description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided.
              type: string
            currency_code:
              description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided.
              type: string
              externalDocs:
                url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
                description: See a list of codes.
            amount:
              description: The price amount.
              type: integer
            min_quantity:
              description: The minimum quantity required to be added to the cart for the price to be used.
              type: integer
            max_quantity:
              description: The maximum quantity required to be added to the cart for the price to be used.
              type: integer
      options:
        type: array
        description: An array of Product Option values that the variant corresponds to.
        items:
          type: object
          required:
            - option_id
            - value
          properties:
            option_id:
              description: The ID of the Option.
              type: string
            value:
              description: The value of the Product Option.
              type: string
weight:
  description: The weight of the Product.
  type: number
length:
  description: The length of the Product.
  type: number
height:
  description: The height of the Product.
  type: number
width:
  description: The width of the Product.
  type: number
hs_code:
  description: The Harmonized System code of the product variant.
  type: string
origin_country:
  description: The country of origin of the Product.
  type: string
mid_code:
  description: The Manufacturer Identification code of the Product.
  type: string
material:
  description: The material composition of the Product.
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateProductProductVariantDTO

type UpdateProductProductVariantDTO struct {
	Id                uuid.UUID                               `json:"id,omitempty" validate:"omitempty"`
	Title             string                                  `json:"title,omitempty" validate:"omitempty"`
	SKU               string                                  `json:"sku,omitempty" validate:"omitempty"`
	EAN               string                                  `json:"ean,omitempty" validate:"omitempty"`
	UPC               string                                  `json:"upc,omitempty" validate:"omitempty"`
	Barcode           string                                  `json:"barcode,omitempty" validate:"omitempty"`
	HSCode            string                                  `json:"hs_code,omitempty" validate:"omitempty"`
	InventoryQuantity int                                     `json:"inventory_quantity,omitempty" validate:"omitempty"`
	AllowBackorder    bool                                    `json:"allow_backorder,omitempty" validate:"omitempty"`
	ManageInventory   bool                                    `json:"manage_inventory,omitempty" validate:"omitempty"`
	Weight            int                                     `json:"weight,omitempty" validate:"omitempty"`
	Length            int                                     `json:"length,omitempty" validate:"omitempty"`
	Height            int                                     `json:"height,omitempty" validate:"omitempty"`
	Width             int                                     `json:"width,omitempty" validate:"omitempty"`
	OriginCountry     string                                  `json:"origin_country,omitempty" validate:"omitempty"`
	MIdCode           uuid.UUID                               `json:"mid_code,omitempty" validate:"omitempty"`
	Material          string                                  `json:"material,omitempty" validate:"omitempty"`
	Metadata          core.JSONB                              `json:"metadata,omitempty" validate:"omitempty"`
	Prices            []CreateProductProductVariantPriceInput `json:"prices,omitempty" validate:"omitempty"`
	Options           []ProductVariantOption                  `json:"options,omitempty" validate:"omitempty"`
}

type UpdateProductVariantData

type UpdateProductVariantData struct {
	Variant    *models.ProductVariant     `json:"variant"`
	UpdateData *UpdateProductVariantInput `json:"updateData"`
}

type UpdateProductVariantInput

type UpdateProductVariantInput struct {
	Title             string                 `json:"title,omitempty" validate:"omitempty"`
	ProductId         uuid.UUID              `json:"product_id,omitempty" validate:"omitempty"`
	SKU               string                 `json:"sku,omitempty" validate:"omitempty"`
	Barcode           string                 `json:"barcode,omitempty" validate:"omitempty"`
	EAN               string                 `json:"ean,omitempty" validate:"omitempty"`
	UPC               string                 `json:"upc,omitempty" validate:"omitempty"`
	InventoryQuantity int                    `json:"inventory_quantity,omitempty" validate:"omitempty"`
	AllowBackorder    bool                   `json:"allow_backorder,omitempty" validate:"omitempty"`
	ManageInventory   bool                   `json:"manage_inventory,omitempty" validate:"omitempty"`
	HSCode            string                 `json:"hs_code,omitempty" validate:"omitempty"`
	OriginCountry     string                 `json:"origin_country,omitempty" validate:"omitempty"`
	VariantRank       int                    `json:"variant_rank,omitempty" validate:"omitempty"`
	MIdCode           string                 `json:"mid_code,omitempty" validate:"omitempty"`
	Material          string                 `json:"material,omitempty" validate:"omitempty"`
	Weight            float64                `json:"weight,omitempty" validate:"omitempty"`
	Length            float64                `json:"length,omitempty" validate:"omitempty"`
	Height            float64                `json:"height,omitempty" validate:"omitempty"`
	Width             float64                `json:"width,omitempty" validate:"omitempty"`
	Options           []ProductVariantOption `json:"options,omitempty" validate:"omitempty"`
	Prices            []ProductVariantPrice  `json:"prices,omitempty" validate:"omitempty"`
	Metadata          core.JSONB             `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostProductsProductVariantsVariantReq type: object properties:

title:
  description: The title of the product variant.
  type: string
sku:
  description: The unique SKU of the product variant.
  type: string
ean:
  description: The EAN number of the item.
  type: string
upc:
  description: The UPC number of the item.
  type: string
barcode:
  description: A generic GTIN field of the product variant.
  type: string
hs_code:
  description: The Harmonized System code of the product variant.
  type: string
inventory_quantity:
  description: The amount of stock kept of the product variant.
  type: integer
allow_backorder:
  description: Whether the product variant can be purchased when out of stock.
  type: boolean
manage_inventory:
  description: Whether Medusa should keep track of the inventory of this product variant.
  type: boolean
weight:
  description: The weight of the product variant.
  type: number
length:
  description: The length of the product variant.
  type: number
height:
  description: The height of the product variant.
  type: number
width:
  description: The width of the product variant.
  type: number
origin_country:
  description: The country of origin of the product variant.
  type: string
mid_code:
  description: The Manufacturer Identification code of the product variant.
  type: string
material:
  description: The material composition of the product variant.
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
prices:
  type: array
  description: An array of product variant prices. A product variant can have different prices for each region or currency code.
  externalDocs:
    url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices
    description: Product variant pricing.
  items:
    type: object
    required:
      - amount
    properties:
      id:
        description: The ID of the price. If provided, the existing price will be updated. Otherwise, a new price will be created.
        type: string
      region_id:
        description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided.
        type: string
      currency_code:
        description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided.
        type: string
        externalDocs:
          url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
          description: See a list of codes.
      amount:
        description: The price amount.
        type: integer
      min_quantity:
       description: The minimum quantity required to be added to the cart for the price to be used.
       type: integer
      max_quantity:
        description: The maximum quantity required to be added to the cart for the price to be used.
        type: integer
options:
  type: array
  description: An array of Product Option values that the variant corresponds to.
  items:
    type: object
    required:
      - option_id
      - value
    properties:
      option_id:
        description: The ID of the Product Option.
        type: string
      value:
        description: The value of the Product Option.
        type: string

type UpdatePublishableApiKeyInput

type UpdatePublishableApiKeyInput struct {
	Title string `json:"title,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostPublishableApiKeysPublishableApiKeyReq type: object description: "The details to update of the publishable API key." properties:

title:
  description: The title of the Publishable API Key.
  type: string

type UpdateRegionInput

type UpdateRegionInput struct {
	Name                 string     `json:"name,omitempty" validate:"omitempty"`
	CurrencyCode         string     `json:"currency_code,omitempty" validate:"omitempty"`
	TaxCode              string     `json:"tax_code,omitempty" validate:"omitempty"`
	TaxRate              float64    `json:"tax_rate,omitempty" validate:"omitempty"`
	GiftCardsTaxable     bool       `json:"gift_cards_taxable,omitempty" validate:"omitempty"`
	AutomaticTaxes       bool       `json:"automatic_taxes,omitempty" validate:"omitempty"`
	TaxProviderId        uuid.UUID  `json:"tax_provider_id,omitempty" validate:"omitempty"`
	PaymentProviders     uuid.UUIDs `json:"payment_providers,omitempty" validate:"omitempty"`
	FulfillmentProviders uuid.UUIDs `json:"fulfillment_providers,omitempty" validate:"omitempty"`
	Countries            []string   `json:"countries,omitempty" validate:"omitempty"`
	IncludesTax          bool       `json:"includes_tax,omitempty" validate:"omitempty"`
	Metadata             core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostRegionsRegionReq type: object description: "The details to update of the regions." properties:

name:
  description: "The name of the Region"
  type: string
currency_code:
  description: "The 3 character ISO currency code to use in the Region."
  type: string
  externalDocs:
    url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
    description: See a list of codes.
automatic_taxes:
  description: >-
    If set to `true`, the Medusa backend will automatically calculate taxes for carts in this region. If set to `false`, the taxes must be calculated manually.
  externalDocs:
    url: https://docs.medusajs.com/modules/taxes/storefront/manual-calculation
    description: How to calculate taxes in a storefront.
  type: boolean
gift_cards_taxable:
  description: >-
    If set to `true`, taxes will be applied on gift cards.
  type: boolean
tax_provider_id:
  description: "The ID of the tax provider to use. If none provided, the system tax provider is used."
  type: string
tax_code:
  description: "The tax code of the Region."
  type: string
tax_rate:
  description: "The tax rate to use in the Region."
  type: number
includes_tax:
  x-featureFlag: "tax_inclusive_pricing"
  description: "Whether taxes are included in the prices of the region."
  type: boolean
payment_providers:
  description: "A list of Payment Provider IDs that can be used in the Region"
  type: array
  items:
    type: string
fulfillment_providers:
  description: "A list of Fulfillment Provider IDs that can be used in the Region"
  type: array
  items:
    type: string
countries:
  description: "A list of countries' 2 ISO characters that should be included in the Region."
  type: array
  items:
    type: string

type UpdateReturnInput

type UpdateReturnInput struct {
	Items          []OrderReturnItem               `json:"items,omitempty" validate:"omitempty"`
	ShippingMethod *CreateClaimReturnShippingInput `json:"shipping_method,omitempty" validate:"omitempty"`
	NoNotification bool                            `json:"no_notification,omitempty" validate:"omitempty"`
	Metadata       core.JSONB                      `json:"metadata,omitempty" validate:"omitempty"`
}

type UpdateReturnReason

type UpdateReturnReason struct {
	Description          string     `json:"description,omitempty" validate:"omitempty"`
	Label                string     `json:"label,omitempty" validate:"omitempty"`
	ParentReturnReasonId uuid.UUID  `json:"parent_return_reason_id,omitempty" validate:"omitempty"`
	Metadata             core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostReturnReasonsReasonReq type: object description: "The details to update of the return reason." properties:

label:
  description: "The label to display to the Customer."
  type: string
value:
  description: "A unique value of the return reason."
  type: string
description:
  description: "The description of the Reason."
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateRuleTypeDTO

type UpdateRuleTypeDTO struct {
	Id              uuid.UUID
	Name            string
	RuleAttribute   string
	DefaultPriority int
}

type UpdateSalesChannelInput

type UpdateSalesChannelInput CreateSalesChannelInput

@oas:schema:AdminPostSalesChannelsSalesChannelReq type: object description: "The details to update of the sales channel." properties:

name:
  type: string
  description: The name of the sales channel
description:
  type: string
  description:  The description of the sales channel.
is_disabled:
  type: boolean
  description: Whether the Sales Channel is disabled.

type UpdateShippingOptionInput

type UpdateShippingOptionInput struct {
	Metadata     core.JSONB                     `json:"metadata,omitempty" validate:"omitempty"`
	PriceType    models.ShippingOptionPriceType `json:"price_type,omitempty" validate:"omitempty"`
	Amount       float64                        `json:"amount,omitempty" validate:"omitempty"`
	Name         string                         `json:"name,omitempty" validate:"omitempty"`
	AdminOnly    bool                           `json:"admin_only,omitempty" validate:"omitempty"`
	IsReturn     bool                           `json:"is_return,omitempty" validate:"omitempty"`
	Requirements []RequirementInput             `json:"requirements,omitempty" validate:"omitempty"`
	RegionId     uuid.UUID                      `json:"region_id,omitempty" validate:"omitempty"`
	ProviderId   uuid.UUID                      `json:"provider_id,omitempty" validate:"omitempty"`
	ProfileId    uuid.UUID                      `json:"profile_id,omitempty" validate:"omitempty"`
	Data         string                         `json:"data,omitempty" validate:"omitempty"`
	IncludesTax  bool                           `json:"includes_tax,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostShippingOptionsOptionReq type: object description: "The details to update of the shipping option." required:

  • requirements

properties:

name:
  description: "The name of the Shipping Option"
  type: string
amount:
  description: >-
    The amount to charge for the Shipping Option. If the `price_type` of the shipping option is `calculated`, this amount will not actually be used.
  type: integer
admin_only:
  description: >-
    If set to `true`, the shipping option can only be used when creating draft orders.
  type: boolean
metadata:
  description: "An optional set of key-value pairs with additional information."
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
requirements:
  description: "The requirements that must be satisfied for the Shipping Option to be available."
  type: array
  items:
    type: object
    required:
      - type
      - amount
    properties:
      id:
        description: The ID of an existing requirement. If an ID is passed, the existing requirement's details are updated. Otherwise, a new requirement is created.
        type: string
      type:
        description: The type of the requirement
        type: string
        enum:
          - max_subtotal
          - min_subtotal
      amount:
        description: The amount to compare with.
        type: integer
includes_tax:
  description: "Tax included in prices of shipping option"
  x-featureFlag: "tax_inclusive_pricing"
  type: boolean

type UpdateShippingProfile

type UpdateShippingProfile struct {
	Name            string                     `json:"name,omitempty" validate:"omitempty"`
	Metadata        core.JSONB                 `json:"metadata,omitempty" validate:"omitempty"`
	Type            models.ShippingProfileType `json:"type,omitempty" validate:"omitempty"`
	Products        uuid.UUIDs                 `json:"products,omitempty" validate:"omitempty"`
	ShippingOptions uuid.UUIDs                 `json:"shipping_options,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostShippingProfilesProfileReq type: object description: "The detail to update of the shipping profile." properties:

name:
  description: The name of the Shipping Profile
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
type:
  description: The type of the Shipping Profile
  type: string
  enum: [default, gift_card, custom]
products:
  description: product IDs to associate with the Shipping Profile
  type: array
shipping_options:
  description: Shipping option IDs to associate with the Shipping Profile
  type: array

type UpdateStoreInput

type UpdateStoreInput struct {
	Name                  string     `json:"name,omitempty" validate:"omitempty"`
	SwapLinkTemplate      string     `json:"swap_link_template,omitempty" validate:"omitempty"`
	PaymentLinkTemplate   string     `json:"payment_link_template,omitempty" validate:"omitempty"`
	InviteLinkTemplate    string     `json:"invite_link_template,omitempty" validate:"omitempty"`
	DefaultCurrencyCode   string     `json:"default_currency_code,omitempty" validate:"omitempty"`
	Currencies            []string   `json:"currencies,omitempty" validate:"omitempty"`
	Metadata              core.JSONB `json:"metadata,omitempty" validate:"omitempty"`
	DefaultSalesChannelId uuid.UUID  `json:"default_sales_channel_id,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostStoreReq type: object description: "The details to update of the store." properties:

name:
  description: "The name of the Store"
  type: string
swap_link_template:
  description: >-
    A template for Swap links - use `{{cart_id}}` to insert the Swap Cart ID
  type: string
  example: "http://example.com/swaps/{{cart_id}}"
payment_link_template:
  description: "A template for payment links - use `{{cart_id}}` to insert the Cart ID"
  example: "http://example.com/payments/{{cart_id}}"
  type: string
invite_link_template:
  description: "A template for invite links - use `{{invite_token}}` to insert the invite token"
  example: "http://example.com/invite?token={{invite_token}}"
  type: string
default_currency_code:
  description: "The default currency code of the Store."
  type: string
  externalDocs:
    url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
    description: See a list of codes.
currencies:
  description: "Array of available currencies in the store. Each currency is in 3 character ISO code format."
  type: array
  items:
    type: string
    externalDocs:
      url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
      description: See a list of codes.
metadata:
  description: "An optional set of key-value pairs with additional information."
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateTaxRateInput

type UpdateTaxRateInput struct {
	RegionId uuid.UUID `json:"region_id,omitempty" validate:"omitempty"`
	Code     string    `json:"code,omitempty" validate:"omitempty"`
	Name     string    `json:"name,omitempty" validate:"omitempty"`
	Rate     float64   `json:"rate,omitempty" validate:"omitempty"`
}

@oas:schema:AdminPostTaxRatesTaxRateReq type: object description: "The details to update of the tax rate." properties:

code:
  type: string
  description: "The code of the tax rate."
name:
  type: string
  description: "The name of the tax rate."
region_id:
  type: string
  description: "The ID of the Region that the tax rate belongs to."
rate:
  type: number
  description: "The numeric rate to charge."
products:
  type: array
  description: "The IDs of the products associated with this tax rate"
  items:
    type: string
shipping_options:
  type: array
  description: "The IDs of the shipping options associated with this tax rate"
  items:
    type: string
product_types:
  type: array
  description: "The IDs of the types of product types associated with this tax rate"
  items:
    type: string

type UpdateUserInput

type UpdateUserInput struct {
	Email        string          `json:"email,omitempty" validate:"omitempty"`
	FirstName    string          `json:"first_name,omitempty" validate:"omitempty"`
	LastName     string          `json:"last_name,omitempty" validate:"omitempty"`
	PasswordHash string          `json:"password_hash,omitempty" validate:"omitempty"`
	APIToken     string          `json:"api_token,omitempty" validate:"omitempty"`
	Role         models.UserRole `json:"role,omitempty" validate:"omitempty"`
	Metadata     core.JSONB      `json:"metadata,omitempty" validate:"omitempty"`
}

@oas:schema:AdminUpdateUserRequest type: object properties:

first_name:
  description: "The first name of the User."
  type: string
last_name:
  description: "The last name of the User."
  type: string
role:
  description: "The role assigned to the user. These roles don't provide any different privileges."
  type: string
  enum: [admin, member, developer]
api_token:
  description: "The API token of the User."
  type: string
metadata:
  description: An optional set of key-value pairs with additional information.
  type: object
  externalDocs:
    description: "Learn about the metadata attribute, and how to delete and update it."
    url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"

type UpdateVariantCurrencyPriceData

type UpdateVariantCurrencyPriceData struct {
	VariantId uuid.UUID            `json:"variantId uuid.UUID"`
	Price     *ProductVariantPrice `json:"price"`
}

type UpdateVariantPricesData

type UpdateVariantPricesData struct {
	VariantId uuid.UUID             `json:"variantId uuid.UUID"`
	Prices    []ProductVariantPrice `json:"prices"`
}

type UpdateVariantRegionPriceData

type UpdateVariantRegionPriceData struct {
	VariantId uuid.UUID            `json:"variantId uuid.UUID"`
	Price     *ProductVariantPrice `json:"price"`
}

type UserResetPasswordRequest

type UserResetPasswordRequest struct {
	Email    string `json:"email,omitempty" validate:"omitempty"`
	Token    string `json:"token"`
	Password string `json:"password"`
}

@oas:schema:ResetPasswordRequest type: object description: "The details of the password reset request." required:

  • token
  • password

properties:

email:
  description: "The User's email."
  type: string
  format: email
token:
  description: "The password-reset token generated when the password reset was requested."
  type: string
password:
  description: "The User's new password."
  type: string
  format: password

type UserResetPasswordToken

type UserResetPasswordToken struct {
	Email string `json:"email"`
}

@oas:schema:ResetPasswordTokenRequest type: object description: "The details of the password reset token request." required:

  • email

properties:

email:
  description: "The User's email."
  type: string
  format: email

type ValidatePriceTypeAndAmountInput

type ValidatePriceTypeAndAmountInput struct {
	Amount    float64                        `json:"amount,omitempty" validate:"omitempty"`
	PriceType models.ShippingOptionPriceType `json:"price_type,omitempty" validate:"omitempty"`
}

type ValidateRequirementTypeInput

type ValidateRequirementTypeInput struct {
	Id     uuid.UUID                            `json:"id,omitempty" validate:"omitempty"`
	Type   models.ShippingOptionRequirementType `json:"type"`
	Amount float64                              `json:"amount"`
}

Jump to

Keyboard shortcuts

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