docs: TSDoc + reference of fulfillment service (#5761)

This commit is contained in:
Shahed Nasser
2023-11-29 11:58:08 +00:00
committed by GitHub
parent 8f25ed8a10
commit f802e2460f
1479 changed files with 30259 additions and 16135 deletions
@@ -1,507 +0,0 @@
---
description: 'Learn how to create a fulfillment provider in the Medusa backend. This guide explains the different methods in the fulfillment provider.'
addHowToData: true
---
# How to Add a Fulfillment Provider
In this document, youll learn how to add a fulfillment provider to a Medusa backend. If youre unfamiliar with the Shipping architecture in Medusa, make sure to [check out the overview first](../shipping.md).
## Overview
A fulfillment provider is the shipping provider used to fulfill orders and deliver them to customers. An example of a fulfillment provider is FedEx.
By default, a Medusa Backend has a `manual` fulfillment provider which has minimal implementation. It allows you to accept orders and fulfill them manually. However, you can integrate any fulfillment provider into Medusa, and your fulfillment provider can interact with third-party shipping providers.
Adding a fulfillment provider is as simple as creating one [service](../../../development/services/create-service.mdx) file in `src/services`. A fulfillment provider is essentially a service that extends the `AbstractFulfillmentService`. It requires implementing 4 methods:
1. `getFulfillmentOptions`: used to retrieve available fulfillment options provided by this fulfillment provider.
2. `validateOption`: used to validate the shipping option when its being created by the admin.
3. `validateFulfillmentData`: used to validate a shipping method's data before it's created, typically during checkout.
4. `createFulfillment`: used to perform any additional actions when fulfillment is being created for an order, such as communicating with a third-party service.
There are other [useful methods](#useful-methods) that can be implemented based on your fulfillment provider's use case.
Also, the fulfillment provider class should have a static property `identifier`. It is the name that will be used to install and refer to the fulfillment provider throughout Medusa.
Fulfillment providers are loaded and installed on the backend startup.
---
## Create a Fulfillment Provider
The first step is to create a JavaScript or TypeScript file under `src/services`. For example, create the file `src/services/my-fulfillment.ts` with the following content:
```ts title="src/services/my-fulfillment.ts"
import {
AbstractFulfillmentService,
Cart,
Fulfillment,
LineItem,
Order,
} from "@medusajs/medusa"
import {
CreateReturnType,
} from "@medusajs/medusa/dist/types/fulfillment-provider"
class MyFulfillmentService extends AbstractFulfillmentService {
async getFulfillmentOptions(): Promise<any[]> {
throw new Error("Method not implemented.")
}
async validateFulfillmentData(
optionData: { [x: string]: unknown },
data: { [x: string]: unknown },
cart: Cart
): Promise<Record<string, unknown>> {
throw new Error("Method not implemented.")
}
async validateOption(
data: { [x: string]: unknown }
): Promise<boolean> {
throw new Error("Method not implemented.")
}
async canCalculate(
data: { [x: string]: unknown }
): Promise<boolean> {
throw new Error("Method not implemented.")
}
async calculatePrice(
optionData: { [x: string]: unknown },
data: { [x: string]: unknown },
cart: Cart
): Promise<number> {
throw new Error("Method not implemented.")
}
async createFulfillment(
data: { [x: string]: unknown },
items: LineItem,
order: Order,
fulfillment: Fulfillment
) {
throw new Error("Method not implemented.")
}
async cancelFulfillment(
fulfillment: { [x: string]: unknown }
): Promise<any> {
throw new Error("Method not implemented.")
}
async createReturn(
returnOrder: CreateReturnType
): Promise<Record<string, unknown>> {
throw new Error("Method not implemented.")
}
async getFulfillmentDocuments(
data: { [x: string]: unknown }
): Promise<any> {
throw new Error("Method not implemented.")
}
async getReturnDocuments(
data: Record<string, unknown>
): Promise<any> {
throw new Error("Method not implemented.")
}
async getShipmentDocuments(
data: Record<string, unknown>
): Promise<any> {
throw new Error("Method not implemented.")
}
async retrieveDocuments(
fulfillmentData: Record<string, unknown>,
documentType: "invoice" | "label"
): Promise<any> {
throw new Error("Method not implemented.")
}
}
export default MyFulfillmentService
```
Fulfillment provider services must extend the `AbstractFulfillmentService` class imported from `@medusajs/medusa`.
:::note
Following the naming convention of Services, the name of the file should be the slug name of the fulfillment provider, and the name of the class should be the camel case name of the fulfillment provider suffixed with “Service”. You can learn more in the [service documentation](../../../development/services/create-service.mdx).
:::
### Identifier
As mentioned in the overview, fulfillment providers should have a static `identifier` property.
The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the class will be used when the fulfillment provider is created in the database.
The value of this property will also be used to reference the fulfillment provider throughout Medusa. For example, it is used to [add a fulfillment provider](https://docs.medusajs.com/api/admin#regions_postregionsregionfulfillmentproviders) to a region.
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
static identifier = "my-fulfillment"
// ...
}
```
### constructor
You can use the `constructor` of your fulfillment provider to have access to different services in Medusa through dependency injection. You can access any services you create in Medusa in the first parameter.
You can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party providers APIs, you can initialize it in the constructor and use it in other methods in the service.
Additionally, if youre creating your fulfillment provider as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor. The options are passed as a second parameter.
For example:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
constructor(container, options) {
super()
// you can access options here
}
}
```
### getFulfillmentOptions
This method is used when retrieving the list of fulfillment options available in a region, particularly by the [List Fulfillment Options API Route](https://docs.medusajs.com/api/admin#regions_getregionsregionfulfillmentoptions).
For example, if youre integrating UPS as a fulfillment provider, you might support two fulfillment options: UPS Express Shipping and UPS Access Point. Each of these options can have different data associated with them.
This method is expected to return an array of options. These options don't have any required format.
Later on, these options can be used when creating a shipping option, such as when using the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options_postshippingoptions). The chosen fulfillment option, which is one of the items in the array returned by this method, will be set in the `data` object of the shipping option.
For example:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async getFulfillmentOptions(): Promise<any[]> {
return [
{
id: "my-fulfillment",
},
{
id: "my-fulfillment-dynamic",
},
]
}
}
```
### validateOption
Once the admin creates the shipping option, the data of the shipping option will be validated first using this method. This method is called when the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options_postshippingoptions) is used.
This method accepts the `data` object that is sent in the body of the request, basically, the `data` object of the shipping option. You can use this data to validate the shipping option before it is saved.
This method returns a boolean. If the returned value is `false`, an error is thrown and the shipping option will not be saved.
For example, you can use this method to ensure that the `id` in the `data` object is correct:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async validateOption(
data: { [x: string]: unknown }
): Promise<boolean> {
return data.id == "my-fulfillment"
}
}
```
If your fulfillment provider doesn't need to run any validation, you can simply return `true`.
### validateFulfillmentData
This method is called when a shipping method is created. This typically happens when the customer chooses a shipping option during checkout, when a shipping method is created for an order return, or in other similar cases. The shipping option and its data are validated before the shipping method is created.
This method accepts three parameters:
1. The first parameter is the `data` object of the shipping option selected when creating the shipping method.
2. The second parameter is `data` object passed in the body of the request.
3. The third parameter is an object indicating the customers cart data. It may be empty if the shipping method isn't associated with a cart, such as when it's associated with a claim.
You can use these parameters to validate the chosen shipping option. For example, you can check if the `data` object passed as a second parameter includes all data needed to fulfill the shipment later on.
If any of the data is invalid, you can throw an error. This error will stop Medusa from creating a shipping method and the error message will be returned as a result of the API Route.
If everything is valid, this method must return an object that will be stored in the `data` property of the shipping method to be created. So, make sure the value you return contains everything you need to fulfill the shipment later on.
The returned value may also be used to calculate the price of the shipping method if it doesn't have a set price. It will be passed along to the [calculatePrice](#calculateprice) method.
Here's an example implementation:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async validateFulfillmentData(
optionData: { [x: string]: unknown },
data: { [x: string]: unknown },
cart: Cart
): Promise<Record<string, unknown>> {
if (data.id !== "my-fulfillment") {
throw new Error("invalid data")
}
return {
...data,
}
}
}
```
### createFulfillment
This method is used when a fulfillment is created for an order, a claim, or a swap.
It accepts four parameters:
1. The first parameter is the `data` object of the shipping method associated with the resource, such as the order.
2. The second parameter is the array of line item objects in the order to be fulfilled. The admin can choose all or some of the items to fulfill.
3. The third parameter is an object that includes data related to the order, claim, or swap this fulfillment is being created for.
1. If the resource the fulfillment is being created for is a claim, the `is_claim` property in the object will be `true`.
2. If the resource the fulfillment is being created for is a swap, the `is_swap` property in the object will be `true`.
3. Otherwise, the resource is an order.
4. The fourth parameter is an object of type [Fulfillment](../../../references/entities/classes/Fulfillment.mdx), which is the fulfillment being created.
You can use the `data` property in the shipping method (first parameter) to access the data specific to the shipping option. This is based on your implementation of previous methods.
This method must return an object of data that will be stored in the `data` attribute of the created fulfillment.
Here is a basic implementation of `createFulfillment` for a fulfillment provider that does not interact with any third-party provider to create the fulfillment:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async createFulfillment(
data: { [x: string]: unknown },
items: LineItem,
order: Order,
fulfillment: Fulfillment
) {
// No data is being sent anywhere
// No data to be stored in the fulfillment's data object
return {}
}
}
```
### Useful Methods
The above-detailed methods are the required methods for every fulfillment provider. However, there are additional methods that you can use in your fulfillment provider to customize it further or add additional features.
#### canCalculate
This method is used to determine whether a shipping option is calculated dynamically or flat rate. It is called if the `price_type` of the shipping option being created is set to `calculated`.
This method accepts an object as a parameter, which is the `data` object of the shipping option being created. You can use this data to determine whether the shipping option should be calculated or not. This is useful if the fulfillment provider you are integrating has both flat rate and dynamically priced fulfillment options.
If this method returns `true`, that means that the price can be calculated dynamically and the shipping option can have the `price_type` set to `calculated`. The `amount` property of the shipping option will then be set to `null`. The amount will be created later when the shipping method is created on checkout using the [calculatePrice method](#calculateprice).
If the method returns `false`, an error is thrown as it means the selected shipping option is invalid and it can only have the `flat_rate` price type.
For example:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async canCalculate(
data: { [x: string]: unknown }
): Promise<boolean> {
return data.id === "my-fulfillment-dynamic"
}
}
```
#### calculatePrice
This method is used in different places, including:
1. When the shipping options for a cart are retrieved during checkout. If a shipping option has their `price_type` set to `calculated`, this method is used to set the `amount` of the returned shipping option.
2. When a shipping method is created. If the shipping option associated with the method has their `price_type` set to `calculated`, this method is used to set the `price` attribute of the shipping method in the database.
3. When the cart's totals are calculated.
This method receives three parameters:
1. The first parameter is the `data` object of the selected shipping option.
2. The second parameter is a `data` object that is different based on the context it's used in:
1. If the price is being calculated for the list of shipping options available for a cart, it's the `data` object of the shipping option.
2. If the price is being calculated when the shipping method is being created, it's the data returned by the [validateFulfillmentData](#validatefulfillmentdata) method used during the shipping method creation.
3. If the price is being calculated while calculating the cart's totals, it will be the `data` object of the cart's shipping method.
3. The third parameter is either the [Cart](../../../references/entities/classes/Cart.mdx) or the [Order](../../../references/entities/classes/Order.mdx) object.
The method is expected to return a number that will be used to set the price of the shipping method or option, based on the context it's used in.
If your fulfillment provider does not provide any dynamically calculated rates you can return any static value or throw an error. For example:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async calculatePrice(
optionData: { [x: string]: unknown },
data: { [x: string]: unknown },
cart: Cart
): Promise<number> {
throw new Error("Method not implemented.")
}
}
```
Otherwise, you can use it to calculate the price with custom logic. For example:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async calculatePrice(
optionData: { [x: string]: unknown },
data: { [x: string]: unknown },
cart: Cart
): Promise<number> {
return cart.items.length * 1000
}
}
```
#### createReturn
Fulfillment providers can also be used to return products. A shipping option can be used for returns if the `is_return` property is `true` or if an admin creates a Return Shipping Option from the settings.
This method is used when the admin [creates a return request](https://docs.medusajs.com/api/admin#orders_postordersorderreturns) for an order, [creates a swap](https://docs.medusajs.com/api/admin#orders_postordersorderswaps) for an order, or when the customer [creates a return of their order](https://docs.medusajs.com/api/store#returns_postreturns). The fulfillment is created automatically for the order return.
The method receives as a parameter the [Return](../../../references/entities/classes/Return.mdx) object, which is the return that the fulfillment is being created for.
The method must return an object that will be used to set the value of the `shipping_data` attribute of the return being created.
This is the basic implementation of the method for a fulfillment provider that does not contact with a third-party provider to fulfill the return:
```ts
class MyFulfillmentService extends AbstractFulfillmentService {
// ...
async createReturn(
returnOrder: CreateReturnType
): Promise<Record<string, unknown>> {
return {}
}
}
```
#### cancelFulfillment
This method is called when a fulfillment is cancelled by the admin. This fulfillment can be for an order, a claim, or a swap.
The method receives the `data` attribute of the fulfillment being canceled. The method isn't expected to return any specific data.
This is the basic implementation of the method for a fulfillment provider that doesn't interact with a third-party provider to cancel the fulfillment:
```ts
class MyFulfillmentService extends FulfillmentService {
// ...
async cancelFulfillment(
fulfillment: { [x: string]: unknown }
): Promise<any> {
return {}
}
}
```
#### retrieveDocuments
This method is used to retrieve any documents associated with an order and its fulfillments. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
The method accepts two parameters:
1. The first parameter is the `data` attribute of the order's fulfillment.
2. The second parameter is a string indicating the type of document to retrieve. Possible values are `invoice` and `label`.
There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
For example:
```ts
class MyFulfillmentService extends FulfillmentService {
// ...
async retrieveDocuments(
fulfillmentData: Record<string, unknown>,
documentType: "invoice" | "label"
): Promise<any> {
// assuming you contact a client to
// retrieve the document
return this.client.getDocuments()
}
}
```
#### getFulfillmentDocuments
This method is used to retrieve any documents associated with a fulfillment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
The method accepts the `data` attribute of the fulfillment that you're retrieving the documents for.
There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
For example:
```ts
class MyFulfillmentService extends FulfillmentService {
// ...
async getFulfillmentDocuments(
data: { [x: string]: unknown }
): Promise<any> {
// assuming you contact a client to
// retrieve the document
return this.client.getFulfillmentDocuments()
}
}
```
#### getReturnDocuments
This method is used to retrieve any documents associated with a return. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
The method accepts the `data` attribute of the return that you're retrieving the documents for.
There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
For example:
```ts
class MyFulfillmentService extends FulfillmentService {
// ...
async getReturnDocuments(
data: Record<string, unknown>
): Promise<any> {
// assuming you contact a client to
// retrieve the document
return this.client.getReturnDocuments()
}
}
```
#### getShipmentDocuments
This method is used to retrieve any documents associated with a shipment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
The method accepts the `data` attribute of the shipment that you're retrieving the documents for.
There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
For example:
```ts
class MyFulfillmentService extends FulfillmentService {
// ...
async getShipmentDocuments(
data: Record<string, unknown>
): Promise<any> {
// assuming you contact a client to
// retrieve the document
return this.client.getShipmentDocuments()
}
}
```
---
## See Also
- Example Implementations: [Webshipper plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-fulfillment-webshipper) and the [manual fulfillment plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-fulfillment-manual)
@@ -153,5 +153,5 @@ The `ShippingMethod` instance holds a `price` attribute, which will either b
## See Also
- [Create a Fulfillment Provider](./backend/add-fulfillment-provider.md)
- [Create a Fulfillment Provider](../../references/fulfillment/classes/AbstractFulfillmentService.mdx)
- [Available shipping plugins](https://github.com/medusajs/medusa/tree/master/packages)
@@ -10,7 +10,7 @@ In this document, youll learn about Fulfillments, how theyre used in your
Fulfillments are used to ship items, typically to a customer. Fulfillments can be used in orders, returns, swaps, and more.
Fulfillments are processed within Medusa by a [fulfillment provider](../carts-and-checkout/backend/add-fulfillment-provider.md). The fulfillment provider handles creating, validating, and processing the fulfillment, among other functionalities. Typically, a fulfillment provider would be integrated with a third-party service that handles the actual shipping of the items.
Fulfillments are processed within Medusa by a [fulfillment provider](../../references/fulfillment/classes/AbstractFulfillmentService.mdx). The fulfillment provider handles creating, validating, and processing the fulfillment, among other functionalities. Typically, a fulfillment provider would be integrated with a third-party service that handles the actual shipping of the items.
When a fulfillment is created for one or more item, shipments can then be created for that fulfillment. These shipments can then be tracked using tracking numbers, providing customers and merchants accurate details about a shipment.
@@ -2,6 +2,6 @@ import DocCardList from '@theme/DocCardList';
# Fulfillment Plugins
If you can't find your fulfillment provider, try checking the [Community Plugins Library](https://medusajs.com/plugins/?filters=Shipping&categories=Shipping). You can also [create your own fulfillment provider](../../modules/carts-and-checkout/backend/add-fulfillment-provider.md).
If you can't find your fulfillment provider, try checking the [Community Plugins Library](https://medusajs.com/plugins/?filters=Shipping&categories=Shipping). You can also [create your own fulfillment provider](../../references/fulfillment/classes/AbstractFulfillmentService.mdx).
<DocCardList />
@@ -10,7 +10,7 @@ The scope that the discount should apply to.
## Enumeration Members
#### ITEM
### ITEM
**ITEM** = `"item"`
@@ -18,7 +18,7 @@ The discount should be applied to applicable items in the cart.
___
#### TOTAL
### TOTAL
**TOTAL** = `"total"`
@@ -8,42 +8,42 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
___
#### COMPLETED
### COMPLETED
**COMPLETED** = `"completed"`
___
#### CONFIRMED
### CONFIRMED
**CONFIRMED** = `"confirmed"`
___
#### CREATED
### CREATED
**CREATED** = `"created"`
___
#### FAILED
### FAILED
**FAILED** = `"failed"`
___
#### PRE\_PROCESSED
### PRE\_PROCESSED
**PRE\_PROCESSED** = `"pre_processed"`
___
#### PROCESSING
### PROCESSING
**PROCESSING** = `"processing"`
@@ -8,30 +8,30 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
#### CLAIM
### CLAIM
**CLAIM** = `"claim"`
___
#### DEFAULT
### DEFAULT
**DEFAULT** = `"default"`
___
#### DRAFT\_ORDER
### DRAFT\_ORDER
**DRAFT\_ORDER** = `"draft_order"`
___
#### PAYMENT\_LINK
### PAYMENT\_LINK
**PAYMENT\_LINK** = `"payment_link"`
___
#### SWAP
### SWAP
**SWAP** = `"swap"`
@@ -10,7 +10,7 @@ The claim's fulfillment status.
## Enumeration Members
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The claim's fulfillments are canceled.
___
#### FULFILLED
### FULFILLED
**FULFILLED** = `"fulfilled"`
@@ -26,7 +26,7 @@ The claim's replacement items are fulfilled.
___
#### NOT\_FULFILLED
### NOT\_FULFILLED
**NOT\_FULFILLED** = `"not_fulfilled"`
@@ -34,7 +34,7 @@ The claim's replacement items are not fulfilled.
___
#### PARTIALLY\_FULFILLED
### PARTIALLY\_FULFILLED
**PARTIALLY\_FULFILLED** = `"partially_fulfilled"`
@@ -42,7 +42,7 @@ Some of the claim's replacement items, but not all, are fulfilled.
___
#### PARTIALLY\_RETURNED
### PARTIALLY\_RETURNED
**PARTIALLY\_RETURNED** = `"partially_returned"`
@@ -50,7 +50,7 @@ Some of the claim's items, but not all, are returned.
___
#### PARTIALLY\_SHIPPED
### PARTIALLY\_SHIPPED
**PARTIALLY\_SHIPPED** = `"partially_shipped"`
@@ -58,7 +58,7 @@ Some of the claim's replacement items, but not all, are shipped.
___
#### REQUIRES\_ACTION
### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -66,7 +66,7 @@ The claim's fulfillment requires action.
___
#### RETURNED
### RETURNED
**RETURNED** = `"returned"`
@@ -74,7 +74,7 @@ The claim's items are returned.
___
#### SHIPPED
### SHIPPED
**SHIPPED** = `"shipped"`
@@ -10,7 +10,7 @@ The claim's payment status
## Enumeration Members
#### NA
### NA
**NA** = `"na"`
@@ -18,7 +18,7 @@ The payment status isn't set, which is typically used when the claim's type is `
___
#### NOT\_REFUNDED
### NOT\_REFUNDED
**NOT\_REFUNDED** = `"not_refunded"`
@@ -26,7 +26,7 @@ The payment isn't refunded.
___
#### REFUNDED
### REFUNDED
**REFUNDED** = `"refunded"`
@@ -8,24 +8,24 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
#### MISSING\_ITEM
### MISSING\_ITEM
**MISSING\_ITEM** = `"missing_item"`
___
#### OTHER
### OTHER
**OTHER** = `"other"`
___
#### PRODUCTION\_FAILURE
### PRODUCTION\_FAILURE
**PRODUCTION\_FAILURE** = `"production_failure"`
___
#### WRONG\_ITEM
### WRONG\_ITEM
**WRONG\_ITEM** = `"wrong_item"`
@@ -10,7 +10,7 @@ The claim's type.
## Enumeration Members
#### REFUND
### REFUND
**REFUND** = `"refund"`
@@ -18,7 +18,7 @@ The claim refunds an amount to the customer.
___
#### REPLACE
### REPLACE
**REPLACE** = `"replace"`
@@ -10,7 +10,7 @@ The possible operators used for a discount condition.
## Enumeration Members
#### IN
### IN
**IN** = `"in"`
@@ -18,7 +18,7 @@ The discountable resources are within the specified resources.
___
#### NOT\_IN
### NOT\_IN
**NOT\_IN** = `"not_in"`
@@ -10,7 +10,7 @@ The discount condition's type.
## Enumeration Members
#### CUSTOMER\_GROUPS
### CUSTOMER\_GROUPS
**CUSTOMER\_GROUPS** = `"customer_groups"`
@@ -18,7 +18,7 @@ The discount condition is used for customer groups.
___
#### PRODUCTS
### PRODUCTS
**PRODUCTS** = `"products"`
@@ -26,7 +26,7 @@ The discount condition is used for products.
___
#### PRODUCT\_COLLECTIONS
### PRODUCT\_COLLECTIONS
**PRODUCT\_COLLECTIONS** = `"product_collections"`
@@ -34,7 +34,7 @@ The discount condition is used for product collections.
___
#### PRODUCT\_TAGS
### PRODUCT\_TAGS
**PRODUCT\_TAGS** = `"product_tags"`
@@ -42,7 +42,7 @@ The discount condition is used for product tags.
___
#### PRODUCT\_TYPES
### PRODUCT\_TYPES
**PRODUCT\_TYPES** = `"product_types"`
@@ -10,7 +10,7 @@ The possible types of discount rules.
## Enumeration Members
#### FIXED
### FIXED
**FIXED** = `"fixed"`
@@ -18,7 +18,7 @@ Discounts that reduce the price by a fixed amount.
___
#### FREE\_SHIPPING
### FREE\_SHIPPING
**FREE\_SHIPPING** = `"free_shipping"`
@@ -26,7 +26,7 @@ Discounts that sets the shipping price to `0`.
___
#### PERCENTAGE
### PERCENTAGE
**PERCENTAGE** = `"percentage"`
@@ -10,7 +10,7 @@ The draft order's status.
## Enumeration Members
#### COMPLETED
### COMPLETED
**COMPLETED** = `"completed"`
@@ -18,7 +18,7 @@ The draft order is completed, and an order has been created from it.
___
#### OPEN
### OPEN
**OPEN** = `"open"`
@@ -10,7 +10,7 @@ The order's fulfillment status.
## Enumeration Members
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The order's fulfillments are canceled.
___
#### FULFILLED
### FULFILLED
**FULFILLED** = `"fulfilled"`
@@ -26,7 +26,7 @@ The order's items are fulfilled.
___
#### NOT\_FULFILLED
### NOT\_FULFILLED
**NOT\_FULFILLED** = `"not_fulfilled"`
@@ -34,7 +34,7 @@ The order's items are not fulfilled.
___
#### PARTIALLY\_FULFILLED
### PARTIALLY\_FULFILLED
**PARTIALLY\_FULFILLED** = `"partially_fulfilled"`
@@ -42,7 +42,7 @@ Some of the order's items, but not all, are fulfilled.
___
#### PARTIALLY\_RETURNED
### PARTIALLY\_RETURNED
**PARTIALLY\_RETURNED** = `"partially_returned"`
@@ -50,7 +50,7 @@ Some of the order's items, but not all, are returned.
___
#### PARTIALLY\_SHIPPED
### PARTIALLY\_SHIPPED
**PARTIALLY\_SHIPPED** = `"partially_shipped"`
@@ -58,7 +58,7 @@ Some of the order's items, but not all, are shipped.
___
#### REQUIRES\_ACTION
### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -66,7 +66,7 @@ The order's fulfillment requires action.
___
#### RETURNED
### RETURNED
**RETURNED** = `"returned"`
@@ -74,7 +74,7 @@ The order's items are returned.
___
#### SHIPPED
### SHIPPED
**SHIPPED** = `"shipped"`
@@ -10,7 +10,7 @@ The type of the order edit item change.
## Enumeration Members
#### ITEM\_ADD
### ITEM\_ADD
**ITEM\_ADD** = `"item_add"`
@@ -18,7 +18,7 @@ A new item to be added to the original order.
___
#### ITEM\_REMOVE
### ITEM\_REMOVE
**ITEM\_REMOVE** = `"item_remove"`
@@ -26,7 +26,7 @@ An existing item to be removed from the original order.
___
#### ITEM\_UPDATE
### ITEM\_UPDATE
**ITEM\_UPDATE** = `"item_update"`
@@ -10,7 +10,7 @@ The order edit's status.
## Enumeration Members
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The order edit is canceled.
___
#### CONFIRMED
### CONFIRMED
**CONFIRMED** = `"confirmed"`
@@ -26,7 +26,7 @@ The order edit is confirmed.
___
#### CREATED
### CREATED
**CREATED** = `"created"`
@@ -34,7 +34,7 @@ The order edit is created.
___
#### DECLINED
### DECLINED
**DECLINED** = `"declined"`
@@ -42,7 +42,7 @@ The order edit is declined.
___
#### REQUESTED
### REQUESTED
**REQUESTED** = `"requested"`
@@ -10,7 +10,7 @@ The order's status.
## Enumeration Members
#### ARCHIVED
### ARCHIVED
**ARCHIVED** = `"archived"`
@@ -18,7 +18,7 @@ The order is archived.
___
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -26,7 +26,7 @@ The order is canceled.
___
#### COMPLETED
### COMPLETED
**COMPLETED** = `"completed"`
@@ -36,7 +36,7 @@ has been captured.
___
#### PENDING
### PENDING
**PENDING** = `"pending"`
@@ -44,7 +44,7 @@ The order is pending.
___
#### REQUIRES\_ACTION
### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -10,7 +10,7 @@ The payment collection's status.
## Enumeration Members
#### AUTHORIZED
### AUTHORIZED
**AUTHORIZED** = `"authorized"`
@@ -18,7 +18,7 @@ The payment colleciton is authorized.
___
#### AWAITING
### AWAITING
**AWAITING** = `"awaiting"`
@@ -26,7 +26,7 @@ The payment collection is awaiting payment.
___
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -34,7 +34,7 @@ The payment collection is canceled.
___
#### NOT\_PAID
### NOT\_PAID
**NOT\_PAID** = `"not_paid"`
@@ -42,7 +42,7 @@ The payment collection isn't paid.
___
#### PARTIALLY\_AUTHORIZED
### PARTIALLY\_AUTHORIZED
**PARTIALLY\_AUTHORIZED** = `"partially_authorized"`
@@ -10,7 +10,7 @@ The payment collection's type.
## Enumeration Members
#### ORDER\_EDIT
### ORDER\_EDIT
**ORDER\_EDIT** = `"order_edit"`
@@ -8,30 +8,30 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
#### AUTHORIZED
### AUTHORIZED
**AUTHORIZED** = `"authorized"`
___
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
___
#### ERROR
### ERROR
**ERROR** = `"error"`
___
#### PENDING
### PENDING
**PENDING** = `"pending"`
___
#### REQUIRES\_MORE
### REQUIRES\_MORE
**REQUIRES\_MORE** = `"requires_more"`
@@ -10,7 +10,7 @@ The order's payment status.
## Enumeration Members
#### AWAITING
### AWAITING
**AWAITING** = `"awaiting"`
@@ -18,7 +18,7 @@ The order's payment is awaiting capturing.
___
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -26,7 +26,7 @@ The order's payment is canceled.
___
#### CAPTURED
### CAPTURED
**CAPTURED** = `"captured"`
@@ -34,7 +34,7 @@ The order's payment is captured.
___
#### NOT\_PAID
### NOT\_PAID
**NOT\_PAID** = `"not_paid"`
@@ -42,7 +42,7 @@ The order's payment is not paid.
___
#### PARTIALLY\_REFUNDED
### PARTIALLY\_REFUNDED
**PARTIALLY\_REFUNDED** = `"partially_refunded"`
@@ -50,7 +50,7 @@ Some of the order's payment amount is refunded.
___
#### REFUNDED
### REFUNDED
**REFUNDED** = `"refunded"`
@@ -58,7 +58,7 @@ The order's payment amount is refunded.
___
#### REQUIRES\_ACTION
### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -8,12 +8,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
#### ACTIVE
### ACTIVE
**ACTIVE** = `"active"`
___
#### DRAFT
### DRAFT
**DRAFT** = `"draft"`
@@ -8,12 +8,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
#### OVERRIDE
### OVERRIDE
**OVERRIDE** = `"override"`
___
#### SALE
### SALE
**SALE** = `"sale"`
@@ -10,7 +10,7 @@ The status of a product.
## Enumeration Members
#### DRAFT
### DRAFT
**DRAFT** = `"draft"`
@@ -18,7 +18,7 @@ The product is a draft. It's not viewable by customers.
___
#### PROPOSED
### PROPOSED
**PROPOSED** = `"proposed"`
@@ -26,7 +26,7 @@ The product is proposed, but not yet published.
___
#### PUBLISHED
### PUBLISHED
**PUBLISHED** = `"published"`
@@ -34,7 +34,7 @@ The product is published.
___
#### REJECTED
### REJECTED
**REJECTED** = `"rejected"`
@@ -10,7 +10,7 @@ The reason of the refund.
## Enumeration Members
#### CLAIM
### CLAIM
**CLAIM** = `"claim"`
@@ -18,7 +18,7 @@ The refund is applied because of a created claim.
___
#### DISCOUNT
### DISCOUNT
**DISCOUNT** = `"discount"`
@@ -26,7 +26,7 @@ The refund is applied as a discount.
___
#### OTHER
### OTHER
**OTHER** = `"other"`
@@ -34,7 +34,7 @@ The refund is created for a custom reason.
___
#### RETURN
### RETURN
**RETURN** = `"return"`
@@ -42,7 +42,7 @@ The refund is applied because of a created return.
___
#### SWAP
### SWAP
**SWAP** = `"swap"`
@@ -10,7 +10,7 @@ The type of shipping option requirement.
## Enumeration Members
#### MAX\_SUBTOTAL
### MAX\_SUBTOTAL
**MAX\_SUBTOTAL** = `"max_subtotal"`
@@ -18,7 +18,7 @@ The shipping option can only be applied if the subtotal is less than the require
___
#### MIN\_SUBTOTAL
### MIN\_SUBTOTAL
**MIN\_SUBTOTAL** = `"min_subtotal"`
@@ -10,7 +10,7 @@ The return's status.
## Enumeration Members
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The return is canceled.
___
#### RECEIVED
### RECEIVED
**RECEIVED** = `"received"`
@@ -26,7 +26,7 @@ The return is received.
___
#### REQUESTED
### REQUESTED
**REQUESTED** = `"requested"`
@@ -34,7 +34,7 @@ The return is requested.
___
#### REQUIRES\_ACTION
### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -10,7 +10,7 @@ The type of the shipping option price.
## Enumeration Members
#### CALCULATED
### CALCULATED
**CALCULATED** = `"calculated"`
@@ -18,7 +18,7 @@ The shipping option's price is calculated. In this case, the `amount` field is t
___
#### FLAT\_RATE
### FLAT\_RATE
**FLAT\_RATE** = `"flat_rate"`
@@ -10,7 +10,7 @@ The shipping profile's type.
## Enumeration Members
#### CUSTOM
### CUSTOM
**CUSTOM** = `"custom"`
@@ -18,7 +18,7 @@ The profile used to ship custom items.
___
#### DEFAULT
### DEFAULT
**DEFAULT** = `"default"`
@@ -26,7 +26,7 @@ The default profile used to ship item.
___
#### GIFT\_CARD
### GIFT\_CARD
**GIFT\_CARD** = `"gift_card"`
@@ -10,7 +10,7 @@ The swap's fulfillment status.
## Enumeration Members
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The swap's fulfillments are canceled.
___
#### FULFILLED
### FULFILLED
**FULFILLED** = `"fulfilled"`
@@ -26,7 +26,7 @@ The swap's items are fulfilled.
___
#### NOT\_FULFILLED
### NOT\_FULFILLED
**NOT\_FULFILLED** = `"not_fulfilled"`
@@ -34,7 +34,7 @@ The swap's items aren't fulfilled.
___
#### PARTIALLY\_SHIPPED
### PARTIALLY\_SHIPPED
**PARTIALLY\_SHIPPED** = `"partially_shipped"`
@@ -42,7 +42,7 @@ Some of the swap's items are shipped.
___
#### REQUIRES\_ACTION
### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -50,7 +50,7 @@ The swap's fulfillments require an action.
___
#### SHIPPED
### SHIPPED
**SHIPPED** = `"shipped"`
@@ -10,7 +10,7 @@ The swap's payment status.
## Enumeration Members
#### AWAITING
### AWAITING
**AWAITING** = `"awaiting"`
@@ -18,7 +18,7 @@ The swap is additional awaiting payment.
___
#### CANCELED
### CANCELED
**CANCELED** = `"canceled"`
@@ -26,7 +26,7 @@ The swap's additional payment is canceled.
___
#### CAPTURED
### CAPTURED
**CAPTURED** = `"captured"`
@@ -34,7 +34,7 @@ The swap's additional payment is captured.
___
#### CONFIRMED
### CONFIRMED
**CONFIRMED** = `"confirmed"`
@@ -42,7 +42,7 @@ The swap's additional payment is confirmed.
___
#### DIFFERENCE\_REFUNDED
### DIFFERENCE\_REFUNDED
**DIFFERENCE\_REFUNDED** = `"difference_refunded"`
@@ -50,7 +50,7 @@ The negative difference amount between the returned item(s) and the new one(s) h
___
#### NOT\_PAID
### NOT\_PAID
**NOT\_PAID** = `"not_paid"`
@@ -58,7 +58,7 @@ The swap's additional payment isn't paid.
___
#### PARTIALLY\_REFUNDED
### PARTIALLY\_REFUNDED
**PARTIALLY\_REFUNDED** = `"partially_refunded"`
@@ -66,7 +66,7 @@ Some of the negative difference amount between the returned item(s) and the new
___
#### REFUNDED
### REFUNDED
**REFUNDED** = `"refunded"`
@@ -74,7 +74,7 @@ The amount in the associated order has been refunded.
___
#### REQUIRES\_ACTION
### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -10,7 +10,7 @@ The user's role. These roles don't change the user's capabilities or provide acc
## Enumeration Members
#### ADMIN
### ADMIN
**ADMIN** = `"admin"`
@@ -18,7 +18,7 @@ The user is an admin.
___
#### DEVELOPER
### DEVELOPER
**DEVELOPER** = `"developer"`
@@ -26,7 +26,7 @@ The user is a developer.
___
#### MEMBER
### MEMBER
**MEMBER** = `"member"`
@@ -135,13 +135,15 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
- [BatchJobResultStatDescriptor](types/BatchJobResultStatDescriptor.mdx)
- [Record](types/Record.mdx)
___
## Functions
#### Boolean
### Boolean
`**Boolean**<TypeParameter T>(value?): boolean`
##### Type Parameters
#### Type Parameters
<ParameterTypes parameters={[
{
@@ -155,7 +157,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
}
]} />
##### Parameters
#### Parameters
<ParameterTypes parameters={[
{
@@ -169,7 +171,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
}
]} />
##### Returns
#### Returns
`boolean`
@@ -8,11 +8,11 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
**BatchJobResultError**: `Object`
#### Index signature
## Index signature
▪ [key: `string`]: `unknown`
#### Type declaration
## Type declaration
<ParameterTypes parameters={[
{
@@ -8,7 +8,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
**BatchJobResultStatDescriptor**: `Object`
#### Type declaration
## Type declaration
<ParameterTypes parameters={[
{
@@ -10,7 +10,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
Construct a type with a set of properties K of type T
#### Type Parameters
## Type Parameters
<ParameterTypes parameters={[
{
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
@@ -0,0 +1,180 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Fulfillment Provider Reference
## Enumerations
- [AllocationType](enums/AllocationType.mdx)
- [CartType](enums/CartType.mdx)
- [ClaimFulfillmentStatus](enums/ClaimFulfillmentStatus.mdx)
- [ClaimPaymentStatus](enums/ClaimPaymentStatus.mdx)
- [ClaimReason](enums/ClaimReason.mdx)
- [ClaimType](enums/ClaimType.mdx)
- [DiscountConditionOperator](enums/DiscountConditionOperator.mdx)
- [DiscountConditionType](enums/DiscountConditionType.mdx)
- [DiscountRuleType](enums/DiscountRuleType.mdx)
- [DraftOrderStatus](enums/DraftOrderStatus.mdx)
- [FulfillmentStatus](enums/FulfillmentStatus.mdx)
- [OrderEditItemChangeType](enums/OrderEditItemChangeType.mdx)
- [OrderEditStatus](enums/OrderEditStatus.mdx)
- [OrderStatus](enums/OrderStatus.mdx)
- [PaymentCollectionStatus](enums/PaymentCollectionStatus.mdx)
- [PaymentStatus](enums/PaymentStatus.mdx)
- [PriceListStatus](enums/PriceListStatus.mdx)
- [PriceListType](enums/PriceListType.mdx)
- [ProductStatus](enums/ProductStatus.mdx)
- [RequirementType](enums/RequirementType.mdx)
- [ReturnStatus](enums/ReturnStatus.mdx)
- [ShippingOptionPriceType](enums/ShippingOptionPriceType.mdx)
- [ShippingProfileType](enums/ShippingProfileType.mdx)
- [SwapFulfillmentStatus](enums/SwapFulfillmentStatus.mdx)
- [SwapPaymentStatus](enums/SwapPaymentStatus.mdx)
## Classes
- [AbstractFulfillmentService](classes/AbstractFulfillmentService.mdx)
- [Address](classes/Address.mdx)
- [BaseEntity](classes/BaseEntity.mdx)
- [Cart](classes/Cart.mdx)
- [ClaimImage](classes/ClaimImage.mdx)
- [ClaimItem](classes/ClaimItem.mdx)
- [ClaimOrder](classes/ClaimOrder.mdx)
- [ClaimTag](classes/ClaimTag.mdx)
- [Country](classes/Country.mdx)
- [Currency](classes/Currency.mdx)
- [Customer](classes/Customer.mdx)
- [CustomerGroup](classes/CustomerGroup.mdx)
- [Discount](classes/Discount.mdx)
- [DiscountCondition](classes/DiscountCondition.mdx)
- [DiscountRule](classes/DiscountRule.mdx)
- [DraftOrder](classes/DraftOrder.mdx)
- [Fulfillment](classes/Fulfillment.mdx)
- [FulfillmentItem](classes/FulfillmentItem.mdx)
- [FulfillmentProvider](classes/FulfillmentProvider.mdx)
- [GiftCard](classes/GiftCard.mdx)
- [GiftCardTransaction](classes/GiftCardTransaction.mdx)
- [Image](classes/Image.mdx)
- [LineItem](classes/LineItem.mdx)
- [LineItemAdjustment](classes/LineItemAdjustment.mdx)
- [LineItemTaxLine](classes/LineItemTaxLine.mdx)
- [MoneyAmount](classes/MoneyAmount.mdx)
- [Order](classes/Order.mdx)
- [OrderEdit](classes/OrderEdit.mdx)
- [OrderItemChange](classes/OrderItemChange.mdx)
- [Payment](classes/Payment.mdx)
- [PaymentCollection](classes/PaymentCollection.mdx)
- [PaymentProvider](classes/PaymentProvider.mdx)
- [PaymentSession](classes/PaymentSession.mdx)
- [PriceList](classes/PriceList.mdx)
- [Product](classes/Product.mdx)
- [ProductCategory](classes/ProductCategory.mdx)
- [ProductCollection](classes/ProductCollection.mdx)
- [ProductOption](classes/ProductOption.mdx)
- [ProductOptionValue](classes/ProductOptionValue.mdx)
- [ProductTag](classes/ProductTag.mdx)
- [ProductType](classes/ProductType.mdx)
- [ProductVariant](classes/ProductVariant.mdx)
- [ProductVariantInventoryItem](classes/ProductVariantInventoryItem.mdx)
- [Refund](classes/Refund.mdx)
- [Region](classes/Region.mdx)
- [Return](classes/Return.mdx)
- [ReturnItem](classes/ReturnItem.mdx)
- [ReturnReason](classes/ReturnReason.mdx)
- [SalesChannel](classes/SalesChannel.mdx)
- [SalesChannelLocation](classes/SalesChannelLocation.mdx)
- [ShippingMethod](classes/ShippingMethod.mdx)
- [ShippingMethodTaxLine](classes/ShippingMethodTaxLine.mdx)
- [ShippingOption](classes/ShippingOption.mdx)
- [ShippingOptionRequirement](classes/ShippingOptionRequirement.mdx)
- [ShippingProfile](classes/ShippingProfile.mdx)
- [SoftDeletableEntity](classes/SoftDeletableEntity.mdx)
- [Swap](classes/Swap.mdx)
- [TaxLine](classes/TaxLine.mdx)
- [TaxProvider](classes/TaxProvider.mdx)
- [TaxRate](classes/TaxRate.mdx)
- [TrackingLink](classes/TrackingLink.mdx)
## Interfaces
- [Boolean](interfaces/Boolean.mdx)
- [FulfillmentService](interfaces/FulfillmentService.mdx)
## Type Aliases
- [CreateReturnType](types/CreateReturnType.mdx)
- [Exclude](types/Exclude.mdx)
- [FulfillmentProviderData](types/FulfillmentProviderData.mdx)
- [MedusaContainer](types/MedusaContainer.mdx)
- [Omit](types/Omit.mdx)
- [Pick](types/Pick.mdx)
- [Record](types/Record.mdx)
- [ShippingMethodData](types/ShippingMethodData.mdx)
- [ShippingOptionData](types/ShippingOptionData.mdx)
## References
### default
Renames and re-exports [AbstractFulfillmentService](classes/AbstractFulfillmentService.mdx)
___
## Enumeration Members
### ORDER\_EDIT
**ORDER\_EDIT**: `"order_edit"`
The payment collection is used for an order edit.
___
## Functions
### Boolean
#### Type Parameters
<ParameterTypes parameters={[
{
"name": "T",
"type": "`object`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
#### Parameters
<ParameterTypes parameters={[
{
"name": "value",
"type": "`T`",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
#### Returns
<ParameterTypes parameters={[
{
"name": "boolean",
"type": "`boolean`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Address
An address is used across the Medusa backend within other schemas and object types. For example, a customer's billing and shipping addresses both use the Address entity.
## constructor
An address is used across the Medusa backend within other schemas and object types. For example, a customer's billing and shipping addresses both use the Address entity.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,11 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# BaseEntity
Base abstract entity for all entities
## constructor
@@ -0,0 +1,51 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Cart
A cart represents a virtual shopping bag. It can be used to complete an order, a swap, or a claim.
## constructor
A cart represents a virtual shopping bag. It can be used to complete an order, a swap, or a claim.
___
## Methods
### afterLoad
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ClaimImage
The details of an image attached to a claim.
## constructor
The details of an image attached to a claim.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ClaimItem
A claim item is an item created as part of a claim. It references an item in the order that should be exchanged or refunded.
## constructor
A claim item is an item created as part of a claim. It references an item in the order that should be exchanged or refunded.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ClaimOrder
A Claim represents a group of faulty or missing items. It consists of claim items that refer to items in the original order that should be replaced or refunded. It also includes details related to shipping and fulfillment.
## constructor
A Claim represents a group of faulty or missing items. It consists of claim items that refer to items in the original order that should be replaced or refunded. It also includes details related to shipping and fulfillment.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ClaimTag
Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping.
## constructor
Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Country
Country details
## constructor
Country details
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Currency
Currency
## constructor
Currency
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Customer
A customer can make purchases in your store and manage their profile.
## constructor
A customer can make purchases in your store and manage their profile.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# CustomerGroup
A customer group that can be used to organize customers into groups of similar traits.
## constructor
A customer group that can be used to organize customers into groups of similar traits.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Discount
A discount can be applied to a cart for promotional purposes.
## constructor
A discount can be applied to a cart for promotional purposes.
___
## Methods
### upperCaseCodeAndTrim
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# DiscountCondition
Holds rule conditions for when a discount is applicable
## constructor
Holds rule conditions for when a discount is applicable
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# DiscountRule
A discount rule defines how a Discount is calculated when applied to a Cart.
## constructor
A discount rule defines how a Discount is calculated when applied to a Cart.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# DraftOrder
A draft order is created by an admin without direct involvement of the customer. Once its payment is marked as captured, it is transformed into an order.
## constructor
A draft order is created by an admin without direct involvement of the customer. Once its payment is marked as captured, it is transformed into an order.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "Promise",
"type": "Promise&#60;void&#62;",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Fulfillment
A Fulfillment is created once an admin can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a fulfillment provider, which typically integrates a third-party shipping service. Fulfillments can be associated with orders, claims, swaps, and returns.
## constructor
A Fulfillment is created once an admin can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a fulfillment provider, which typically integrates a third-party shipping service. Fulfillments can be associated with orders, claims, swaps, and returns.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# FulfillmentItem
This represents the association between a Line Item and a Fulfillment.
## constructor
This represents the association between a Line Item and a Fulfillment.
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# FulfillmentProvider
A fulfillment provider represents a fulfillment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the fulfillment service's installation status.
## constructor
A fulfillment provider represents a fulfillment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the fulfillment service's installation status.
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# GiftCard
Gift Cards are redeemable and represent a value that can be used towards the payment of an Order.
## constructor
Gift Cards are redeemable and represent a value that can be used towards the payment of an Order.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# GiftCardTransaction
Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order.
## constructor
Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Image
An Image is used to store details about uploaded images. Images are uploaded by the File Service, and the URL is provided by the File Service.
## constructor
An Image is used to store details about uploaded images. Images are uploaded by the File Service, and the URL is provided by the File Service.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,69 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# LineItem
Line Items are created when a product is added to a Cart. When Line Items are purchased they will get copied to the resulting order, swap, or claim, and can eventually be referenced in Fulfillments and Returns. Line items may also be used for order edits.
## constructor
Line Items are created when a product is added to a Cart. When Line Items are purchased they will get copied to the resulting order, swap, or claim, and can eventually be referenced in Fulfillments and Returns. Line items may also be used for order edits.
___
## Methods
### afterUpdateOrLoad
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### beforeUpdate
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# LineItemAdjustment
A Line Item Adjustment includes details on discounts applied on a line item.
## constructor
A Line Item Adjustment includes details on discounts applied on a line item.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# LineItemTaxLine
A Line Item Tax Line represents the taxes applied on a line item.
## constructor
A Line Item Tax Line represents the taxes applied on a line item.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,69 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# MoneyAmount
A Money Amount represent a price amount, for example, a product variant's price or a price in a price list. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used, the amount will be in the currency defined for the Region.
## constructor
A Money Amount represent a price amount, for example, a product variant's price or a price in a price list. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used, the amount will be in the currency defined for the Region.
___
## Methods
### afterLoad
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "undefined \\| void",
"type": "`undefined` \\| `void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### beforeUpdate
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Order
An order is a purchase made by a customer. It holds details about payment and fulfillment of the order. An order may also be created from a draft order, which is created by an admin user.
## constructor
An order is a purchase made by a customer. It holds details about payment and fulfillment of the order. An order may also be created from a draft order, which is created by an admin user.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "Promise",
"type": "Promise&#60;void&#62;",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,51 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# OrderEdit
Order edit allows modifying items in an order, such as adding, updating, or deleting items from the original order. Once the order edit is confirmed, the changes are reflected on the original order.
## constructor
Order edit allows modifying items in an order, such as adding, updating, or deleting items from the original order. Once the order edit is confirmed, the changes are reflected on the original order.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### loadStatus
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# OrderItemChange
An order item change is a change made within an order edit to an order's items. These changes are not reflected on the original order until the order edit is confirmed.
## constructor
An order item change is a change made within an order edit to an order's items. These changes are not reflected on the original order until the order edit is confirmed.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Payment
A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources.
## constructor
A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# PaymentCollection
A payment collection allows grouping and managing a list of payments at one. This can be helpful when making additional payment for order edits or integrating installment payments.
## constructor
A payment collection allows grouping and managing a list of payments at one. This can be helpful when making additional payment for order edits or integrating installment payments.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# PaymentProvider
A payment provider represents a payment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the payment service's installation status.
## constructor
A payment provider represents a payment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the payment service's installation status.
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# PaymentSession
A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
## constructor
A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# PriceList
A Price List represents a set of prices that override the default price for one or more product variants.
## constructor
A Price List represents a set of prices that override the default price for one or more product variants.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "undefined \\| void",
"type": "`undefined` \\| `void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,69 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Product
A product is a saleable item that holds general information such as name or description. It must include at least one Product Variant, where each product variant defines different options to purchase the product with (for example, different sizes or colors). The prices and inventory of the product are defined on the variant level.
## constructor
A product is a saleable item that holds general information such as name or description. It must include at least one Product Variant, where each product variant defines different options to purchase the product with (for example, different sizes or colors). The prices and inventory of the product are defined on the variant level.
___
## Methods
### afterLoad
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### beforeUpdate
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductCategory
A product category can be used to categorize products into a hierarchy of categories.
## constructor
A product category can be used to categorize products into a hierarchy of categories.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductCollection
A Product Collection allows grouping together products for promotional purposes. For example, an admin can create a Summer collection, add products to it, and showcase it on the storefront.
## constructor
A Product Collection allows grouping together products for promotional purposes. For example, an admin can create a Summer collection, add products to it, and showcase it on the storefront.
___
## Methods
### createHandleIfNotProvided
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductOption
A Product Option defines properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color". Admins are free to create any product options.
## constructor
A Product Option defines properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color". Admins are free to create any product options.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductOptionValue
An option value is one of the possible values of a Product Option. Product Variants specify a unique combination of product option values.
## constructor
An option value is one of the possible values of a Product Option. Product Variants specify a unique combination of product option values.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductTag
A Product Tag can be added to Products for easy filtering and grouping.
## constructor
A Product Tag can be added to Products for easy filtering and grouping.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductType
A Product Type can be added to Products for filtering and reporting purposes.
## constructor
A Product Type can be added to Products for filtering and reporting purposes.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductVariant
A Product Variant represents a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. A product must at least have one product variant.
## constructor
A Product Variant represents a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. A product must at least have one product variant.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ProductVariantInventoryItem
A Product Variant Inventory Item links variants with inventory items and denotes the required quantity of the variant.
## constructor
A Product Variant Inventory Item links variants with inventory items and denotes the required quantity of the variant.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Refund
A refund represents an amount of money transfered back to the customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by an admin for an order.
## constructor
A refund represents an amount of money transfered back to the customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by an admin for an order.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Region
A region holds settings specific to a geographical location, including the currency, tax rates, and fulfillment and payment providers. A Region can consist of multiple countries to accomodate common shopping settings across countries.
## constructor
A region holds settings specific to a geographical location, including the currency, tax rates, and fulfillment and payment providers. A Region can consist of multiple countries to accomodate common shopping settings across countries.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Return
A Return holds information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can also be used as part of a Swap or a Claim.
## constructor
A Return holds information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can also be used as part of a Swap or a Claim.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ReturnItem
A return item represents a line item in an order that is to be returned. It includes details related to the return and the reason behind it.
## constructor
A return item represents a line item in an order that is to be returned. It includes details related to the return and the reason behind it.
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ReturnReason
A Return Reason is a value defined by an admin. It can be used on Return Items in order to indicate why a Line Item was returned.
## constructor
A Return Reason is a value defined by an admin. It can be used on Return Items in order to indicate why a Line Item was returned.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# SalesChannel
A Sales Channel is a method a business offers its products for purchase for the customers. For example, a Webshop can be a sales channel, and a mobile app can be another.
## constructor
A Sales Channel is a method a business offers its products for purchase for the customers. For example, a Webshop can be a sales channel, and a mobile app can be another.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# SalesChannelLocation
This represents the association between a sales channel and a stock locations.
## constructor
This represents the association between a sales channel and a stock locations.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
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.
## constructor
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.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ShippingMethodTaxLine
A Shipping Method Tax Line represents the taxes applied on a shipping method in a cart.
## constructor
A Shipping Method Tax Line represents the taxes applied on a shipping method in a cart.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ShippingOption
A Shipping Option represents a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information.
## constructor
A Shipping Option represents a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ShippingOptionRequirement
A shipping option requirement defines conditions that a Cart must satisfy for the Shipping Option to be available for usage in the Cart.
## constructor
A shipping option requirement defines conditions that a Cart must satisfy for the Shipping Option to be available for usage in the Cart.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ShippingProfile
A Shipping Profile has a set of defined Shipping Options that can be used to fulfill a given set of Products. For example, gift cards are shipped differently than physical products, so a shipping profile with the type `gift\_card` groups together the shipping options that can only be used for gift cards.
## constructor
A Shipping Profile has a set of defined Shipping Options that can be used to fulfill a given set of Products. For example, gift cards are shipped differently than physical products, so a shipping profile with the type `gift\_card` groups together the shipping options that can only be used for gift cards.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,11 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# SoftDeletableEntity
Base abstract entity for all entities
## constructor
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Swap
A swap can be created when a Customer wishes to exchange Products that they have purchased with different Products. It consists of a Return of previously purchased Products and a Fulfillment of new Products. It also includes information on any additional payment or refund required based on the difference between the exchanged products.
## constructor
A swap can be created when a Customer wishes to exchange Products that they have purchased with different Products. It consists of a Return of previously purchased Products and a Fulfillment of new Products. It also includes information on any additional payment or refund required based on the difference between the exchanged products.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# TaxLine
A tax line represents the taxes amount applied to a line item.
## constructor
A tax line represents the taxes amount applied to a line item.
@@ -0,0 +1,13 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# TaxProvider
A tax provider represents a tax service installed in the Medusa backend, either through a plugin or backend customizations. It holds the tax service's installation status.
## constructor
A tax provider represents a tax service installed in the Medusa backend, either through a plugin or backend customizations. It holds the tax service's installation status.
@@ -0,0 +1,33 @@
---
displayed_sidebar: modules
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# TaxRate
A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region.
## constructor
A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region.
___
## Methods
### beforeInsert
#### Returns
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />

Some files were not shown because too many files have changed in this diff Show More