www/apps/resources/references/cart/interfaces/cart.CreateCartDTO/page.mdx
import { TypeList } from "docs-ui"
The cart to be created.
<TypeList types={[{"name":"currency_code","type":"string","description":"The currency code of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"string","description":"The associated region's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"string","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"string","description":"The associated sales channel's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"string","description":"The email of the customer that owns the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale","type":"string","description":"The locale code of the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address_id","type":"string","description":"The associated shipping address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address_id","type":"string","description":"The associated billing address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"string \| CreateAddressDTO","description":"The shipping address of the cart.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"string","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"string","description":"The company of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"string","description":"The first name of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"string","description":"The last name of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"string","description":"The first line of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"string","description":"The second line of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"string","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"string","description":"The ISO two country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"string","description":"The lower-case ISO 3166-2 province/state of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"string","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"string","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"Record<string, unknown>","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"billing_address","type":"string \| CreateAddressDTO","description":"The billing address of the cart.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"string","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"string","description":"The company of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"string","description":"The first name of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"string","description":"The last name of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"string","description":"The first line of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"string","description":"The second line of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"string","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"string","description":"The ISO two country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"string","description":"The lower-case ISO 3166-2 province/state of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"string","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"string","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"Record<string, unknown>","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"Record<string, unknown>","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"CreateLineItemDTO[]","description":"The items of the cart.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"string","description":"The title of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"BigNumberInput","description":"The quantity of the line item in the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"string \| number","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"number","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"BigNumberRawValue","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"BigNumber","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"unit_price","type":"BigNumberInput","description":"The unit price of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"string \| number","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"number","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"BigNumberRawValue","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"BigNumber","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"subtitle","type":"string","description":"The subtitle of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"string","description":"The thumbnail of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart_id","type":"string","description":"The associated cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"string","description":"The associated product's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_title","type":"string","description":"The title of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_description","type":"string","description":"The description of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_subtitle","type":"string","description":"The subtitle of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type","type":"string","description":"The type of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type_id","type":"string","description":"The ID of type of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_collection","type":"string","description":"The collection of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_handle","type":"string","description":"The handle of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"string","description":"The associated variant's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_sku","type":"string","description":"The SKU of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_barcode","type":"string","description":"The barcode of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_title","type":"string","description":"The title of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_option_values","type":"Record<string, unknown>","description":"The option values of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"boolean","description":"Whether the line item requires shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"boolean","description":"Whether the line item is discountable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"boolean","description":"Whether the line item's amount is tax inclusive.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"boolean","description":"Whether the line item's amount is a custom price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"compare_at_unit_price","type":"BigNumberInput","description":"The calculated price of the line item after applying promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"string \| number","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"number","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"BigNumberRawValue","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"BigNumber","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tax_lines","type":"CreateTaxLineDTO[]","description":"The tax lines of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"string","description":"The code of the tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"number","description":"The rate of the tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"string","description":"The description of the tax line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_rate_id","type":"string","description":"The associated tax rate's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"string","description":"The associated provider's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"string","description":"The associated item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"adjustments","type":"CreateAdjustmentDTO[]","description":"The adjustments of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"string","description":"The code of the promotion that lead to\nthis adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"BigNumberInput","description":"The amount to adjust the original amount with.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"boolean","description":"Whether the adjustment amount includes tax.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"string","description":"The description of the adjustment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_id","type":"string","description":"The associated promotion's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"string","description":"The associated provider's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"null \| Record<string, unknown>","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CreateCartDTO"/>