Skip to main content
Every store has a customer panel on its myshoply.gg address. The Customer API is the same thing for your own site, or for an app: a buyer signs in with a code sent to their email, and gets a token that reaches their own orders at your store and nothing else. There is no API key in it. The buyer’s own browser or app asks Shoply, and Shoply sends the code and decides who they are.

The Customer API or an API key

Signing a buyer in

  1. The buyer types their email address. Send a sign-in code emails them six digits, in your store’s name.
  2. They type the code. Sign in with the code answers their token.
  3. Every other request sends it: Authorization: Bearer shoply_ct_....
Your store’s ID is in Settings, General. It is not a secret: a page may show it. A code works for 10 minutes and five tries, and signs in once.

What the answer says about an address

The same thing for every address. A code is only emailed to an address that has orders at your store, and the answer does not say whether it did, so nobody can use your sign-in to find out who has bought from you. Say so on your page: “If you have bought here, a code is on its way.”

Keeping the token

  • It works for 30 days from sign-in, then the buyer signs in again. Using it does not make it last longer.
  • Keep it where only your page or app can read it: in memory, or your app’s own secure storage. Never put it in an address, where it ends up in logs and in what the browser tells the next site.
  • A buyer holds 20 tokens at your store at most. Signing in a 21st time ends their oldest.
  • Sign out ends the token the request is made with. Sign out everywhere ends every token they hold at your store, and signs them out of its customer panel.

What a token reaches

These are the customer panel’s own, and they answer what the panel shows:
  • What your settings switch off is refused here too: an affiliate programme that is off, payouts you do not allow, cancelling or pausing that you do not let buyers do.
  • An order’s keys and files are left out while you hold them back: a subscription that ended or is paused, or a payment that is disputed where you take access back.
  • Opening an order is recorded, as on its order page, as a look from your own site. It is part of what a dispute can show the bank.
  • productPath on an order’s line is the product’s path on your store’s own site.

Limits

Ask from the buyer’s own device. Asking for a code and signing in are counted for the address that asks, so a server asking for every buyer would run out at once. Every answer to a request with a token says where its budget stands, in the same headers as the rest of the API.

When it says no

Keeping buyers safe

  • Any site may ask the Customer API from a browser, and never with cookies. A page that was not handed a buyer’s token cannot do anything as them.
  • The email tells the buyer to type the code only on the page where they asked for it. Ask for it there and nowhere else, never by chat or by email.
  • A token is one buyer’s at one store. It reaches no route that takes an API key, and an API key reaches none of these.