This project uses Shopify webhooks to parse orders from Shopify, produce CSV format required by Emons and upload CSV to the Emons's FTP server.
- NodeJS (tested on v10.15.3, see
engines
section ofpackage.json
) - MySQL (tested on v5.7.18)
- Shopify "Order payment" webhook. Learn more about setting it up.
- SSL (https) - required by Shopify. You can use ngrok for local testing
Copy .env.example
to .env
file:
cp .env.example .env
Change parameters accordingly.
- MySQL:
DB_USER
- required - usernameDB_PASS
- required - passwordDB_NAME
- required - database nameDB_HOST
- IP or domain name, defaults tolocalhost
DB_PORT
- port, defaults to3306
FORCE_DB_SYNC
- set totrue
if you want to reset you DB - will RESET your orders table (i.e., delete all orders)
- SSL/HTTP:
SSL_PRIVATE_KEY
- required for production - full path to your private key (-----BEGIN PRIVATE KEY-----
...)SSL_CERTIFICATE
- required for production - full path to your certificate (-----BEGIN CERTIFICATE-----
...)HTTP_PORT
- port for listening to HTTP requests (helpful for local testing), defaults to80
HTTPS_PORT
- port for listening to HTTPS requests, default to443
USE_HTTPS
- whether to use HTTPS or not (helpful for local testing), defaults tofalse
- Shopify:
SHOPIFY_WEBHOOK_SECRET
- required - token used to validate webhooks, can be found at https://yourstore.myshopify.com/admin/settings/notifications (replaceyourstore
in url)SHOP_DOMAIN
- required - used to validate webhooks
- FTP:
FTP_USER
- required - usernameFTP_PASS
- required - passwordFTP_HOST
- where to upload CSV files, defaults toftp.emons.de
FTP_PORT
- ftp port, defaults to21
FTP_SECURE
- use FTPS or not, defaults tofalse