Subversion Repositories SmartDukaan

Rev

Rev 37150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37150 Rev 37219
Line 51... Line 51...
51
  <tr><td>403</td><td><code>EXT_403</code></td><td><code>storeId</code> is not mapped to your account.</td></tr>
51
  <tr><td>403</td><td><code>EXT_403</code></td><td><code>storeId</code> is not mapped to your account.</td></tr>
52
  <tr><td>400</td><td><code>EXT_400</code></td><td>Bad or over-sized id list parameter.</td></tr>
52
  <tr><td>400</td><td><code>EXT_400</code></td><td>Bad or over-sized id list parameter.</td></tr>
53
</table>
53
</table>
54
 
54
 
55
<h2>Data model</h2>
55
<h2>Data model</h2>
-
 
56
<pre>categoryId = a product category exposed to you        → listed in categoryMaster
56
<pre>catalogId  = a product model (e.g. "Galaxy A15")     → content in catalogMaster
57
catalogId  = a product model (e.g. "Galaxy A15")     → content in catalogMaster
57
itemId     = a sellable SKU, one per color            → listed in catalogSkuMaster
58
itemId     = a sellable SKU, one per color            → listed in catalogSkuMaster
58
storeId    = a physical partner store mapped to you   → listed in storeMaster
59
storeId    = a physical partner store mapped to you   → listed in storeMaster
59
stock      = (storeId, itemId) → availability          → skuMaster / stock</pre>
60
stock      = (storeId, itemId) → availability          → skuMaster / stock</pre>
60
<p>Prices per SKU: <code>mop</code> is the proposed selling price; <code>mrp</code> is the maximum retail
61
<p>Prices per SKU: <code>mop</code> is the proposed selling price; <code>mrp</code> is the maximum retail
61
price (strike-through display). A SKU with <code>active: false</code> is delisted and should not be sold.</p>
62
price (strike-through display). A SKU with <code>active: false</code> is delisted and should not be sold.</p>
-
 
63
<div class="note">
-
 
64
  <strong>Category scoping:</strong> your account is mapped to specific categories (see
-
 
65
  <code>/categoryMaster</code>). Every feed and lookup only ever returns catalogs, SKUs and stock within
-
 
66
  those categories. <code>title</code> is present and non-empty on catalog, SKU and stock records — the
-
 
67
  same derived product title everywhere.
-
 
68
</div>
62
 
69
 
63
<h2>Master feeds (paginated sync)</h2>
70
<h2>Master feeds (paginated sync)</h2>
-
 
71
 
-
 
72
<h3><span class="method">GET</span>/categoryMaster</h3>
-
 
73
<p>The categories your key may access, each with its spec schema (the keys you will find in
-
 
74
<code>categorySpecs</code> on catalog content). Full list, no pagination.</p>
-
 
75
<pre>GET /external/v1/categoryMaster
-
 
76
→ [ { "categoryId": 10006, "label": "Mobile", "displayName": "Mobile Phones",
-
 
77
      "specs": [ { "key": "ram", "label": "RAM", "position": 1 },
-
 
78
                 { "key": "memory", "label": "Internal Storage", "position": 2 } ] } ]</pre>
64
<p>All feeds accept <code>offset</code> (default 0), <code>limit</code>, and optional
79
<p>All feeds accept <code>offset</code> (default 0), <code>limit</code>, and optional
65
<code>updatedSince</code> (epoch ms) and return:</p>
80
<code>updatedSince</code> (epoch ms) and return:</p>
66
<pre>{
81
<pre>{
67
  "serverTime": 1753600000000,   // pass back as next updatedSince
82
  "serverTime": 1753600000000,   // pass back as next updatedSince
68
  "offset": 0, "limit": 100,
83
  "offset": 0, "limit": 100,
69
  "totalCount": 5321,
84
  "totalCount": 5321,
70
  "records": [ ... ]
85
  "records": [ ... ]
71
}</pre>
86
}</pre>
72
 
87
 
73
<h3><span class="method">GET</span>/catalogMaster</h3>
88
<h3><span class="method">GET</span>/catalogMaster</h3>
74
<p>Full catalog content documents. <code>limit</code> max 100 (documents are large).</p>
89
<p>Full catalog content documents of your categories. <code>limit</code> max 100 (documents are large).
-
 
90
<code>content.title</code> is always non-empty; <code>content.categorySpecs</code> holds the
-
 
