Skip to main content
Your app gets access to a store when the merchant approves it. EasyOrders uses the OAuth 2.0 authorization code flow with PKCE (S256), and both are required on every request.

Credentials

When you register your app you get: Redirect URLs must be https (except localhost while you develop), and they are matched exactly. Create a random state and a PKCE pair, keep both in the merchant’s session, then redirect:
The merchant signs in if needed, picks a store when they have more than one, and approves or declines.

2. Handle the redirect

EasyOrders sends the merchant back to your redirect_uri:
Check that state is the one you sent before you use the code. The code lasts one minute and works once. A wrong client_id or redirect_uri never redirects: the merchant sees an error page on EasyOrders.

3. Exchange the code for tokens

From your server, POST https://api.easy-orders.net/oauth/token. The body is JSON or application/x-www-form-urlencoded. Send the client credentials in the body, or as HTTP Basic auth, not both.
Response
Save the tokens with the store_id: each pair works on that store only.

4. Call the Admin API

Refresh the access token

An access token lasts one hour. Get a new pair with the refresh token, on the same endpoint:
Request
The answer has the same shape as the code exchange, with a new refresh token. Store it and drop the old one:
  • A refresh token lasts 30 days and works once.
  • Using an old refresh token again revokes every token of the installation, as it means a token leaked. To get tokens again, send the merchant through the consent page again.
If two of your workers can refresh at the same time, let one of them do it (a lock per store), or the second refresh will use a spent token and revoke the installation.

Revoke

To remove your app from a store, POST https://api.easy-orders.net/oauth/revoke with your client credentials and either token. The whole installation ends: every token of it stops working.
Request
It answers 200 with no body. A merchant can also remove your app from their dashboard at any time.

Token endpoint errors

The token and revoke endpoints answer errors the OAuth way:

New scopes

If your app later asks for more scopes, send the merchant through the consent page again. Until they approve, the installation keeps working with the scopes it has.