Skip to content

Commit ab56e2b

Browse files
committed
Update docs for crossSellTrain
1 parent 14a5fbd commit ab56e2b

2 files changed

Lines changed: 52 additions & 34 deletions

File tree

index.html

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3201,50 +3201,28 @@ <h3 id='creditcardupdatepayload-field'>CreditCardUpdatePayload</h3>
32013201
<h2 id='crosssell'>CrossSell</h2><p>Accessible via <a href="#foxapi-analytics">analytics</a> property of <a href="#foxapi">FoxApi</a> instance.</p>
32023202

32033203
<section>
3204-
<h3 id='crosssell-method'>Methods</h3>
3204+
<h3 id='crosssell-example'>Usage example</h3>
32053205

32063206
<section >
32073207

32083208

32093209

32103210
<div class='section-comments'></div>
32113211

3212-
<table><thead>
3213-
<tr>
3214-
<th>Method</th>
3215-
<th>Returns</th>
3216-
<th>Description</th>
3217-
</tr>
3218-
</thead><tbody>
3219-
<tr id='crosssell-crossselltrain'>
3220-
<td><code><b>crossSellTrain</b>(<nobr>&lt;object&gt;</nobr> <i>pointsObj</i>, <i>{Object} pointsObj</i>)</nobr></code></td>
3221-
<td><code>Promise</code></td>
3222-
<td>Sends a collection of &quot;points&quot; to populate a sparse matrix for cross-sell
3223-
analytics and related product tracking. The POST body is an object with a &quot;points&quot; key
3224-
and value filled with an array of &quot;Point&quot; objects
3225-
Example pointsObj
3212+
32263213
<pre><code>{
32273214
&quot;points&quot;: [
32283215
{
32293216
&quot;custID&quot;: 1,
32303217
&quot;prodID&quot;: 4,
32313218
&quot;chanID&quot;: 2,
3232-
}
3219+
}
32333220
]
32343221
}
3235-
</code></pre></td>
3236-
</tr>
3237-
<tr id='crosssell-crosssellrelated'>
3238-
<td><code><b>crossSellRelated</b>(<nobr>&lt;Int&gt;</nobr> <i>productId</i>, <nobr>&lt;Int&gt;</nobr> <i>channelId</i>, <i>{Int} productId</i>, <i>{Int} channelId</i>)</nobr></code></td>
3239-
<td><code>Promise</code></td>
3240-
<td>Returns JSON of what products are similar to the productId in the query params.
3241-
{ &quot;products&quot;: [ RelatedProduct ] }
3242-
Score == 1 means these products were purchased by the exact same set of customers.
3243-
Score == 0 means no customer has purchased both of these
3244-
Example Request
3245-
`/v1/public/recommend/prod-prod/3?channel=2
3246-
Example Response
3247-
```
3222+
</code></pre>
3223+
<p>`/v1/public/recommend/prod-prod/3?channel=2</p>
3224+
3225+
<p>```
32483226
{
32493227
&quot;products&quot;: [
32503228
{
@@ -3260,7 +3238,44 @@ <h3 id='crosssell-method'>Methods</h3>
32603238
&quot;score&quot;: 0
32613239
}
32623240
]
3263-
}</td>
3241+
}</p>
3242+
3243+
3244+
3245+
</section>
3246+
3247+
</section>
3248+
<section>
3249+
<h3 id='crosssell-method'>Methods</h3>
3250+
3251+
<section >
3252+
3253+
3254+
3255+
<div class='section-comments'></div>
3256+
3257+
<table><thead>
3258+
<tr>
3259+
<th>Method</th>
3260+
<th>Returns</th>
3261+
<th>Description</th>
3262+
</tr>
3263+
</thead><tbody>
3264+
<tr id='crosssell-crossselltrain'>
3265+
<td><code><b>crossSellTrain</b>(<nobr>&lt;object&gt;</nobr> <i>pointsObj</i>, <i>{Object} pointsObj</i>)</nobr></code></td>
3266+
<td><code>Promise</code></td>
3267+
<td>Sends a collection of &quot;points&quot; to populate a sparse matrix for cross-sell
3268+
analytics and related product tracking. The POST body is an object with a &quot;points&quot; key
3269+
and value filled with an array of &quot;Point&quot; objects.
3270+
This method is intended for Admin use only.</td>
3271+
</tr>
3272+
<tr id='crosssell-crosssellrelated'>
3273+
<td><code><b>crossSellRelated</b>(<nobr>&lt;Int&gt;</nobr> <i>productId</i>, <nobr>&lt;Int&gt;</nobr> <i>channelId</i>, <i>{Int} productId</i>, <i>{Int} channelId</i>)</nobr></code></td>
3274+
<td><code>Promise</code></td>
3275+
<td>Returns JSON of what products are similar to the productId in the query params.
3276+
{ &quot;products&quot;: [ RelatedProduct ] }
3277+
Score == 1 means these products were purchased by the exact same set of customers.
3278+
Score == 0 means no customer has purchased both of these</td>
32643279
</tr>
32653280
</tbody></table>
32663281

src/api/cross-sell.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ export default class CrossSell {
99
}
1010

1111
/**
12+
* @private
1213
* @method crossSellTrain(pointsObj: object): Promise
1314
* @param {Object} pointsObj
1415
*
1516
* Sends a collection of "points" to populate a sparse matrix for cross-sell
1617
* analytics and related product tracking. The POST body is an object with a "points" key
17-
* and value filled with an array of "Point" objects
18+
* and value filled with an array of "Point" objects.
1819
*
19-
* Example pointsObj
20+
* This method is intended for Admin use only.
21+
*
22+
* @example pointsObj
2023
*
2124
* ```
2225
* {
@@ -45,11 +48,11 @@ export default class CrossSell {
4548
* Score == 1 means these products were purchased by the exact same set of customers.
4649
* Score == 0 means no customer has purchased both of these
4750
*
48-
* Example Request
51+
* @example Request
4952
*
5053
* `/v1/public/recommend/prod-prod/3?channel=2
5154
*
52-
* Example Response
55+
* @example Response
5356
*
5457
* ```
5558
* {

0 commit comments

Comments
 (0)