API: Recommendation Tracking Service

Download skillThe skill is a reference md and part of wix-manage skill. You can use the following command to add the full wix-manage skill to your project:
Copy

This service persists recommendations in a database and tracks their lifecycle state. Every recommendation generated by any domain (discounts, shipping, etc.) MUST be persisted here before being presented to the merchant.

Service: wix.ecom.agentic.recommendations.v1.AgenticRecommendationsService

Base URL: https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations

How to call these APIs

Use CallWixSiteAPI to invoke each endpoint:

Copy

Important: You must have a siteId before calling any of these. Use ListWixSites first to resolve the site.


Data Model

Recommendation

FieldTypeAccessDescription
idstring (GUID)readOnlyAuto-generated unique identifier
revisionint64readOnlyOptimistic lock — must match current value for state transitions
createdDateTimestampreadOnlyWhen the recommendation was created
updatedDateTimestampreadOnlyWhen the recommendation was last updated
titlestringwritableShort human-readable title (max 200 chars)
reasoningstringwritableWhy this recommendation is being made, citing specific data (max 2000 chars)
domainstringwritableBusiness domain: "shipping", "discounts", etc. (max 50 chars)
urgencyenumwritableCRITICAL, HIGH, MEDIUM, or LOW
adviceAdvicewritableThe action to take (see below)
stateenumreadOnlyCurrent lifecycle state (see State Machine)
expiresAtTimestampwritableWhen the recommendation auto-expires
conversationIdstring (GUID)writableLinks all recommendations in a session
decidedBystringreadOnlyWho made the last state transition
rejectionReasonstringreadOnlyReason for rejection (max 1000 chars)
rejectionPermanentbooleanreadOnlyIf true, this action type is permanently blocked for this site
executionResultExecutionResultreadOnlyResult of execution (set on DONE/FAILED)

Advice

FieldTypeDescription
actionstringAction identifier (e.g., "apply_discount", "create_shipping_option") (max 100 chars)
paramsobjectDomain-specific parameters (discount config, shipping option details, etc.)
successCriteriastringHow to verify the action succeeded (max 500 chars)

ExecutionResult

FieldTypeDescription
statusenumSUCCESS, PARTIAL_FAILURE, or FAILURE
summarystringDescription of what happened (max 2000 chars)
errorstringError message if failed (max 2000 chars)
resultPayloadobjectAdditional result data

State Machine

Copy
FromToTriggerAPI Method
PROPOSEDRecommendation createdBatchCreate / Create
PROPOSEDAPPROVEDMerchant approvesApprove
PROPOSEDREJECTEDMerchant rejectsReject
PROPOSEDEXPIREDexpiresAt passedAutomatic (scheduler)
PROPOSEDPROPOSEDMerchant modifies parametersUpdate (state unchanged)
APPROVEDEXECUTINGExecution beginsMarkExecuting
EXECUTINGDONEExecution succeededMarkDone
EXECUTINGFAILEDExecution failedMarkFailed

BatchCreate

Creates multiple recommendations (1-100) atomically. All start in PROPOSED state. Use this as the default — always batch recommendations together.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/batch-create

Request:

Copy

Response:

Copy

Important: Save the id and revision from each result — you need them for all subsequent state transitions.


Create

Creates a single recommendation in PROPOSED state. Prefer BatchCreate for multiple recommendations.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations

Request:

Copy

Response: Single agenticRecommendation object with id, revision, and state: "PROPOSED".


Query

Query recommendations by conversation ID, state, or domain. Returns paginated results.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/query

Request:

Copy

Filterable fields: conversationId, state, domain, urgency, id

Response:

Copy

Get

Fetch a single recommendation by ID.

Endpoint: GET https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}

Response: Single agenticRecommendation object with all fields.


Count

Get recommendation counts grouped by state for the current site.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/count

Request: {}

Response:

Copy

Update

Update a PROPOSED recommendation. Only title, reasoning, urgency, advice, and expiresAt can be updated. State stays PROPOSED.

Endpoint: PATCH https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}

Request:

Copy

Response: Updated agenticRecommendation with incremented revision.

Constraint: Only works on PROPOSED recommendations. Non-PROPOSED returns INVALID_STATE_TRANSITION.


Approve

PROPOSED → APPROVED. Call when the merchant agrees with a recommendation.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/approve

Request:

Copy

Response: Updated agenticRecommendation with state: "APPROVED" and incremented revision.


Reject

PROPOSED → REJECTED. Call when the merchant declines.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/reject

Request:

Copy
FieldTypeRequiredDescription
revisionint64YesCurrent revision for optimistic locking
reasonstringNoWhy the merchant rejected (max 1000 chars)
permanentbooleanNoIf true, permanently blocks this action type for this site

Response: Updated agenticRecommendation with state: "REJECTED".


MarkExecuting

APPROVED → EXECUTING. Call immediately before applying the recommendation.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/mark-executing

Request:

Copy

Response: Updated agenticRecommendation with state: "EXECUTING" and incremented revision.


MarkDone

EXECUTING → DONE. Call after the recommendation was successfully applied.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/mark-done

Request:

Copy

Response: Updated agenticRecommendation with state: "DONE" and executionResult.


MarkFailed

EXECUTING → FAILED. Call when execution fails.

Endpoint: POST https://manage.wix.com/_api/agentic-recommendations/v1/agentic-recommendations/{agenticRecommendationId}/mark-failed

Request:

Copy

Response: Updated agenticRecommendation with state: "FAILED" and executionResult.


Error Codes

ErrorHTTPMeaning
RECOMMENDATION_SUPPRESSED400Action + site blocked by permanent rejection
INVALID_STATE_TRANSITION400Wrong source state for the requested transition
VERSION_MISMATCH400Optimistic lock conflict — re-fetch and retry
RECOMMENDATION_NOT_FOUND404ID doesn't exist

On VERSION_MISMATCH: Query to get the latest revision, then retry the operation with the updated revision.


Integration pattern for all recommendation flows

Every recommendation flow MUST follow this lifecycle:

Copy

Rules:

  • Every recommendation MUST be persisted before presenting to the merchant
  • Always use the latest revision from the previous API response
  • Track ALL outcomes — both success (MarkDone) and failure (MarkFailed)
  • On VERSION_MISMATCH: re-fetch with Query, get latest revision, retry
  • Never skip the EXECUTING state — always call MarkExecuting before applying
Did this help?