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.
1. Send the merchant to the consent page
Create a randomstate and a PKCE pair, keep both in the merchant’s session, then redirect:
2. Handle the redirect
EasyOrders sends the merchant back to yourredirect_uri:
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
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
- 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.
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
200 with no body. A merchant can also remove your app from their dashboard at any time.