Loading…
Loading…
about 15 minutes of your workNo experience assumed: the guide starts at "install Python".
Using an AI assistant? Let it do the busywork.
Claude Code, Cursor, Copilot: paste this prompt and your own AI handles the installing, checking and scheduling, on your machine. You keep the key steps.
The prompt forbids your assistant from asking for keys in chat, and from ever touching the push side: you create credentials yourself, and changes always need your typed YES.
Unzip toqool-cdiscount-api-toolkit.zip to a place you can find back, like your Documents folder. Inside you will find two folders that stay separate on purpose.
Python is the free program that runs the toolkit scripts. Get it from https://www.python.org/downloads/, version 3.9 or newer.
On Windows, that PATH tick box is the step people miss. Without it your computer will not recognise the python command, and every later step fails.
Every command in this guide is typed in a terminal that is opened IN a specific folder. Here is how, once per system. You will use this for every step that follows.
Where this guide says python and pip, Windows users type exactly that. Mac users type python3 and pip3 instead. That is the whole difference between the two systems.
The scripts need one helper package. Install it once in the pull folder and once in the push folder: open a terminal in each folder and run the command.
In the pull folder, then again in the push folder
pip install -r requirements.txtCdiscount (Octopia) gives every seller one set of API keys, and that one set can read and write. You create it once in the seller portal.
The sellerId can differ from the number you see elsewhere in your shop. Always copy it from the API Credentials Management page, nowhere else.
Lost the secret, or worried it leaked? No problem: create a new pair on the same portal page and fill in your .env files again.
The scripts read your keys from a small text file named .env that sits right next to them.
Never share a .env file and never send it to anyone. This one set of keys can read and change your live shop.
Open a terminal in the pull folder and run the key test. A good result starts with: OK | credentials valid. The second command also proves your sellerId; a good result there shows your own shop name.
Test the keys
python verify_auth.pyThen prove the sellerId too
python verify_auth.py --sellerThe most likely failure is FAILED | OAuth returned HTTP 401. That means the clientId or clientSecret is wrong or was revoked: re-create the pair in the portal and fill in .env again. If only the --seller test fails, the sellerId in your .env does not match the portal, so copy it again from the API Credentials Management page.
Still in a terminal in the pull folder: start with a short test run, then fetch everything.
Short test run first (a little data, quick)
python pull_cdiscount_seller.py --smokeThen the full pull
python pull_cdiscount_seller.pyLines like quota | waiting 60s during a pull are normal. Cdiscount limits how many calls per hour it accepts, and the script waits and retries by itself. Running the full pull twice in the same hour can hit those limits; just wait an hour.
The push tool changes real things on Cdiscount, so it always works in two steps: first a plan that changes nothing, then an apply where you type YES. Open a terminal in the push folder.
See the list of actions
python push_cdiscount_seller.py --list-actionsMake the plan (this changes nothing)
python push_cdiscount_seller.py --plan changes.jsonA GTIN can match more than one offer. Use your own SKU code, the sellerExternalReference, as the target to be exact.
The pull tool is safe to schedule because it can only read. On Windows use Task Scheduler, on Mac use cron.
Only automate the pull script, never the push tool. A push always deserves human eyes, and its YES gate refuses schedulers on purpose.
Where your CSVs land. Every run writes dated CSV files into the output folder inside pull, right next to the pull script, plus PDF documents such as invoices in subfolders next to them. Those CSVs are the files you open in Excel or drop into Toqool Local.
Stuck on any step? Mail us at support@toqool.com and a founder answers.