Created
February 11, 2016 01:06
-
-
Save Mozu-CS/10e9021aa9780320692f to your computer and use it in GitHub Desktop.
A gist for adding locations through the API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var FiddlerProxy = require('mozu-node-sdk/plugins/fiddler-proxy'); | |
| var apiContext = require('mozu-node-sdk/clients/platform/application')(); | |
| apiContext.plugins = [FiddlerProxy]; | |
| var locationResource = require('mozu-node-sdk/clients/commerce/admin/location')(apiContext); | |
| var location = | |
| { | |
| "code": "retailops1", | |
| "locationTypes": [{ "code": "warehouse", "name": "Warehouse" }], | |
| "fulfillmentTypes": [{ "code": "DS", "name": "Direct Ship", "shippingRequired": true }], | |
| "shippingOriginContact": | |
| { | |
| "firstName": "", | |
| "middleNameOrInitial": "", | |
| "lastNameOrSurname": "", | |
| "companyOrOrganization": "My Company", | |
| "phoneNumber": "(555) 555-5555", | |
| "email": "[email protected]" | |
| }, | |
| "isDisabled": false, | |
| "name": "Retailops Default Location", | |
| "description": "", | |
| "address": | |
| { | |
| "address1": "123 Example Ave", | |
| "address2": "", | |
| "address3": "", | |
| "address4": "", | |
| "cityOrTown": "San Diego", | |
| "stateOrProvince": "CA", | |
| "countryCode": "US", | |
| "postalOrZipCode": "80301", | |
| "addressType": "Commercial", | |
| "addressIsValidated": false | |
| }, | |
| "geo": { "lat": null, "lng": null }, | |
| "phone": "", | |
| "fax": "", | |
| "note": "", | |
| "supportsInventory": false, | |
| "allowFulfillmentWithNoStock": false, | |
| "tags": [], | |
| "regularHours": { "sunday": { "label": "" }, "monday": { "label": "" }, "tuesday": { "label": "" }, "wednesday": { "label": "" }, "thursday": { "label": "" }, "friday": { "label": "" }, "saturday": { "label": "" } } | |
| } | |
| locationResource.addLocation(location) | |
| .then(log) | |
| .catch(reportError); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment