Skip to main content
Skip to main content

FulfillmentProviderService

Helps retrieve fulfillment providers

Properties

__configModule__Record<string, unknown>
__container__anyRequired
__moduleDeclaration__Record<string, unknown>
fulfillmentProviderRepository_Repository<FulfillmentProvider>Required
manager_EntityManagerRequired
transactionManager_undefined | EntityManagerRequired

Accessors

activeManager_

Inherited from

TransactionBaseService.activeManager_

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.

Parameters
work(transactionManager: EntityManager) => Promise<TResult>Required
the transactional work to be done
isolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>
the isolation level to be used for the work.
maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>
Potential error handler
Returns
PromisePromise<TResult>Required
the result of the transactional work

calculatePrice

Parameters
optionShippingOptionRequired
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.
dataRecord<string, unknown>Required
cartCart | Order
Returns
PromisePromise<number>Required

canCalculate

Parameters
Returns
PromisePromise<boolean>Required

cancelFulfillment

Parameters
fulfillmentFulfillmentRequired
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.
Returns
PromisePromise<Fulfillment>Required

createFulfillment

Parameters
methodShippingMethodRequired
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.
itemsLineItem[]Required
fulfillmentOmit<Fulfillment, "beforeInsert">Required
Returns
PromisePromise<Record<string, unknown>>Required

createReturn

Parameters
returnOrderCreateReturnTypeRequired
Returns
PromisePromise<Record<string, unknown>>Required

list

Returns
PromisePromise<FulfillmentProvider[]>Required

listFulfillmentOptions

Parameters
providerIdsstring[]Required
Returns
PromisePromise<FulfillmentOptions[]>Required

registerInstalledProviders

Parameters
providersstring[]Required
Returns
PromisePromise<void>Required

retrieveDocuments

Fetches documents from the fulfillment provider

Parameters
providerIdstringRequired
the id of the provider
fulfillmentDataRecord<string, unknown>Required
the data relating to the fulfillment
documentType"label" | "invoice"Required
the typ of
Returns
PromisePromise<any>Required
document to fetch

retrieveProvider

Parameters
providerIdstringRequired
the provider id
Returns
anyany
the payment fulfillment provider

shouldRetryTransaction_

Parameters
errRecord<string, unknown> | { code: string }Required
Returns
booleanboolean

validateFulfillmentData

Parameters
optionShippingOptionRequired
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.
dataRecord<string, unknown>Required
cartRecord<string, unknown> | CartRequired
Returns
PromisePromise<Record<string, unknown>>Required

validateOption

Parameters
optionShippingOptionRequired
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.
Returns
PromisePromise<boolean>Required

withTransaction

Parameters
transactionManagerEntityManager
Returns
FulfillmentProviderServiceFulfillmentProviderServiceRequired
Was this section helpful?