After successful authentication, further REST API endpoints can be used — depending on assigned permissions — e.g. to process inquiries or manage orders.
Supported methods
List of all supported methods.| Command/info | Endpoints | GET | POST | PUT | DELETE |
|---|---|---|---|---|---|
| Authentication | login/ |
General
To access the REST API, you need a user account for the admin interface of the shop. The permissions and roles of this account control which REST API endpoints you may access and which HTTP methods (GET, POST, PUT, DELETE) are available to you.
Example:
- A user with only read permissions can retrieve inquiries but cannot edit or delete them.
- A user with administrator permissions has full access to all REST services and methods.
Using the methods
GET login/checkToken/{otok}
This endpoint checks a double opt-in token (otok) for validity. It is used, for example, in the password reset process.
Example
Response
Error codes
| Error | Type | Reason |
|---|---|---|
| 400 Bad Request | ”missing” | otok is missing. |
| 400 Bad Request | ”invalidValue” | otok is invalid or already used, or does not allow the password to be changed. |
| 404 Not Found | The account was not found. |
POST login
This endpoint enables login via email/password or via an API key (apiKey). On successful authentication, an accessToken and a refreshToken are returned.
If the ?setCookie parameter is specified in the URL, the tokens are set as cookies and the refreshToken is not returned in the JSON response.
Example
Request body
Response
Error codes
| Error | Type | Reason |
|---|---|---|
| 400 Bad Request | Request body could not be loaded. | |
| 401 Unauthorized | The account has id 0. | |
| 403 Forbidden | The account is locked. | |
| 404 Not Found | The account could not be loaded. | |
| 503 Service Unavailable | ”internalError” | Refresh token could not be created. |
POST login/refresh
This endpoint issues a newaccessToken, authorized via a valid refreshToken.
If the ?setCookie parameter is specified in the URL, the endpoint additionally sets the new accessToken as a cookie.
Example
Request body
Response
Error codes
| Error | Type | Reason |
|---|---|---|
| 400 Bad Request | Request body could not be loaded. The token type is not “Refresh”. | |
| 400 Bad Request | ”invalidFormat” | refreshToken has an invalid type (expected: string). |
| 400 Bad Request | ”unknownDataField” | An unknown field was sent. |
| 401 Unauthorized | The token has expired. | |
| 403 Forbidden | The account is locked. | |
| 404 Not Found | The token or the corresponding account was not found. |
POST login/passwordLink
This endpoint sends an email containing a password reset link to the specified email address.Example
Request body
Response
Error codes
| Error | Type | Reason |
|---|---|---|
| 400 Bad Request | Request body could not be loaded. | |
| 400 Bad Request | ”missing” | email is missing. |
| 400 Bad Request | ”invalidValue” | email is an empty string. |
| 400 Bad Request | ”invalidFormat” | email is not a string. |
| 400 Bad Request | ”unknownDataField” | An unknown field was sent. |
| 404 Not Found | The account was not found. | |
| 503 Service Unavailable | ”internalError” | Email could not be sent. |
POST login/setPassword
This endpoint sets a new password for a user account. The action must be authorized by a valid double opt-in token that was previously sent by email (login/passwordLink).
Example
Request body
Response
Error codes
| Error | Type | Reason |
|---|---|---|
| 400 Bad Request | Request body could not be loaded. The double opt-in token is invalid or does not allow the password to be changed. The password is too weak. | |
| 400 Bad Request | ”missing” | double opt-in token, password_new, or password_new_again is missing. |
| 400 Bad Request | ”invalidValue” | password_new and password_new_again do not match.The password is shorter than 12 characters. password_new, password_new_again, or otok are empty strings. |
| 400 Bad Request | ”invalidFormat” | password_new, password_new_again, or otok are not strings. |
| 400 Bad Request | ”unknownDataField” | An unknown field was sent. |
| 403 Forbidden | The account is locked. | |
| 404 Not Found | The account was not found. |
POST login/logout
This endpoint logs out the current user. The cookies set foraccessToken and refreshToken are deleted and the refresh token is removed from the database.
Example
Request body
Response
Error codes
| Error | Type | Reason |
|---|---|---|
| 400 Bad Request | Request body could not be loaded. |
