Connect other systems
Give your own scripts an API key, send events to your systems with webhooks, and see, approve and remove the apps that act on your store.
4 chapters · 2:30 · narrated in English · captions in English and French
Module 25 · 4 chapters · 2:30
Connect other systems
Give your own scripts an API key, send events to your systems with webhooks, and see, approve and remove the apps that act on your store.
Example store: Maple & Brass, a jewellery shop in Toronto. Names, addresses and figures are made up.
Transcript
01 API keys for your own scripts
For a script of your own, open “API keys” under Settings, on every plan. Under “Create new API key”, give the key a name and choose an expiry.
Press “Generate key”. If you use two-factor sign-in, “Confirm it's you” asks for the code from your authenticator app first.
“Copy this key now — it will never be shown again”. Your script sends it with each request, as the header shown under “How to use your API key”.
02 What a key can do
A new key can only read until you tick more. Under “What this key can do”, an owner or admin can let it change products or stock, fulfil orders or manage webhooks.
Each key belongs to this store only, and allows 600 requests a minute. An expired key stops working by itself, so set an expiry on keys you hand to others.
“Revoke” stops a key at once, and “Re-enable” brings it back. The list shows when each key was “Last used”.
03 Webhooks
Webhooks tell your systems the moment something happens. Open “Webhooks”, press “Add endpoint”, and enter the “Endpoint URL”.
Tick the “Events to subscribe”, such as an order paid or shipped, a refund, or low stock. Every one listed is an event the platform really sends.
Press “Create endpoint” and copy the “Signing secret”: it is shown once. Your receiver uses it to check that each delivery came from us.
“Recent deliveries” shows what was sent. After 20 failures in a row the endpoint is switched off; fix the receiver and enable it again.
To change the secret, “Rotate secret”: deliveries carry both signatures while you deploy, then press “Finish rotation”.
04 Apps that act on your store
Integrations that act for you are apps. “Installed apps” lists each one you approved, with the access it holds and when it was last used.
“Remove” stops an app straight away, and switches off the webhooks it created. To build your own, use “Register an app”.
Enter the “App name”, the “Developer email” and the “Redirect URI”, tick the “Scopes this app may request”, and press “Register”.
The “Client ID” and “Client secret” appear once. Store the secret safely, then press “I have saved it”. “New secret” replaces a lost one.
Registering grants nothing by itself. The app sends you to an approval screen, and it gets only the access you approve. Next: your customer emails.
Transcription en français
01 Des clés d’API pour vos scripts
Pour un script à vous, ouvrez « API keys » sous Settings, avec tous les forfaits. Sous « Create new API key », nommez la clé et choisissez une expiration.
Appuyez sur « Generate key ». Si vous utilisez la connexion à deux facteurs, « Confirm it's you » demande d’abord le code de votre application d’authentification.
« Copy this key now — it will never be shown again ». Votre script l’envoie à chaque requête, dans l’en-tête montré sous « How to use your API key ».
02 Ce qu’une clé peut faire
Une nouvelle clé ne fait que lire. Sous « What this key can do », un propriétaire ou un admin peut l’autoriser à modifier produits et stocks, expédier des commandes ou gérer les webhooks.
Chaque clé n’appartient qu’à cette boutique, et permet 600 requêtes par minute. Une clé expirée cesse de fonctionner d’elle-même : fixez une expiration aux clés confiées à d’autres.
« Revoke » arrête une clé aussitôt, et « Re-enable » la rétablit. La liste indique quand chaque clé a été « Last used ».
03 Les webhooks
Les webhooks avertissent vos systèmes dès qu’un événement se produit. Ouvrez « Webhooks », appuyez sur « Add endpoint », et entrez l’« Endpoint URL ».
Cochez les « Events to subscribe », comme une commande payée ou expédiée, un remboursement ou un stock bas. Chacun est un événement réellement envoyé.
Appuyez sur « Create endpoint » et copiez le « Signing secret » : il n’est montré qu’une fois. Votre récepteur s’en sert pour vérifier que chaque envoi vient de nous.
« Recent deliveries » montre ce qui a été envoyé. Après 20 échecs de suite, le point de terminaison est désactivé; réparez le récepteur et réactivez-le.
Pour changer le secret, « Rotate secret » : les envois portent les deux signatures pendant votre déploiement, puis appuyez sur « Finish rotation ».
04 Les applications qui agissent sur votre boutique
Les intégrations qui agissent pour vous sont des applications. « Installed apps » liste chacune de celles que vous avez approuvées, avec son accès et sa dernière utilisation.
« Remove » arrête une application aussitôt, et désactive les webhooks qu’elle a créés. Pour créer la vôtre, utilisez « Register an app ».
Entrez l’« App name », le « Developer email » et le « Redirect URI », cochez les « Scopes this app may request », et appuyez sur « Register ».
Le « Client ID » et le « Client secret » n’apparaissent qu’une fois. Gardez le secret en lieu sûr, puis appuyez sur « I have saved it ». « New secret » remplace un secret perdu.
L’enregistrement n’accorde rien. L’application vous envoie vers un écran d’approbation, et n’obtient que l’accès que vous approuvez. À suivre : vos courriels aux clients.
Next on the path: Module 26, Emails and help pages your customers see.
Narration is synthesised on our own servers from the script above, in a public-domain voice. Voice credits.