Recommend products

post
/discoveries/recommend
Content-Type
string
required

Content-Type

Allowed value:
application/json
Default:
application/json
as-store-id
string
required

The identifier of your Commerce store

Example:
f58a7bc4fb6d4719901906abde0c6f46
type
required

Default algorithm configuration type.

Allowed values:
BEST_SELLERSBOUGHT_TOGETHERRANDOMNEW_ARRIVALCOMPLEMENTSSIMILAR
session_id
string

Session unique identifier. It is recommended to use this package to generate UUID.

Example:
47be3249-c1f4-446d-b652-8749be6ed577
include_filters
array[string]

Include products that correspond to the specified attribute. For the supported filter key, please refer to the filter key, and for the format of the filter, please refer to the following examples:

  • Conjunctive filtering: ["tags:Sale", "categories:Furniture"] means tags contain any of ('Sale') and categories contain any of ('Furniture')
  • Disjunctive filtering: ["tags:Sofa,Couch,Bed"] means tags contain any of ('Sofa', 'Couch', 'Bed')
exclude_filters
array[string]

Exclude products that correspond to the specified attribute. For the supported filter key, please refer to the filter key, and for the format of the filter, please refer to the following examples:

  • Conjunctive filtering: ["!tags:Sale", "!categories:Furniture"] means tags not contain any of ('Sale') and categories not contain any of ('Furniture')
  • Disjunctive filtering: ["!tags:Sofa,Couch,Bed"] means tags not contain any of ('Sofa', 'Couch', 'Bed')
limit
number

The number of products each page contains.

<= 100
Default:
10
Example:
1
products
array[PartialProduct]

This parameter is required for BOUGHT_TOGETHER, COMPLEMENTS, and SIMILAR types. For the meaning of products in different scenarios, please refer to scenarios.

id
string

Unique identifier generated by AfterShip.

Example:
f74f8af7578042b0991e104533158ad1
source_id
string
required

A unique identifier for the product.

Example:
00093d19495447a2a082bfe44d75658a
variants
array[object]

Variants of a product.

as-api-version
string

The actual API version that serves the request

Example:
2025-01
as-trace-id
string

A UUID value without hyphens to trace and debug the request

Example:
5ae20644d52348a49a897fff5dd314a3
meta
Meta
Example:
{"code":200,"type":"OK","message":"Everything worked as expected."}
code
number
required

A 1 to 5-digit integer that represents the status of the request.

Example:
200
message
string

A human-readable string message that gives a short description to the specific meta code.

type
string

A human-readable short string which is the type of HTTP status, e.g. OK for a 200 HTTP status, or BadRequest for a 400 HTTP status.

Allowed values:
OKBadRequestUnauthorizedForbiddenNotFoundUnprocessableEntityTooManyRequestsInternalError
errors
array[Error]
data
object
products
array[PartialProduct]

Partial Commerce Product object.

Auth
:
Parameters
:
:
Body
{ "type": "BEST_SELLERS", "session_id": "47be3249-c1f4-446d-b652-8749be6ed577", "include_filters": [ "tags:Sale" ], "exclude_filters": [ "!tags:Wood", "!categories:Furniture" ], "limit": 5 }
{ "meta": { "code": 200, "type": "OK", "message": "Everything worked as expected." }, "data": { "products": [ { "id": "51e2fb9bc14847c5a82f049558019b12", "source_id": "a5ffb83f38fb4a6f94d33616dea0e6a0", "variants": [ { "source_id": "893576488aca4967a677194598d7fc95" } ] }, { "id": "d8192616ec3c41b3805070d653d37aad", "source_id": "4dcaa564aa85426480d2c4b01df8db56", "variants": [ { "source_id": "311381827b1243a18a2bdd44ebad1a41" } ] }, { "id": "b1d821b2e47c430c885ce7ea42073dcb", "source_id": "afc4ee14858b45349c74c66a25ddf54f", "variants": [ { "source_id": "1ec8af67ca7d417bb056e77858611857" } ] }, { "id": "7dfd6d5466004ebaac811c37045f67c4", "source_id": "793544852ad942ffaee1c15dcf8383f8", "variants": [ { "source_id": "eacce30b115e436296b6e1cbba6c8508" } ] }, { "id": "1e09a77a0138425a831266a11727cee1", "source_id": "00093d19495447a2a082bfe44d75658a", "variants": [ { "source_id": "00b0a1e329cf4ecc861136ed0ab94fc2" } ] } ] } }