All responses are in JSON format.
Meant to test connection and auth tokens.
$ curl "https://ecwid.dalevex.com/api/ping?debug=true&store-id=12345678" -H "Authorization: secret_abcdefghijklmnopqrstuv1234567890"
{"message": "Pong!", "debug": true, "store-id": "12345678", "store-id-allowed": true, "auth": "secret_abcdefghijklmnopqrstuv1234567890", "auth-check": {"status-code": 200, "is-secret-key": true}}
>>> import requests
>>> x = requests.get('https://ecwid.dalevex.com/api/ping?debug=true&store-id=12345678', headers={'Authorization': 'secret_abcdefghijklmnopqrstuv1234567890'})
>>> x.json()
{'message': 'Pong!', 'debug': True, 'store-id': '12345678', 'store-id-allowed': True, 'auth': 'secret_abcdefghijklmnopqrstuv1234567890', 'auth-check': {'status-code': 200, 'is-secret-key': True}}
| Status | Info |
|---|---|
| 200 | Should always return this. |
Will always be included in response:
| Key | Types | Info |
|---|---|---|
| message | string | Always "Pong!" |
| debug | boolean | true if URL query includes "debug=true", otherwise false. |
Will only be included if debug is true:
| Key | Types | Info | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| store-id | null, string | Store ID given in URL query. | |||||||||
| store-id-allowed | boolean | Whether the given store ID is allowed to use the Dalevex API. | |||||||||
| auth | null, string | Access token given in Authorization header. | |||||||||
| auth-check | null, object |
null if either store-id or auth are null, or if store-id-allowed is false. Otherwise:
|
For the API requests below this, the given store ID and auth token will be checked. If there is something wrong with the store ID and auth token, these responses will be returned and nothing will happen.
| Status | Info |
|---|---|
| 400 | No store ID provided, or there was an unknown problem connecting to the Ecwid API. |
| 403 | The provided store ID is not allowed to use the Dalevex API, no authorization header provided, or authorization header is invalid. |
Will always be included in response:
| Key | Types | Info |
|---|---|---|
| message | string | Depending on what went wrong, the message may be any of the following:
|
If something went wrong, but the reason could not be determined:
| Key | Types | Info |
|---|---|---|
| message | string | Always "Something went wrong when connecting to Ecwid API." |
| status-code-ecwid | number | Status code from Ecwid API. |
Updates Dalevex's internal product database.
$ curl "https://ecwid.dalevex.com/api/update-database?store-id=12345678" -H "Authorization: secret_abcdefghijklmnopqrstuv1234567890"
{"success": 49, "failure": 0}
>>> import requests
>>> x = requests.get('https://ecwid.dalevex.com/api/update-database?store-id=12345678', headers={'Authorization': 'secret_abcdefghijklmnopqrstuv1234567890'})
>>> x.json()
{'success': 49, 'failure': 0}
| Status | Info |
|---|---|
| 200 | The database was successfully updated. |
| 409 | The store is either currently busy updating, or exceeds 50000 products. |
| 400 | Something went wrong when connecting to the Ecwid API. |
Will only be included for a 200 status code:
| Key | Types | Info |
|---|---|---|
| success | number | The amount of products that were successfully updated. |
| failure | number | The amount of products that failed to update. |
Will only be included for a 409 status code:
| Key | Types | Info |
|---|---|---|
| message | string | Always "Store is either busy updating, or exceeds 50000 products. Please try again later." |
Will only be included for a 400 status code:
| Key | Types | Info |
|---|---|---|
| message | string | Always "Error while connecting to Ecwid API." |
| status | number | Status code from Ecwid API. |
Searches the internal product database using process.extract() and fuzz.token_set_ratio() from the
thefuzz python package.
Limit is 100 by default, and must be a number between (inclusive) 0 and 100. The example below use limit=1
because otherwise it would take up a lot of space and I don't want to try to make up 100 fake products.
You can also use offset for paging.
A null "stock" means unlimited, otherwise stock will be a number.
$ curl "https://ecwid.dalevex.com/api/search?store-id=12345678&query=test&limit=1&offset=0" -H "Authorization: secret_abcdefghijklmnopqrstuv1234567890"
{"store-id": "12345678", "query": "test", "limit": 1, "offset": 0, "total": 52, "is-secret-key": true, "results": [{"score": 100, "product-id": 12345678, "sku": "00001", "name": "Test Product", "image-url": "https://example.com/images/test-product.webp", "updated-time": "2024-01-01T00:00:00Z", "updated-timestamp": 1704067200.0, "enabled": true, "stock": 12, "price": "4.990000", "upc": "0123456789"}]}
>>> import requests
>>> x = requests.get('https://ecwid.dalevex.com/api/search?store-id=12345678&query=test&limit=1&offset=0', headers={'Authorization': 'secret_abcdefghijklmnopqrstuv1234567890'})
>>> x.json()
{'store-id': '12345678', 'query': 'test', 'limit': 1, 'offset': 0, 'total': 52, 'is-secret-key': True, 'results': [{'score': 100, 'product-id': 12345678, 'sku': '00001', 'name': 'Test Product', 'image-url': 'https://example.com/images/test-product.webp', 'updated-time': '2024-01-01T00:00:00Z', 'updated-timestamp': 1704067200.0, 'enabled': True, 'stock': 12, 'price': '4.990000', 'upc': '0123456789'}]}
| Status | Info |
|---|---|
| 200 | The search was successfully completed. |
| 409 | The store is either currently busy updating. |
| 400 | No search query provided. |
Will only be included for a 200 status code:
| Key | Types | Info | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| store-id | string | Store ID given in URL query. | ||||||||||||||||||||||||||||||||||||
| query | string | Search query given in URL query. | ||||||||||||||||||||||||||||||||||||
| limit | number | Limit given in URL query | ||||||||||||||||||||||||||||||||||||
| offset | number | Offset give n in URL query | ||||||||||||||||||||||||||||||||||||
| total | number | The total amount of products in the store. Does not include disabled products if is-secret-key is not true. | ||||||||||||||||||||||||||||||||||||
| is-secret-key | null, boolean | Whether auth is a secret key or not, if it can be determined. | ||||||||||||||||||||||||||||||||||||
| results | array |
Search results, contains an array of objects:
|
Will only be included for a 409 status code:
| Key | Types | Info |
|---|---|---|
| message | string | Always "Store is currently busy updating. Please try again later.'" |
Will only be included for a 400 status code:
| Key | Types | Info |
|---|---|---|
| message | string | Always "No search query." |
Atkinson Hyperlegible License