91
category-governed key specs (see <code>/categoryMaster</code> for the schema).</p>
75
<pre>GET /external/v1/catalogMaster?offset=0&amp;limit=100
92
<pre>GET /external/v1/catalogMaster?offset=0&amp;limit=100
76
→ records: [ { "catalogId": 12345, "lastModified": 1753500000000,
93
→ records: [ { "catalogId": 12345, "lastModified": 1753500000000,
-
 
94
               "content": { "title": "Samsung Galaxy A15 SM-A155F", "categoryId": 10006,
-
 
95
                            "categorySpecs": [ { "key": "ram", "label": "RAM", "value": "8GB" },
-
 
96
                                               { "key": "memory", "label": "Internal Storage", "value": "256GB" } ],
77
               "content": { "name": "...", "keySpecs": [...], "detailedSpecs": [...],
97
                            "name": "...", "keySpecs": [...], "detailedSpecs": [...],
78
                            "images": [...], "defaultImageUrl": "...", ... } } ]</pre>
98
                            "images": [...], "defaultImageUrl": "...", ... } } ]</pre>
79
 
99
 
80
<h3><span class="method">GET</span>/catalogSkuMaster</h3>
100
<h3><span class="method">GET</span>/catalogSkuMaster</h3>
81
<p>Catalog → SKU map with prices. <code>limit</code> max 500.</p>
101
<p>Catalog → SKU map with prices. <code>limit</code> max 500. <code>brandIdentifier</code> is the
-
 
102
brand's own article/SKU code where known (else <code>null</code>).</p>
82
<pre>GET /external/v1/catalogSkuMaster?offset=0&amp;limit=500
103
<pre>GET /external/v1/catalogSkuMaster?offset=0&amp;limit=500
83
→ records: [ { "catalogId": 12345, "itemId": 101, "brand": "Samsung",
104
→ records: [ { "catalogId": 12345, "itemId": 101, "title": "Samsung Galaxy A15 SM-A155F",
84
               "modelName": "Galaxy A15", "modelNumber": "SM-A155F", "color": "Blue",
105
               "brand": "Samsung", "modelName": "Galaxy A15", "modelNumber": "SM-A155F",
-
 
106
               "color": "Blue", "brandIdentifier": "SM-A155FZKW",
85
               "mop": 14999.0, "mrp": 17999.0, "active": true, "updatedAt": 1753500000000 } ]</pre>
107
               "mop": 14999.0, "mrp": 17999.0, "active": true, "updatedAt": 1753500000000 } ]</pre>
86
 
108
 
87
<h3><span class="method">GET</span>/skuMaster</h3>
109
<h3><span class="method">GET</span>/skuMaster</h3>
88
<p>Per-store stock + price rows for <em>your mapped stores</em>. <code>limit</code> max 500.
110
<p>Per-store stock + price rows for <em>your mapped stores</em>, with full item identity on every row.
89
Optional <code>storeId</code> narrows to one store (must be mapped to you).</p>
111
<code>limit</code> max 500. Optional <code>storeId</code> narrows to one store (must be mapped to you).</p>
90
<pre>GET /external/v1/skuMaster?offset=0&amp;limit=500
112
<pre>GET /external/v1/skuMaster?offset=0&amp;limit=500
91
→ records: [ { "storeId": 2116665, "itemId": 101, "availability": 7,
113
→ records: [ { "storeId": 2116665, "itemId": 101, "title": "Samsung Galaxy A15 SM-A155F",
-
 
114
               "brand": "Samsung", "modelName": "Galaxy A15", "modelNumber": "SM-A155F",
-
 
115
               "color": "Blue", "brandIdentifier": "SM-A155FZKW", "availability": 7,
92
               "mop": 14999.0, "mrp": 17999.0, "active": true, "updatedAt": 1753500000000 } ]</pre>
116
               "mop": 14999.0, "mrp": 17999.0, "active": true, "updatedAt": 1753500000000 } ]</pre>
93
 
117
 
