{"id":13509963,"url":"https://github.com/netlify/gocommerce","last_synced_at":"2026-01-12T02:54:19.418Z","repository":{"id":10205736,"uuid":"62554992","full_name":"netlify/gocommerce","owner":"netlify","description":"A headless e-commerce for JAMstack sites.","archived":false,"fork":false,"pushed_at":"2023-10-10T23:22:08.000Z","size":7715,"stargazers_count":1576,"open_issues_count":22,"forks_count":215,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-05-14T15:14:40.191Z","etag":null,"topics":["ecommerce","headless","jamstack","managed-services","platform","production"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netlify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-04T10:48:35.000Z","updated_at":"2025-05-13T03:44:00.000Z","dependencies_parsed_at":"2024-06-18T17:10:30.843Z","dependency_job_id":"9c098785-daa4-497f-9b1d-ef9508d048e6","html_url":"https://github.com/netlify/gocommerce","commit_stats":null,"previous_names":["netlify/netlify-commerce"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fgocommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fgocommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fgocommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify%2Fgocommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netlify","download_url":"https://codeload.github.com/netlify/gocommerce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319720,"owners_count":22051073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecommerce","headless","jamstack","managed-services","platform","production"],"created_at":"2024-08-01T02:01:18.876Z","updated_at":"2026-01-12T02:54:19.411Z","avatar_url":"https://github.com/netlify.png","language":"Go","readme":"# GoCommerce [![Build Status](https://travis-ci.org/netlify/gocommerce.svg?branch=master)](https://travis-ci.org/netlify/gocommerce)\n\nA small go based API for static e-commerce sites.\n\nIt handles orders and payments. Integrates with Stripe for payments and will support\ninternational pricing and VAT verification.\n\nGoCommerce is released under the [MIT License](LICENSE).\nPlease make sure you understand its [implications and guarantees](https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html).\n\n### What your static site must support\n\nEach product you want to sell from your static site must have unique URL where GoCommerce\ncan find the meta data needed for calculating pricing and taxes in order to verify that\nthe order is legitimate before using Stripe to charge the client.\n\nThe metadata can be anywhere on the page, and goes in a script tag in this format:\n\n```html\n\u003cscript class=\"gocommerce-product\" type=\"application/json\"\u003e\n{\"sku\": \"my-product\", \"title\": \"My Product\", \"prices\": [{\"amount\": \"49.99\", \"currency\": \"USD\"}], \"type\": \"ebook\"}\n\u003c/script\u003e\n```\n\nThe minimum required is the Sku, title and at least one \"price\". Default currency is USD if nothing else specified.\n\n### VAT, Countries and Regions\n\nGoCommerce will regularly check for a file called `https://example.com/gocommerce/settings.json`\n\nThis file should have settings with rules for VAT or currency regions.\n\nThis file is not required for GoCommerce to work, but will enable support for various advanced\nfeatures. Currently it enables VAT calculations on a per country/product type basic.\n\nThe reason we make you include the file in the static site, is that you'll need to do the same\nVAT calculations client side during checkout to be able to show this to the user. The\n[commerce-js](https://github.com/netlify/netlify-commerce-js) client library can help you with\nthis.\n\nHere's an example settings file:\n\n```json\n{\n  \"taxes\": [{\n    \"percentage\": 20,\n    \"product_types\": [\"ebook\"],\n    \"countries\": [\"Austria\", \"Bulgaria\", \"Estonia\", \"France\", \"Gibraltar\", \"Slovakia\", \"United Kingdom\"]\n  }, {\n    \"percentage\": 7,\n    \"product_types\": [\"book\"],\n    \"countries\": [\"Austria\", \"Belgium\", \"Bulgaria\", \"Croatia\", \"Cyprus\", \"Denmark\", \"Estonia\"]\n  }]\n}\n```\n\nBased on these rules, if an order includes a product with \"type\" set to \"ebook\" in the product metadata\non the site and the users billing Address is set to \"Austria\", GoCommerce will verify that a 20 percentage\ntax has been included in that product.\n\n\n## JavaScript Client Library\n\nThe easiest way to use GoCommerce is with [commerce-js](https://github.com/netlify/netlify-commerce-js).\n\n**IMPORTANT:** Since Release 1.8.0 of GoCommerce at least Version 5.0.0 of the JavaScript Client is required.\n\n## Running the GoCommerce backend\n\nGoCommerce can be deployed to any server environment that runs Go. Minimum requirement for Go is version 1.11 since GoCommerce is using Go modules.\n\nThe button below provides a quick way to get started by running on Heroku:\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/netlify/gocommerce)\n\n## Configuration\n\nYou may configure GoCommerce using either a configuration file named `.env`,\nenvironment variables, or a combination of both. Environment variables are prefixed with `GOCOMMERCE_`, and will always have precedence over values provided via file.\n\nFor local dev, the easiest way to get started is to copy the included `example.env` file to `.env`\n\n### Top-Level\n\n```\nGOCOMMERCE_SITE_URL=https://example.netlify.com/\n```\n\n`SITE_URL` - `string` **required**\n\nThe base URL your site is located at.\n\n`OPERATOR_TOKEN` - `string` *Multi-instance mode only*\n\nThe shared secret with an operator (usually Netlify) for this microservice. Used to verify requests have been proxied through the operator and\nthe payload values can be trusted.\n\n### API\n\n```\nGOCOMMERCE_API_HOST=localhost\nPORT=9999\n```\n\n`API_HOST` - `string`\n\nHostname to listen on.\n\n`PORT` (no prefix) / `API_PORT` - `number`\n\nPort number to listen on. Defaults to `8080`.\n\n`API_ENDPOINT` - `string` *Multi-instance mode only*\n\nControls what endpoint Netlify can access this API on.\n\n### Database\n\n```\nGOCOMMERCE_DB_DRIVER=sqlite3\nDATABASE_URL=gotrue.db\n```\n\n`DB_DRIVER` - `string` **required**\n\nChooses what dialect of database you want. Choose from `sqlite3`, `mysql`, or `postgres`.\n\n`DATABASE_URL` (no prefix) / `DB_DATABASE_URL` - `string` **required**\n\nConnection string for the database. See the [gorm examples](https://github.com/jinzhu/gorm/blob/gh-pages/documents/database.md) for more details.\n\n`DB_NAMESPACE` - `string`\n\nAdds a prefix to all table names.\n\n`DB_AUTOMIGRATE` - `bool`\n\nIf enabled, creates missing tables and columns upon startup.\n\n### Logging\n\n```\nLOG_LEVEL=debug\n```\n\n`LOG_LEVEL` - `string`\n\nControls what log levels are output. Choose from `panic`, `fatal`, `error`, `warn`, `info`, or `debug`. Defaults to `info`.\n\n`LOG_FILE` - `string`\n\nIf you wish logs to be written to a file, set `log_file` to a valid file path.\n\n### Payment\n\n#### Stripe\n\n`PAYMENT_STRIPE_ENABLED` - `bool`\n\nWhether Stripe is enabled as a payment provider or not.\n\n`PAYMENT_STRIPE_SECRET_KEY` - `string`\n\nThe Stripe [secret key](https://stripe.com/docs/api#authentication) used when authenticating with the Stripe API.\n\n#### PayPal\n\n`PAYMENT_PAYPAL_ENABLED` - `bool`\n\nWhether PayPal is enabled as a payment provider or not.\n\n`PAYMENT_PAYPAL_CLIENT_ID` - `string`\n`PAYMENT_PAYPAL_SECRET` - `string`\n\nThe OAuth credentials PayPal issued to you. GoCommerce will use them to [obtain an access token](https://developer.paypal.com/docs/api/overview/#authentication-and-authorization).\n\n`PAYMENT_PAYPAL_ENV` - `string`\n\nThe PayPal environment to use. Choose from `production` or `sandbox`.\n\n### Downloads\n\n`DOWNLOADS_PROVIDER` - `string`\n\nThe provider to use for downloads. Choose from `netlify` or ``.\n\n`DOWNLOADS_NETLIFY_TOKEN` - `string`\n\nThe authentication bearer token used to access the Netlify downloads API.\n\n### Coupons\n\n`COUPONS_URL` - `string`\n\nA URL that contains all the coupon information in JSON.\n\n`COUPONS_USER` - `string`\n`COUPONS_PASSWORD` - `string`\n\nHTTP Basic Authentication information to use if required to access the coupon information.\n\n### Webhooks\n\n`WEBHOOKS_ORDER` - `string`\n`WEBHOOKS_PAYMENT` - `string`\n`WEBHOOKS_UPDATE` - `string`\n`WEBHOOKS_REFUND` - `string`\n\nA URL to send a webhook to when the corresponding action has been performed.\n\n`WEBHOOKS_SECRET` - `string`\n\nA secret used to sign a JWT included in the `X-Commerce-Signature` header. This can be used to verify the webhook came from GoCommerce.\n\n### JSON Web Tokens (JWT)\n\n```\nGOCOMMERCE_JWT_SECRET=supersecretvalue\n```\n\n`JWT_SECRET` - `string` **required**\n\nThe secret used to verify JWT tokens with.\n\n`JWT_ADMIN_GROUP_NAME` - `string`\n\nThe name of the admin group (if enabled). Defaults to `admin`.\n\n### E-Mail\n\nSending email is not required, but is highly recommended.\nIf enabled, you must provide the required values below.\n\n```\nGOCOMMERCE_SMTP_HOST=smtp.mandrillapp.com\nGOCOMMERCE_SMTP_PORT=587\nGOCOMMERCE_SMTP_USER=smtp-delivery@example.com\nGOCOMMERCE_SMTP_PASS=correcthorsebatterystaple\nGOCOMMERCE_SMTP_ADMIN_EMAIL=support@example.com\nGOCOMMERCE_MAILER_SUBJECTS_ORDER_CONFIRMATION=\"Please confirm\"\n```\n\n`SMTP_ADMIN_EMAIL` - `string` **required**\n\nThe `From` email address for all emails sent. Order receipts are also sent to this address.\n\n`SMTP_HOST` - `string` **required**\n\nThe mail server hostname to send emails through.\n\n`SMTP_PORT` - `number` **required**\n\nThe port number to connect to the mail server on.\n\n`SMTP_USER` - `string`\n\nIf the mail server requires authentication, the username to use.\n\n`SMTP_PASS` - `string`\n\nIf the mail server requires authentication, the password to use.\n\n`MAILER_SUBJECTS_ORDER_CONFIRMATION` - `string`\n\nEmail subject to use for order confirmations. Defaults to `Order Confirmation`.\n\n`MAILER_SUBJECTS_ORDER_RECEIVED` - `string`\n\nEmail subject to use for orders sent to the store admin. Defaults to `Order Received From {{ .Order.Email }}`.\n\n`MAILER_TEMPLATES_ORDER_CONFIRMATION` - `string`\n\nURL path, relative to the `SITE_URL`, of an email template to use when sending an order confirmation.\n`Order` and `Transaction` variables are available.\n\nDefault Content (if template is unavailable):\n```html\n\u003ch2\u003eThank you for your order!\u003c/h2\u003e\n\n\u003cul\u003e\n{{ range .Order.LineItems }}\n\u003cli\u003e{{ .Title }} \u003cstrong\u003e{{ .Quantity }} x {{ .Price }}\u003c/strong\u003e\u003c/li\u003e\n{{ end }}\n\u003c/ul\u003e\n\n\u003cp\u003eTotal amount: \u003cstrong\u003e{{ .Order.Total }}\u003c/strong\u003e\u003c/p\u003e\n```\n\n`MAILER_TEMPLATES_ORDER_RECEIVED` - `string`\n\nURL path, relative to the `SITE_URL`, of an email template to use when sending order details to the store admin.\n`Order` and `Transaction` variables are available.\n\nDefault Content (if template is unavailable):\n```html\n\u003ch2\u003eOrder Received From {{ .Order.Email }}\u003c/h2\u003e\n\n\u003cul\u003e\n{{ range .Order.LineItems }}\n\u003cli\u003e{{ .Title }} \u003cstrong\u003e{{ .Quantity }} x {{ .Price }}\u003c/strong\u003e\u003c/li\u003e\n{{ end }}\n\u003c/ul\u003e\n\n\u003cp\u003eTotal amount: \u003cstrong\u003e{{ .Order.Total }}\u003c/strong\u003e\u003c/p\u003e\n```\n","funding_links":["https://developer.paypal.com/docs/api/overview/"],"categories":["Go","others","jamstack"],"sub_categories":["AWS Amplify"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify%2Fgocommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetlify%2Fgocommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify%2Fgocommerce/lists"}