Back to Medusa

CreateShippingMethodForSingleCartDTO

www/apps/resources/references/cart/interfaces/cart.CreateShippingMethodForSingleCartDTO/page.mdx

2.14.24.5 KB
Original Source

import { TypeList } from "docs-ui"

CreateShippingMethodForSingleCartDTO

The shipping method to be created in a cart.

<TypeList types={[{"name":"name","type":"string","description":"The name of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"BigNumberInput","description":"The amount of the shipping method.","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":"value","type":"string \| number","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"BigNumber","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"shipping_option_id","type":"string","description":"The amount of the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"Record<string, unknown>","description":"The data of the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_lines","type":"CreateTaxLineDTO[]","description":"The tax lines of the shipping method.","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 shipping method.","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":"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":"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":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CreateShippingMethodForSingleCartDTO"/>