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
| { | |
| "openapi" : "3.0.0", | |
| "servers" : [ ], | |
| "info" : { | |
| "description" : "Welcome to the REST API Documentation for VOLT, by Volusion.\n\nDomain: `https://api.material.com`\n\nAll requests need a Bearer Token for Authorization, and a `x-mat-tenant` header with a value of the Merchant's Store Identifier (tenantId). Tokens are obtained via Admin Authentication. \n\nIf you are looking to develop an App for VOLT please reach out to our Partners Team, [email protected]", | |
| "version" : "1.0.0", | |
| "title" : "VOLT API", | |
| "contact" : { | |
| "email" : "[email protected]" | |
| }, |
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
| /***************************************************************************/ | |
| // import the order into ShipStation | |
| /***************************************************************************/ | |
| const shipstationAPI = require('node-shipstation'); | |
| const shipstation = new shipstationAPI( | |
| SHIPSTATION_API_KEY, // api key | |
| SHIPSTATION_API_SECRET // api secret | |
| ); | |
| shipstation.addOrder(orderInShipStationFormat, function(err, res, body) { |
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
| /***************************************************************************/ | |
| // map volt to shipstation | |
| /***************************************************************************/ | |
| // left side is the volt order format... --> right side is shipstation order model | |
| // but first, map a few new properties ShipStation expects | |
| let totalOrderWeight = 0 | |
| order.cart.items.map( item => { | |
| item.product.weight_unit = 'grams'; |
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
| // ---------------------------------------------------- | |
| // Make Volt API Request: get orders | |
| // ---------------------------------------------------- | |
| exports.getOrders = async function getOrders() { | |
| // endpoint url | |
| const url = "https://api.material.com/store/admin/orders" | |
| // request method | |
| const method = "GET" |
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
| // Credentials | |
| const SHIPSTATION_API_KEY = "INSERT_YOUR_SHIPSTATION_API_KEY" | |
| const SHIPSTATION_API_SECRET = "INSERT_YOUR_SHIPSTATION_API_KEY" |
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
| // Tenant + App Credentials | |
| const tenant = "INSERT_YOUR_TENANT_ID" | |
| const appId = "INSERT_YOUR_EMAIL" | |
| const appSecret = "INSERT_YOUR_PASSWORD" |
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
| <!-- Google Maps API for checkout page --> | |
| <script src="/v/vspfiles/templates/269/js/map.js"></script> | |
| <script src="https://maps.googleapis.com/maps/api/js?key={{insert-your-google-api-key}}&callback=initAddress&libraries=places" async defer></script> |
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
| // This script is used to move email address box to top of checkout form, | |
| // and prompt for login if user already has account | |
| 'use strict'; | |
| console.log('Check Email'); | |
| // Check email function | |
| function checkEmail(email) { | |
| console.log('Checking email ' + email); |