Það sem þú þarft til að þetta virki
– google apps spreadsheet
– vefþjónustu add-on hjá Konto (í boði hjá öllum greiddum áskriftum)
— Stillingar > Vefþjónusta
Stillingar (gert einu sinni, ~5 mín)
Step 1 — Create a new Google Spreadsheet
Go to sheets.new to create a blank spreadsheet. Give it a name like Konto Product Sales.
Step 2 — Open the Apps Script editor
In your spreadsheet, click Extensions → Apps Script (IS: Viðbætur –> Apps Script). A new tab opens with a code editor.
Step 3 — Paste the script
- Select all the existing code in the editor (Ctrl+A / Cmd+A) and delete it.
- Paste the entire contents of
KontoProductSales.gsinto the editor.
Step 4 — Add your credentials (stillingar > vefþjónusta)
Near the top of the script, find this block:
javascript
var CONFIG = {
BASE_URL: "https://konto.is/api/v1",
USERNAME: "YOUR_USERNAME_HERE", // ← replace this
API_KEY: "YOUR_API_KEY_HERE", // ← replace this
PAGE_SIZE: 100
};
Replace YOUR_USERNAME_HERE with your Konto username and YOUR_API_KEY_HERE with your API key. Keep the quotes.
Example:
javascript
USERNAME: "bjossi",
API_KEY: "abc123def456...",
Step 5 — Save the script
Click the Save button (💾) or press Ctrl+S / Cmd+S.
Step 6 — Authorize the script
- Close the Apps Script tab and go back to your spreadsheet.
- Reload the page (F5 / Cmd+R).
- A 🔄 Konto menu will appear in the menu bar.
- Click 🔄 Konto → Pick a Product Sale…
- Google will show an authorization dialog — click Review permissions, choose your Google account, and click Allow.
This authorization is only needed once. It gives the script permission to make external web requests (to the Konto API) and write to your spreadsheet.
Daily use
The menu options
| Menu item | What it does |
|---|---|
| Refresh All Data | Refreshes the sales count + reloads attendees for the last selected product |
| Refresh Sales Count only | Updates the total number of product sales on the Summary sheet |
| Pick a Product Sale… | Shows your full list of product pages so you can choose one to load attendees for |
Loading attendees for a product
- Click 🔄 Konto → Pick a Product Sale…
- A dialog lists all your products numbered — e.g.
1. Test event on FEB 17th - Note the number of the product you want, click OK
- A second dialog asks: “Enter the number (1–22):” — type it and click OK
- The Attendees sheet populates with the full attendee list
The Attendees sheet layout
| Row | Content |
|---|---|
| Row 1 | Title |
| Row 2 | Active product GUID + last updated timestamp |
| Row 3 | (empty) |
| Row 4 | Column headers (from the API response) |
| Row 5+ | Attendee data |
Typical columns include: attendee, phone_number, qty, invoice_number, kennitala, invoice_status, name, message, attended.
Refreshing data for the same product
Once you’ve picked a product, Refresh All Data will reload both the count and the attendees for that same product automatically. You only need to use the picker again when you want to switch to a different product.
Switching between dev and production
By default the script points to production (konto.is). To test against the dev server, change the BASE_URL in the CONFIG block:
javascript
BASE_URL: "https://dev.konto.is/api/v1", // dev
BASE_URL: "https://konto.is/api/v1", // production
Troubleshooting
“Authentication Failed” — Double-check that your USERNAME and API_KEY in the CONFIG block are correct and have no extra spaces.
“No product sales found” — Verify your credentials are correct and that you have product sale pages in your Konto account.
“HTTP 4xx” error — The API endpoint may have changed. Check the latest docs at konto.is/api/v1/document.
Authorization dialog keeps appearing — Make sure you click Allow and not Cancel during the one-time authorization step.
Attendees sheet looks empty after picking a product — The product may have 0 registered attendees, or the product type may not support attendees (only KONTO_SELL_PRODUCT_EVENT type has attendees).
API reference
| Endpoint | Description |
|---|---|
POST /get-product-sales | List all product sale pages |
POST /get-count-product-sales | Total count of product sales |
POST /get-product-sale-attends | Attendee list for a specific product (requires guid) |
Full documentation: konto.is/api/v1/document → Sell Product section
