|
| 1 | +Create an API key |
| 2 | +====== |
| 3 | + |
| 4 | +An API key is used in the authorisation assertion grant flow for an app. It must be created by a Zettle merchant in their my.zettle.com. |
| 5 | + |
| 6 | +If you're developer of a self-hosted app, share this guide with the merchant that will use the app. |
| 7 | + |
| 8 | +* [Create an API key with a link from the developer](#create-an-api-key-with-a-link-from-the-developer) |
| 9 | +* [Create an API with OAuth scopes from the developer](#create-an-api-key-with-oauth-scopes-from-the-developer) |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | +* You are a Zettle merchant and have an account at my.zettle.com. |
| 13 | +* You have a link or OAuth scopes from the developer of the app that you will use. The OAuth scopes are permissions that you give to the developer to access your Zettle account data. |
| 14 | + |
| 15 | +## Create an API key with a link from the developer |
| 16 | + |
| 17 | +1. Open the link from the developer. |
| 18 | + |
| 19 | +2. Enter your Zettle account password. |
| 20 | + |
| 21 | +3. Review the information and click **Create key**. A client ID will be created together with the API key. |
| 22 | + |
| 23 | + <img id="create-API-keys-from-the-deep-link" src="../../../images/create-API-keys-from-the-deep-link.png" alt="This screenshot shows the dialog that is started after clicking a deep link for creating API keys. You can find the Create key button in the lower right corner of the dialog."> |
| 24 | + |
| 25 | +4. On the Create API key page, click **Copy key**. Keep the API key and the client ID as secret somewhere safe. |
| 26 | + |
| 27 | + <img id="copy-key" src="../../../images/copy-key.png" alt="This screenshot shows the dialog where you can copy the API key and save it for later use. You can find the Copy key button in the lower right corner of the dialog."> |
| 28 | + |
| 29 | +5. Share the API key and client ID with the developer who sent you the link. |
| 30 | + |
| 31 | + The created key is shown in the list of keys. After the integration starts working with the key, the Last used column will show the last time the integration accessed your Zettle data. |
| 32 | + |
| 33 | + <img id="available-API-keys" src="../../../images/available-API-keys.png" alt="This screenshot shows the dialog where you can see a list of created API keys and their scopes."> |
| 34 | + |
| 35 | +## Create an API key with OAuth scopes from the developer |
| 36 | + |
| 37 | +1. Go to [my.zettle.com](https://my.zettle.com/) and log in to your account. |
| 38 | + |
| 39 | +2. On the left panel, click **Integrations**. |
| 40 | + |
| 41 | + <img id="check-integrations-in-my.zettle.com" src="../../../images/check-integrations-in-my.zettle.com.png" alt="This screenshot shows my zettle.com where you can find the Integrations link in the lower left corner of the left navigation menu."> |
| 42 | + |
| 43 | +3. Under the Integration tools section, click **API Keys**. |
| 44 | + |
| 45 | + <img id="API-keys-in-Integration-tools" src="../../../images/API-keys-in-Integration-tools.png" alt="This screenshot shows the Integrations page where you can find the API keys link in the lower left corner of the left navigation menu on the page."> |
| 46 | + |
| 47 | +4. Click **Create API Key**. |
| 48 | + |
| 49 | + <img id="create-API-key-dialog" src="../../../images/create-API-key-dialog.png" alt="This screenshot shows the Available API keys page where you can find the Create API key button in the upper right corner before the available API keys list on the page."> |
| 50 | + |
| 51 | +5. Give a name to your key. Keep it short and descriptive. One good practice is to use the integration name as the key name. |
| 52 | + |
| 53 | +6. Select the OAuth scopes that the developer provided. The OAuth scopes are permissions that you give to the developer to access your Zettle account data. |
| 54 | + |
| 55 | +7. Click **Create key**. A client ID will be created together with the API key. |
| 56 | + |
| 57 | + <img id="select-scopes-create-API-keys-dialog" src="../../../images/select-scopes-create-API-keys-dialog.png" alt="This screenshot shows the dialog where you can select scopes for the API key that you will create. You can find the Create key button in the lower right corner of the dialog."> |
| 58 | + |
| 59 | +8. Confirm your password. |
| 60 | + |
| 61 | +9. On the Create API key page, click **Copy key**. Keep the API key and the client ID as secret somewhere safe. |
| 62 | + |
| 63 | + <img id="copy-key" src="../../../images/copy-key.png" alt="This screenshot shows the dialog where you can copy the API key and save it for later use. You can find the Copy key button in the lower right corner of the dialog."> |
| 64 | + |
| 65 | +10. Share the API key and client ID with the developer. |
| 66 | + |
| 67 | + The created key is shown in the list of keys. After the integration starts working with the key, the Last used column will show the last time the integration accessed your Zettle data. |
| 68 | + |
| 69 | + <img id="available-API-keys" src="../../../images/available-API-keys.png" alt="This screenshot shows the Available API keys page where you can see a list of created API keys."> |
| 70 | + |
| 71 | +## Related task |
| 72 | +* [Create a self-hosted app](create-a-self-hosted-app.md) |
| 73 | + |
| 74 | +## Related API reference |
| 75 | +None |
0 commit comments