iotoms Docs

Get purchase recommendations for a customer

GET
/api/v1/transaction/transactions/recommendations

Returns a customer's most recent sales (up to limit, default 5, max 50) with their count and total, plus the items they buy most, ranked by quantity. Identify the customer by customerNumber or by storeId (a customer store on a route); one of them is required. The count and spend cover only the recent sales returned, not the full history.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Query Parameters

customerNumber?string

CRM customer number (customerNumber or storeId required)

storeId?integer

customer_stores.id (customerNumber or storeId required) — needed for route visits, which rarely carry a real CRM customerNumber

Formatint64
limit?integer

How many recent sales and recommended items to return. Default 5, maximum 50; must be above zero.

Formatint32
Default5

Header Parameters

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was handled, ERROR otherwise.

message*string

Short human-readable message describing the outcome, e.g. which record was fetched or saved.

data?

The customer's recent buying and suggested items.

Example Request
curl -X GET 'https://beta.iotoms.com/api/v1/transaction/transactions/recommendations'
Example Response
{  "status": "string",  "message": "string",  "data": {    "customerNumber": "string",    "transactionCount": 0,    "totalSpend": 0,    "recentPurchases": [      {        "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",        "invoiceNumber": "string",        "businessDate": "2019-08-24",        "amount": 0      }    ],    "recommendations": [      {        "itemId": "string",        "quantity": 0,        "frequency": 0      }    ]  }}