Skip to main content

FulfillmentService

Contains methods relating to Fulfillment entities.

Signature

constructor

method(connection: TransactionalConnection, fulfillmentStateMachine: FulfillmentStateMachine, eventBus: EventBus, configService: ConfigService, customFieldRelationService: CustomFieldRelationService) => FulfillmentService

create

method(ctx: RequestContext, orders: Order[], lines: OrderLineInput[], handler: ConfigurableOperationInput) => Promise<Fulfillment | InvalidFulfillmentHandlerError | CreateFulfillmentError>

Creates a new Fulfillment for the given Orders and OrderItems, using the specified FulfillmentHandler.

getFulfillmentLines

method(ctx: RequestContext, id: ID) => Promise<FulfillmentLine[]>

getFulfillmentsLinesForOrderLine

method(ctx: RequestContext, orderLineId: ID, relations: RelationPaths<FulfillmentLine> = []) => Promise<FulfillmentLine[]>

transitionToState

method(ctx: RequestContext, fulfillmentId: ID, state: FulfillmentState) => Promise< | { fulfillment: Fulfillment; orders: Order[]; fromState: FulfillmentState; toState: FulfillmentState; } | FulfillmentStateTransitionError >

Transitions the specified Fulfillment to a new state and upon successful transition publishes a FulfillmentStateTransitionEvent.

getNextStates

method(fulfillment: Fulfillment) => readonly FulfillmentState[]

Returns an array of the next valid states for the Fulfillment.

Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page