Skip to main content

OrderByCodeAccessStrategy

The OrderByCodeAccessStrategy determines how access to a placed Order via the orderByCode query is granted. With a custom strategy anonymous access could be made permanent or tied to specific conditions like IP range or an Order status.

Example

This example grants access to the requested Order to anyone – unless it's Monday.

Ts
Info

This is configured via the orderOptions.orderByCodeAccessStrategy property of your VendureConfig.

Signature

canAccessOrder

method(ctx: RequestContext, order: Order) => boolean | Promise<boolean>

Gives or denies permission to access the requested Order

The default OrderByCodeAccessStrategy used by Vendure. It permitts permanent access to the Customer owning the Order and anyone within a given time period after placing the Order (defaults to 2h).

Signature

constructor

method(anonymousAccessDuration: string) => DefaultOrderByCodeAccessStrategy

canAccessOrder

method(ctx: RequestContext, order: Order) => boolean
Was this chapter helpful?
Report Issue
Edited Feb 25, 2026·Edit this page