How to connect OTTO to API2Cart?
To access the OTTO API, you need to create an application.
To create an application, you need to be registered as a developer in the appropriate portal.
Please note that in order to create applications in the portal, you need to get permission from the OTTO team, for this you need to contact their support team. Read more here.
Depending on your preferences, you can create either a public or a private application. The difference between them is that a Public App uses a public installation link, while a Private App requires an invitation link that expires after installation.
This guide covers the process of obtaining API credentials for a private application. If you are planning to use a public application, then follow this guide.
Please note that if you want to access the production environment, your application must be approved by the OTTO team. Read more here.
For production environments, use api.otto.market instead of sandbox.api.otto.market in all steps.
The process of getting access to OTTO:
-
Register on the OTTO Partner Connect (OPC) portal and create user with Service Provider type.
-
Create an application
Please note that all scopes must be checked.
After creation, a window with the application details will be opened
Save the App ID, Client ID, and Client Secret, as they will be required in the next steps.
-
Іnstall the application using a one-time link:
-
Authorize the application:
-
сreate a link for the seller to authorize the application
1
https://sandbox.api.otto.market/oauth2/auth?response_type=code&client_id=<Client ID>&redirect_uri=<Authorization Callback URL>&scope=installation%20partnerId
where Client ID and Authorization Callback URL are taken from step 2
-
the seller should follow the link, log in and confirm the application
After confirmation, a redirect occurs to the link (Authorization Callback URL) specified in the application settings, and it contains the Auth Code. Example:
-
сreate a link for the seller to authorize the application
-
Obtain the
Refresh Token . To do this, the following request must be executed12345curl --location 'https://sandbox.api.otto.market/oauth2/token' \
--form 'grant_type="authorization_code"' \
--form 'code="<Code>"' \
--form 'redirect_uri="<Authorization Callback URL>"'
-u '<Client ID>:<Client Secret>'
where Code is taken from the previous step.
-
Finally, fill in the relevant data in the API2Cart admin panel
Please note that you do not need to fill in the otto_access_token field, it is for internal use only.