94
<h3><span class="method">GET</span>/storeMaster</h3>
118
<h3><span class="method">GET</span>/storeMaster</h3>
95
<p>Your mapped stores with location details. Always the full list (no pagination or delta needed).</p>
119
<p>Your mapped stores with location and GST details. Always the full list (no pagination or delta needed).</p>
96
<pre>GET /external/v1/storeMaster
120
<pre>GET /external/v1/storeMaster
97
→ [ { "storeId": 2116665, "code": "NSPRJ39290", "name": "XYZ Mobiles",
121
→ [ { "storeId": 2116665, "code": "NSPRJ39290", "name": "XYZ Mobiles",
98
      "addressLine1": "...", "addressLine2": "...", "city": "Jaipur",
122
      "addressLine1": "...", "addressLine2": "...", "city": "Jaipur",
99
      "state": "Rajasthan", "pincode": "302001", "latitude": "26.91", "longitude": "75.78" } ]</pre>
123
      "state": "Rajasthan", "pincode": "302001", "latitude": "26.91", "longitude": "75.78",
-
 
124
      "gstNumber": "08ABCDE1234F1Z5" } ]</pre>
100
 
125
 
101
<h2>Incremental sync (updatedSince)</h2>
126
<h2>Incremental sync (updatedSince)</h2>
102
<ol>
127
<ol>
103
  <li>First sync: call each feed <strong>without</strong> <code>updatedSince</code> and page through with
128
  <li>First sync: call each feed <strong>without</strong> <code>updatedSince</code> and page through with
104
      <code>offset</code>/<code>limit</code>. Full feeds contain active records only.</li>
129
      <code>offset</code>/<code>limit</code>. Full feeds contain active records only.</li>
Line 115... Line 140...
115
</div>
140
</div>
116
 
141
 
117
<h2>Real-time lookups</h2>
142
<h2>Real-time lookups</h2>
118
 
143
 
119
<h3><span class="method">GET</span>/stock</h3>
144
<h3><span class="method">GET</span>/stock</h3>
-
 
145
<p>Live stock + price in one mapped store, with item identity on every row. Two modes:</p>
-
 
146
<ul>
120
<p>Live stock + price for up to 100 SKUs in one mapped store. Every requested <code>itemId</code> is
147
  <li><strong>By ids</strong> — pass <code>itemIds</code> (up to 100). Every requested <code>itemId</code> is
121
returned; no stock row means <code>availability: 0</code>, no active listing means <code>mop/mrp: null</code>.</p>
148
      returned; no stock row means <code>availability: 0</code>, no active listing means
-
 
149
      <code>mop/mrp: null</code>. Ids outside your categories come back as id-only rows with
-
 
150
      <code>availability: 0</code>.</li>
-
 
151
  <li><strong>Full store</strong> — omit <code>itemIds</code> to page through the store's entire stock with
-
 
152
      <code>offset</code>/<code>limit</code> (max 500); the response is the standard paginated envelope
-
 
153
      (<code>serverTime</code>/<code>totalCount</code>/<code>records</code>). One loop replaces batching ids
-
 
154
      across many calls.</li>
-
 
155
</ul>
122
<pre>GET /external/v1/stock?storeId=2116665&amp;itemIds=101,102,103
156
<pre>GET /external/v1/stock?storeId=2116665&amp;itemIds=101,102
-
 
157
→ [ { "storeId": 2116665, "itemId": 101, "title": "Samsung Galaxy A15 SM-A155F",
-
 
158
      "brand": "Samsung", "modelName": "Galaxy A15", "modelNumber": "SM-A155F", "color": "Blue",
123
→ [ { "storeId": 2116665, "itemId": 101, "availability": 7, "mop": 14999.0, "mrp": 17999.0, "active": true },
159
      "brandIdentifier": "SM-A155FZKW", "availability": 7, "mop": 14999.0, "mrp": 17999.0, "active": true },
124
    { "storeId": 2116665, "itemId": 102, "availability": 0, "mop": null, "mrp": null, "active": false } ]</pre>
160
    { "storeId": 2116665, "itemId": 102, "title": null, "availability": 0, "mop": null, "mrp": null, "active": false } ]
-
 
161
 
-
 
162
GET /external/v1/stock?storeId=2116665&amp;offset=0&amp;limit=500
-
 
163
→ { "serverTime": ..., "offset": 0, "limit": 500, "totalCount": 812, "records": [ ...same row shape... ] }</pre>
125
 
164
 
126
<h3><span class="method">GET</span>/catalogs</h3>
165
<h3><span class="method">GET</span>/catalogs</h3>
127
<p>Catalog content for up to 50 catalogIds. Response is an object keyed by catalogId; ids without a
166
<p>Catalog content for up to 50 catalogIds. Response is an object keyed by catalogId; ids without a
128
document are omitted.</p>
167
document are omitted.</p>
129
<pre>GET /external/v1/catalogs?catalogIds=12345,12346</pre>
168
<pre>GET /external/v1/catalogs?catalogIds=12345,12346</pre>