--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # FulfillmentService Handles Fulfillments ## constructor ### Parameters ___ ## Properties `","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__moduleDeclaration__","type":"`Record`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} /> ___ ## Accessors ### activeManager\_ #### Returns ___ ## Methods ### atomicPhase\_ Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. #### Type Parameters #### Parameters Promise<TResult>","description":"the transactional work to be done","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationOrErrorHandler","type":"`IsolationLevel` \\| (`error`: TError) => Promise<void \\| TResult>","description":"the isolation level to be used for the work.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maybeErrorHandlerOrDontFail","type":"(`error`: TError) => Promise<void \\| TResult>","description":"Potential error handler","optional":true,"defaultValue":"","expandable":false,"children":[]}]} /> #### Returns ___ ### cancelFulfillment Cancels a fulfillment with the fulfillment provider. Will decrement the fulfillment\_quantity on the line items associated with the fulfillment. Throws if the fulfillment has already been shipped. #### Parameters #### Returns ___ ### createFulfillment Creates an order fulfillment If items needs to be fulfilled by different provider, we make sure to partition those items, and create fulfillment for those partitions. #### Parameters #### Returns ___ ### createShipment Creates a shipment by marking a fulfillment as shipped. Adds tracking links and potentially more metadata. #### Parameters #### Returns ___ ### getFulfillmentItems\_ Retrieves the order line items, given an array of items. #### Parameters #### Returns ___ ### partitionItems\_ #### Parameters #### Returns ___ ### retrieve Retrieves a fulfillment by its id. #### Parameters #### Returns ___ ### shouldRetryTransaction\_ #### Parameters ` \\| `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} /> #### Returns ___ ### validateFulfillmentLineItem\_ Checks that a given quantity of a line item can be fulfilled. Fails if the fulfillable quantity is lower than the requested fulfillment quantity. Fulfillable quantity is calculated by subtracting the already fulfilled quantity from the quantity that was originally purchased. #### Parameters #### Returns ___ ### withTransaction #### Parameters #### Returns