How it works
ThesendBatchContent() function (helper.py:140) performs a complete upload of your entire product catalog:
Validate authentication
The function first checks if your access token has expired using
is_token_expired() (helper.py:143-144).Fetch all products
shopMaster queries your local table and fetches all products with
SELECT * FROM {local_table} (helper.py:160-165).Process in batches
Products are sent in batches of 200 to avoid overloading the API (helper.py:141, 175-176).
Transform data
Each product is converted to Digible’s expected format with productName, productPrice, and productId fields (helper.py:177-183).
Product upload is different from sync. While sync only sends changes from the ChangeLog table, product upload sends your entire product catalog regardless of recent changes.
Initiating product upload
To upload all products:- Open shopMaster
- Navigate to the Settings page
- Scroll down and click the Upload Products button (main.py:243-244)
- Wait for the confirmation message
Batch processing
Products are uploaded in batches to ensure reliable transmission:The batch size of 200 products is optimized for Digible’s API. Processing happens sequentially to ensure data integrity.
Data transformation
Each product from your local database is transformed before upload:| Local Field | Digible Field | Transformation |
|---|---|---|
| ProductName | productName | Direct mapping |
| SellPrice | productPrice | Converted to string |
| ProductID | productId | Direct mapping |
Response handling
After each batch is sent, shopMaster:- Checks the HTTP status code (helper.py:189)
- Logs the response content (helper.py:190)
- Returns an error if status is not 200 (helper.py:191-193)
- Parses the JSON response for each batch (helper.py:195-200)
When to use product upload
Use product upload in these scenarios:- Initial setup: When first connecting your database to Digible
- Full resync: If you suspect data discrepancies between local and cloud
- After major changes: When you’ve made bulk updates to your product catalog
- Recovery: After resolving sync issues or reconfiguring your connection
- Product upload
- Regular sync
- Sends all products
- Ignores ChangeLog table
- Processes in 200-product batches
- Manual operation only
- Use for full synchronization
Error scenarios
Expired session
Ifis_token_expired() returns True, the function returns immediately (helper.py:143-144):
Invalid JSON response
If the server returns non-JSON data (helper.py:198-200):Connection errors
General exceptions are caught and returned as error messages (helper.py:204-206).The upload function is called by the
upload_data() wrapper in main.py:230, which displays the result in a message box.API endpoint
Product uploads are sent to:x-access-token: Your Digible access tokenContent-Type: application/json
sendBatchContent() implementation.