Files
medusa-store/www/apps/docs/content/references/services/classes/ShippingMethod.mdx
github-actions[bot] cdd42dbdcd chore(docs): Generated References (#5743)
Generated the following references:
- `entities`
- `inventory`
- `js-client`
- `pricing`
- `product`
- `services`
- `stock-location`
- `workflows`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-11-27 18:58:52 +00:00

226 lines
6.0 KiB
Plaintext

---
displayed_sidebar: servicesSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ShippingMethod
A Shipping Method represents a way in which an Order or Return can be shipped. Shipping Methods are created from a Shipping Option, but may contain additional details that can be necessary for the Fulfillment Provider to handle the shipment. If the shipping method is created for a return, it may be associated with a claim or a swap that the return is part of.
## Constructors
#### constructor
`**new ShippingMethod**()`
A Shipping Method represents a way in which an Order or Return can be shipped. Shipping Methods are created from a Shipping Option, but may contain additional details that can be necessary for the Fulfillment Provider to handle the shipment. If the shipping method is created for a return, it may be associated with a claim or a swap that the return is part of.
## Properties
<ParameterTypes parameters={[
{
"name": "cart",
"type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "cart_id",
"type": "`string`",
"description": "The ID of the cart that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "claim_order",
"type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "claim_order_id",
"type": "`null` \\| `string`",
"description": "The ID of the claim that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "data",
"type": "`Record<string, unknown>`",
"description": "Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "id",
"type": "`string`",
"description": "The shipping method's ID",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "includes_tax",
"type": "`boolean`",
"description": "Whether the shipping method price include tax",
"optional": false,
"defaultValue": "false",
"expandable": false,
"featureFlag": "tax_inclusive_pricing",
"children": []
},
{
"name": "order",
"type": "[Order](Order.mdx)",
"description": "The details of the order that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "order_id",
"type": "`string`",
"description": "The ID of the order that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "price",
"type": "`number`",
"description": "The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "return_id",
"type": "`string`",
"description": "The ID of the return that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "return_order",
"type": "[Return](Return.mdx)",
"description": "The details of the return that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "shipping_option",
"type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the shipping option the method was created from.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "shipping_option_id",
"type": "`string`",
"description": "The ID of the Shipping Option that the Shipping Method is built from.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "subtotal",
"type": "`number`",
"description": "The subtotal of the shipping",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "swap",
"type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "swap_id",
"type": "`string`",
"description": "The ID of the swap that the shipping method is used in.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "tax_lines",
"type": "[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]",
"description": "The details of the tax lines applied on the shipping method.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "tax_total",
"type": "`number`",
"description": "The total of tax",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "total",
"type": "`number`",
"description": "The total amount of the shipping",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
## Methods
#### beforeInsert
`Private **beforeInsert**(): void`
##### Returns
`void`
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />