Skip to main content

getOrdersByVectorSearch

Search the user's orders by meaning (semantic vector search). 🔐 This method requires authorization.

Description​

Runs a semantic (vector) search over the authenticated user's orders: a natural-language query matched on meaning rather than exact keywords. Resolves to an IVectorSearchResponse<IOrdersByMarkerEntity>: the orders are in items, their count in total. indexReady: false means the search index for orders in this language isn't built yet, so empty items don't mean that nothing matched.

.getOrdersByVectorSearch(

, , ,

);

Parameters schema​

Schema

body(required): IOrdersVectorSearch
Vector search parameters.
example:

{ queryText: "winter jacket" }

body.queryText(required): string
Natural-language search query.
example: "winter jacket"

body.vectorDistanceThreshold: number
Override of the cosine distance threshold (0..2).
example: 0.3

body.maxHits: number
Number of top candidates fetched before pagination. Default: 100. Maximum: 500.
example: 10

body.debug: boolean
Deprecated and ignored: the API no longer reads debug and returns distance on every item.
example: false

langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"

offset: number
Number of records to skip. Default: 0. offset + limit must not exceed 200; a larger window is rejected with 400.
example: 0

limit: number
Maximum number of records to return. Default: 30.
example: 30

Examples​

Minimal example​

const response = await Orders.getOrdersByVectorSearch({ queryText: 'winter jacket' });

Example with all parameters​

const response = await Orders.getOrdersByVectorSearch(
{
queryText: 'winter jacket',
vectorDistanceThreshold: 0.3,
maxHits: 50,
},
'en_US',
0,
30,
);

Example response​

{
"items": [],
"total": 0,
"indexReady": false
}

Response schema​

Schema: IVectorSearchResponse<IOrdersByMarkerEntity>

items: IOrderByMarkerEntity[]
Orders on this page.
example:

[
{
"id": 55,
"storageId": 1,
"createdDate": "2025-03-22T21:12:42.371Z",
"statusIdentifier": "inProgress",
"formIdentifier": "orderForm",
"formData": [
{
"marker": "order_name",
"value": "John",
"type": "string"
}
],
"attributeSetIdentifier": "order_form",
"totalSum": "300",
"totalSumRaw": "300",
"currency": "",
"paymentAccountIdentifier": "cash",
"paymentAccountLocalizeInfos": {
"title": "Cash"
},
"products": [
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": [],
"price": 150,
"quantity": 2,
"isGift": false
}
],
"isCompleted": false
}
]

items.id: number
Object ID.
example: 125

items.storageId: number
ID of the order storage.
example: 1

items.total: string
Record count returned alongside a single order by the by-id endpoint (getOrderById); comes as a string. Absent from the orders-by-marker list items.
example: "1"

items.createdDate: string
Date when the order was created.
example: "2023-10-01T12:00:00Z"

items.statusIdentifier: string
Marker of the order status.
example: "order-status-1"

items.formIdentifier: string
Marker of the form.
example: "bar-orders-form"

items.formData: IOrdersFormData[]
Data from the form linked to the order storage.
example:

[
{
"marker": "order_name",
"value": "John",
"type": "string"
}
]

items.attributeSetIdentifier: string | null
Marker of the attribute set.
example: "attribute-set-1"

items.totalSum: string
Total order amount.
example: "300"

items.totalSumRaw: string
Raw total order amount with full precision.
example: "300"

items.currency: string
Currency used to pay for the order.
example: "USD"

items.paymentAccountIdentifier: string | null
Marker of the payment account.
example: "payment-1"

items.paymentAccountLocalizeInfos: ILocalizeInfo
Localized name of the payment account.
example:

{
"title": "Cash"
}

items.products: IOrderProducts[]
Products in the order.
example:

[
{
"id": 2957,
"title": "Cosmo",
"sku": null,
"previewImage": [],
"price": 150,
"quantity": 2,
"isGift": false
}
]

items.paymentUrl: string | null
Payment page URL.
example: "https://example.com/pay/123"

items.isCompleted: boolean | null
Whether the order has been completed.
example: true

items.isPartial: boolean | null
Whether the order is partially paid; null on older orders where this was not tracked.
example: false

items.paymentStrategy: string
Payment strategy of the order.
example: "once"

items.statusLocalizeInfos: ILocalizeInfo
Localized status name.

items.fulfillmentStatusIdentifier: string | null
Marker of the fulfillment (delivery) status; null while no fulfillment status is assigned.
example: "shipped"

items.fulfillmentStatusLocalizeInfos: ILocalizeInfo | null
Localized fulfillment status name; null while no fulfillment status is assigned.

items.paymentStatusIdentifier: string | null
Marker of the payment status; null while no payment status is assigned.
example: "inProgress-payment"

items.paymentStatusLocalizeInfos: ILocalizeInfo | null
Localized name of the payment status; null while no payment status is assigned.

items.discountConfig: IOrderDiscountConfig | null
Discount configuration resolved for the order: orderDiscounts, productDiscounts, coupon, settings, bonus and totals. null on older orders without a resolved configuration.

items.split: IOrderSplit
Split (staged) payment configuration; present on the by-id order endpoint.

items.distance: number
Cosine distance to the query. Returned on every item by the semantic (vector) search endpoint.
example: 0.12

total: number
Total number of found records.
example: 100

indexReady: boolean
false when no vectors are built yet for this entity and language: the query was not embedded, so empty items do not mean that nothing matched. true means the result comes from a real search.

Semantic search matches on meaning, not on the literal text. Keyword search with globalSearch() covers only products, pages, blocks and discounts.