Back to Medusa

validateFulfillmentOption - Fulfillment Module Reference

www/apps/resources/references/fulfillment/IFulfillmentModuleService/methods/fulfillment.IFulfillmentModuleService.validateFulfillmentOption/page.mdx

2.14.21.6 KB
Original Source

import { TypeList } from "docs-ui"

validateFulfillmentOption - Fulfillment Module Reference

This documentation provides a reference to the validateFulfillmentOption method. This belongs to the Fulfillment Module.

<Note>

You should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

</Note>

This method validates a fulfillment option with the provider it belongs to.

Example

ts
const isValid =
  await fulfillmentModuleService.validateFulfillmentOption(
    "webshipper",
    {
      code: "express",
    }
  )

Parameters

<TypeList types={[{"name":"providerId","type":"string","description":"The fulfillment provider's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"Record<string, unknown>","description":"The fulfillment option to validate.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="validateFulfillmentOption"/>

Returns

<TypeList types={[{"name":"Promise","type":"Promise<boolean>","optional":false,"defaultValue":"","description":"Whether the fulfillment option is valid with the specified provider.","expandable":false,"children":[{"name":"boolean","type":"boolean","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="validateFulfillmentOption"/>