Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="content_v2.html">Content API for Shopping</a> . <a href="content_v2.pos.html">pos</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#custombatch">custombatch(body, dryRun=None)</a></code></p> |
| 79 | <p class="firstline">Batches multiple POS-related calls in a single request.</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#delete">delete(merchantId, targetMerchantId, storeCode, dryRun=None)</a></code></p> |
| 82 | <p class="firstline">Deletes a store for the given merchant.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#get">get(merchantId, targetMerchantId, storeCode)</a></code></p> |
| 85 | <p class="firstline">Retrieves information about the given store.</p> |
| 86 | <p class="toc_element"> |
| 87 | <code><a href="#insert">insert(merchantId, targetMerchantId, body, dryRun=None)</a></code></p> |
| 88 | <p class="firstline">Creates a store for the given merchant.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#inventory">inventory(merchantId, targetMerchantId, body, dryRun=None)</a></code></p> |
| 91 | <p class="firstline">Submit inventory for the given merchant.</p> |
| 92 | <p class="toc_element"> |
| 93 | <code><a href="#list">list(merchantId, targetMerchantId)</a></code></p> |
| 94 | <p class="firstline">Lists the stores of the target merchant.</p> |
| 95 | <p class="toc_element"> |
| 96 | <code><a href="#sale">sale(merchantId, targetMerchantId, body, dryRun=None)</a></code></p> |
| 97 | <p class="firstline">Submit a sale event for the given merchant.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
| 100 | <code class="details" id="custombatch">custombatch(body, dryRun=None)</code> |
| 101 | <pre>Batches multiple POS-related calls in a single request. |
| 102 | |
| 103 | Args: |
| 104 | body: object, The request body. (required) |
| 105 | The object takes the form of: |
| 106 | |
| 107 | { |
| 108 | "entries": [ # The request entries to be processed in the batch. |
| 109 | { |
| 110 | "storeCode": "A String", # The store code. Set this only if the method is delete or get. |
| 111 | "targetMerchantId": "A String", # The ID of the account for which to get/submit data. |
| 112 | "sale": { # The change of the available quantity of an item at the given store. # The sale information to submit. Set this only if the method is sale. |
| 113 | "itemId": "A String", # A unique identifier for the item. |
| 114 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 115 | "kind": "content#posSale", # Identifies what kind of resource this is. Value: the fixed string "content#posSale". |
| 116 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 117 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 118 | "price": { # The price of the item. |
| 119 | "currency": "A String", # The currency of the price. |
| 120 | "value": "A String", # The price represented as a number. |
| 121 | }, |
| 122 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 123 | "gtin": "A String", # Global Trade Item Number. |
| 124 | "saleId": "A String", # A unique ID to group items from the same sale event. |
| 125 | "quantity": "A String", # The relative change of the available quantity. Negative for items returned. |
| 126 | }, |
| 127 | "merchantId": "A String", # The ID of the POS data provider. |
| 128 | "batchId": 42, # An entry ID, unique within the batch request. |
| 129 | "inventory": { # The absolute quantity of an item available at the given store. # The inventory to submit. Set this only if the method is inventory. |
| 130 | "itemId": "A String", # A unique identifier for the item. |
| 131 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 132 | "kind": "content#posInventory", # Identifies what kind of resource this is. Value: the fixed string "content#posInventory". |
| 133 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 134 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 135 | "price": { # The current price of the item. |
| 136 | "currency": "A String", # The currency of the price. |
| 137 | "value": "A String", # The price represented as a number. |
| 138 | }, |
| 139 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 140 | "gtin": "A String", # Global Trade Item Number. |
| 141 | "quantity": "A String", # The available quantity of the item. |
| 142 | }, |
| 143 | "method": "A String", |
| 144 | "store": { # Store resource. # The store information to submit. Set this only if the method is insert. |
| 145 | "storeAddress": "A String", # The street address of the store. |
| 146 | "kind": "content#posStore", # Identifies what kind of resource this is. Value: the fixed string "content#posStore". |
| 147 | "storeCode": "A String", # A store identifier that is unique for the given merchant. |
| 148 | }, |
| 149 | }, |
| 150 | ], |
| 151 | } |
| 152 | |
| 153 | dryRun: boolean, Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). |
| 154 | |
| 155 | Returns: |
| 156 | An object of the form: |
| 157 | |
| 158 | { |
| 159 | "kind": "content#posCustomBatchResponse", # Identifies what kind of resource this is. Value: the fixed string "content#posCustomBatchResponse". |
| 160 | "entries": [ # The result of the execution of the batch requests. |
| 161 | { |
| 162 | "kind": "content#posCustomBatchResponseEntry", # Identifies what kind of resource this is. Value: the fixed string "content#posCustomBatchResponseEntry". |
| 163 | "errors": { # A list of errors returned by a failed batch entry. # A list of errors defined if, and only if, the request failed. |
| 164 | "message": "A String", # The message of the first error in errors. |
| 165 | "code": 42, # The HTTP status of the first error in errors. |
| 166 | "errors": [ # A list of errors. |
| 167 | { # An error returned by the API. |
| 168 | "reason": "A String", # The error code. |
| 169 | "domain": "A String", # The domain of the error. |
| 170 | "message": "A String", # A description of the error. |
| 171 | }, |
| 172 | ], |
| 173 | }, |
| 174 | "sale": { # The change of the available quantity of an item at the given store. # The updated sale information. |
| 175 | "itemId": "A String", # A unique identifier for the item. |
| 176 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 177 | "kind": "content#posSale", # Identifies what kind of resource this is. Value: the fixed string "content#posSale". |
| 178 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 179 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 180 | "price": { # The price of the item. |
| 181 | "currency": "A String", # The currency of the price. |
| 182 | "value": "A String", # The price represented as a number. |
| 183 | }, |
| 184 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 185 | "gtin": "A String", # Global Trade Item Number. |
| 186 | "saleId": "A String", # A unique ID to group items from the same sale event. |
| 187 | "quantity": "A String", # The relative change of the available quantity. Negative for items returned. |
| 188 | }, |
| 189 | "batchId": 42, # The ID of the request entry to which this entry responds. |
| 190 | "inventory": { # The absolute quantity of an item available at the given store. # The updated inventory information. |
| 191 | "itemId": "A String", # A unique identifier for the item. |
| 192 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 193 | "kind": "content#posInventory", # Identifies what kind of resource this is. Value: the fixed string "content#posInventory". |
| 194 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 195 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 196 | "price": { # The current price of the item. |
| 197 | "currency": "A String", # The currency of the price. |
| 198 | "value": "A String", # The price represented as a number. |
| 199 | }, |
| 200 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 201 | "gtin": "A String", # Global Trade Item Number. |
| 202 | "quantity": "A String", # The available quantity of the item. |
| 203 | }, |
| 204 | "store": { # Store resource. # The retrieved or updated store information. |
| 205 | "storeAddress": "A String", # The street address of the store. |
| 206 | "kind": "content#posStore", # Identifies what kind of resource this is. Value: the fixed string "content#posStore". |
| 207 | "storeCode": "A String", # A store identifier that is unique for the given merchant. |
| 208 | }, |
| 209 | }, |
| 210 | ], |
| 211 | }</pre> |
| 212 | </div> |
| 213 | |
| 214 | <div class="method"> |
| 215 | <code class="details" id="delete">delete(merchantId, targetMerchantId, storeCode, dryRun=None)</code> |
| 216 | <pre>Deletes a store for the given merchant. |
| 217 | |
| 218 | Args: |
| 219 | merchantId: string, The ID of the POS or inventory data provider. (required) |
| 220 | targetMerchantId: string, The ID of the target merchant. (required) |
| 221 | storeCode: string, A store code that is unique per merchant. (required) |
| 222 | dryRun: boolean, Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). |
| 223 | </pre> |
| 224 | </div> |
| 225 | |
| 226 | <div class="method"> |
| 227 | <code class="details" id="get">get(merchantId, targetMerchantId, storeCode)</code> |
| 228 | <pre>Retrieves information about the given store. |
| 229 | |
| 230 | Args: |
| 231 | merchantId: string, The ID of the POS or inventory data provider. (required) |
| 232 | targetMerchantId: string, The ID of the target merchant. (required) |
| 233 | storeCode: string, A store code that is unique per merchant. (required) |
| 234 | |
| 235 | Returns: |
| 236 | An object of the form: |
| 237 | |
| 238 | { # Store resource. |
| 239 | "storeAddress": "A String", # The street address of the store. |
| 240 | "kind": "content#posStore", # Identifies what kind of resource this is. Value: the fixed string "content#posStore". |
| 241 | "storeCode": "A String", # A store identifier that is unique for the given merchant. |
| 242 | }</pre> |
| 243 | </div> |
| 244 | |
| 245 | <div class="method"> |
| 246 | <code class="details" id="insert">insert(merchantId, targetMerchantId, body, dryRun=None)</code> |
| 247 | <pre>Creates a store for the given merchant. |
| 248 | |
| 249 | Args: |
| 250 | merchantId: string, The ID of the POS or inventory data provider. (required) |
| 251 | targetMerchantId: string, The ID of the target merchant. (required) |
| 252 | body: object, The request body. (required) |
| 253 | The object takes the form of: |
| 254 | |
| 255 | { # Store resource. |
| 256 | "storeAddress": "A String", # The street address of the store. |
| 257 | "kind": "content#posStore", # Identifies what kind of resource this is. Value: the fixed string "content#posStore". |
| 258 | "storeCode": "A String", # A store identifier that is unique for the given merchant. |
| 259 | } |
| 260 | |
| 261 | dryRun: boolean, Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). |
| 262 | |
| 263 | Returns: |
| 264 | An object of the form: |
| 265 | |
| 266 | { # Store resource. |
| 267 | "storeAddress": "A String", # The street address of the store. |
| 268 | "kind": "content#posStore", # Identifies what kind of resource this is. Value: the fixed string "content#posStore". |
| 269 | "storeCode": "A String", # A store identifier that is unique for the given merchant. |
| 270 | }</pre> |
| 271 | </div> |
| 272 | |
| 273 | <div class="method"> |
| 274 | <code class="details" id="inventory">inventory(merchantId, targetMerchantId, body, dryRun=None)</code> |
| 275 | <pre>Submit inventory for the given merchant. |
| 276 | |
| 277 | Args: |
| 278 | merchantId: string, The ID of the POS or inventory data provider. (required) |
| 279 | targetMerchantId: string, The ID of the target merchant. (required) |
| 280 | body: object, The request body. (required) |
| 281 | The object takes the form of: |
| 282 | |
| 283 | { |
| 284 | "itemId": "A String", # A unique identifier for the item. |
| 285 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 286 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 287 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 288 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 289 | "price": { # The current price of the item. |
| 290 | "currency": "A String", # The currency of the price. |
| 291 | "value": "A String", # The price represented as a number. |
| 292 | }, |
| 293 | "gtin": "A String", # Global Trade Item Number. |
| 294 | "quantity": "A String", # The available quantity of the item. |
| 295 | } |
| 296 | |
| 297 | dryRun: boolean, Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). |
| 298 | |
| 299 | Returns: |
| 300 | An object of the form: |
| 301 | |
| 302 | { |
| 303 | "itemId": "A String", # A unique identifier for the item. |
| 304 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 305 | "kind": "content#posInventoryResponse", # Identifies what kind of resource this is. Value: the fixed string "content#posInventoryResponse". |
| 306 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 307 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 308 | "price": { # The current price of the item. |
| 309 | "currency": "A String", # The currency of the price. |
| 310 | "value": "A String", # The price represented as a number. |
| 311 | }, |
| 312 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 313 | "gtin": "A String", # Global Trade Item Number. |
| 314 | "quantity": "A String", # The available quantity of the item. |
| 315 | }</pre> |
| 316 | </div> |
| 317 | |
| 318 | <div class="method"> |
| 319 | <code class="details" id="list">list(merchantId, targetMerchantId)</code> |
| 320 | <pre>Lists the stores of the target merchant. |
| 321 | |
| 322 | Args: |
| 323 | merchantId: string, The ID of the POS or inventory data provider. (required) |
| 324 | targetMerchantId: string, The ID of the target merchant. (required) |
| 325 | |
| 326 | Returns: |
| 327 | An object of the form: |
| 328 | |
| 329 | { |
| 330 | "kind": "content#posListResponse", # Identifies what kind of resource this is. Value: the fixed string "content#posListResponse". |
| 331 | "resources": [ |
| 332 | { # Store resource. |
| 333 | "storeAddress": "A String", # The street address of the store. |
| 334 | "kind": "content#posStore", # Identifies what kind of resource this is. Value: the fixed string "content#posStore". |
| 335 | "storeCode": "A String", # A store identifier that is unique for the given merchant. |
| 336 | }, |
| 337 | ], |
| 338 | }</pre> |
| 339 | </div> |
| 340 | |
| 341 | <div class="method"> |
| 342 | <code class="details" id="sale">sale(merchantId, targetMerchantId, body, dryRun=None)</code> |
| 343 | <pre>Submit a sale event for the given merchant. |
| 344 | |
| 345 | Args: |
| 346 | merchantId: string, The ID of the POS or inventory data provider. (required) |
| 347 | targetMerchantId: string, The ID of the target merchant. (required) |
| 348 | body: object, The request body. (required) |
| 349 | The object takes the form of: |
| 350 | |
| 351 | { |
| 352 | "itemId": "A String", # A unique identifier for the item. |
| 353 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 354 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 355 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 356 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 357 | "price": { # The price of the item. |
| 358 | "currency": "A String", # The currency of the price. |
| 359 | "value": "A String", # The price represented as a number. |
| 360 | }, |
| 361 | "saleId": "A String", # A unique ID to group items from the same sale event. |
| 362 | "gtin": "A String", # Global Trade Item Number. |
| 363 | "quantity": "A String", # The relative change of the available quantity. Negative for items returned. |
| 364 | } |
| 365 | |
| 366 | dryRun: boolean, Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). |
| 367 | |
| 368 | Returns: |
| 369 | An object of the form: |
| 370 | |
| 371 | { |
| 372 | "itemId": "A String", # A unique identifier for the item. |
| 373 | "storeCode": "A String", # The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. |
| 374 | "kind": "content#posSaleResponse", # Identifies what kind of resource this is. Value: the fixed string "content#posSaleResponse". |
| 375 | "contentLanguage": "A String", # The two-letter ISO 639-1 language code for the item. |
| 376 | "timestamp": "A String", # The inventory timestamp, in ISO 8601 format. |
| 377 | "price": { # The price of the item. |
| 378 | "currency": "A String", # The currency of the price. |
| 379 | "value": "A String", # The price represented as a number. |
| 380 | }, |
| 381 | "targetCountry": "A String", # The CLDR territory code for the item. |
| 382 | "gtin": "A String", # Global Trade Item Number. |
| 383 | "saleId": "A String", # A unique ID to group items from the same sale event. |
| 384 | "quantity": "A String", # The relative change of the available quantity. Negative for items returned. |
| 385 | }</pre> |
| 386 | </div> |
| 387 | |
| 388 | </body></html> |