API, Sheets and Webhooks
Updated
Can I read my Shopify apps cockpit from my own scripts?
Yes, with the read API. Under Settings → API tokens, name a token and press Make a token; copy it then, it is shown only once. Send it as Authorization: Bearer with each request to https://team.hybridcod.com/api/v1: your apps, their shops, sales, events and keyword positions, as JSON.
A token belongs to you in this workspace and reads exactly what you can read, never more; it cannot change anything. 120 requests a minute per token. Revoke stops it at once. Every route, field and error is on /docs/api.
How do I keep a Google Sheet up to date with my numbers?
Under Settings → API tokens, Google Sheets: pick the app and the table (payouts, shops, events, keywords or affiliates) and press Make a Sheets link. For affiliates a third picker chooses all of them or some, ticked one by one: the sheet has each one’s deal and, month by month, what they earned, were paid and are owed (members of the project only). Paste the formula it gives in cell A1 of an empty sheet; Google refreshes it about every hour.
The link is shown only once and reads that one table and nothing else; revoke it in the token list like any token.
Can my server be told when a store installs or leaves?
Yes. Under Settings → Webhooks, Add webhook with an https address and the events you want (installs, uninstalls, charges and the rest). Each event is posted there as JSON within a minute of being synced from Shopify, signed with a secret shown once: check the X-Hybrid-Signature header as /docs/api#webhooks shows.
Answer 2xx within 10 seconds; anything else is retried for a day. Send a test posts a PING. An address that fails 50 times in a row is paused; Resume it once it is fixed.
New secret replaces the old one.
How does my app send us its merchants' emails?
With the Identify API, from your app's server: make its key on the app's Emails tab and call it once on install with the store's domain and email from Shopify's shop API. The fields, an example in Node, the limits and the errors are on /docs/api#identify. Help → Emails to your app's merchants says what the emails are then used for.