Managing pictures and documents
Attach, query, update and remove product or variant media with the document-first architecture. Files are stored by the Lidia Document service, then linked to catalog entities using media identifiers.
Document-first asset lifecycle
- 01 · PrepareChoose sourceSupply preferred Base64 data or an absolute external URL.
- 02 · StoreDocument serviceThe media file is stored in Lidia Document with a DocumentId.
- 03 · AttachRelate to entityThe image/document metadata is attached to ProductId or VariantId.
- 04 · MaintainOrder or removeUse media-specific PATCH/DELETE operations; query media lists as needed.
Pictures
Images associated with products or variants; cover image and display order can be maintained using supported metadata fields.
Documents
Files such as manuals, specifications, warranty certificates and spreadsheets, linked to products or variants.
Storage reference
Distinguish DocumentId (file storage identity) from PictureId or ProductDocumentId (catalog media linkage).
Query lists
Use product/variant media query routes to retrieve related images and documents in bulk.
Media API routes
| Operation | Method | Path | Limit / 60s (endpoint / AppKey) |
|---|---|---|---|
| CreateProductPicture | POST | /api/v2/products/pictures | 300 / 30 |
| UpdateProductPicture | PATCH | /api/v2/products/pictures | 600 / 60 |
| DeleteProductPicture | DELETE | /api/v2/products/pictures | 300 / 30 |
| CreateProductDocument | POST | /api/v2/products/documents | 300 / 30 |
| UpdateProductDocument | PATCH | /api/v2/products/documents | 600 / 60 |
| DeleteProductDocument | DELETE | /api/v2/products/documents | 300 / 30 |
| CreateVariantPicture | POST | /api/v2/variants/pictures | 300 / 30 |
| UpdateVariantPicture | PATCH | /api/v2/variants/pictures | 600 / 60 |
| DeleteVariantPicture | DELETE | /api/v2/variants/pictures | 300 / 30 |
| CreateVariantDocument | POST | /api/v2/variants/documents | 300 / 30 |
| UpdateVariantDocument | PATCH | /api/v2/variants/documents | 600 / 60 |
| DeleteVariantDocument | DELETE | /api/v2/variants/documents | 300 / 30 |
| Media query | Method & path | Limit / 60s |
|---|---|---|
| Get Product Media List | POST /api/v2/query/product-media-list | 1200 / 120 |
| Get Variant Media List | POST /api/v2/query/variant-media-list | 1200 / 120 |
| Get Documents | POST /api/v2/query/documents | Standard service |
| Get Document Types | POST /api/v2/query/documenttypes | 1200 / 120 |
Formats, credentials and security
| Request type | Required fields / rules |
|---|---|
| All PIM requests | ClientId and AppKey at the JSON body root, not as authentication headers. |
| Metadata commands | Environment, SessionId, UserToken in addition to credentials, as specified for the endpoint. |
| Query, search and pool | No metadata-command fields required by the supplied specification; use ClientId / AppKey. |
| Tracing | Optional ThreadId; the service generates one if omitted. |
| JSON convention | Use exact PascalCase request fields such as CategoryId, SortOrder, Skip and Take. |
| Control | Documented behavior |
|---|---|
| Image formats | image/jpeg, image/png, image/webp, image/gif |
| Document formats | Includes PDF, DOCX and XLSX; the reference describes broad file-extension support. |
| File limit | 20 MB per file in the documented media flow |
| Timeout | 30 seconds |
| External URLs | Absolute URLs with SSRF protection |
| Source preference | Base64 preferred; external absolute Url also supported |
Store AppKey securely, use TLS and never place production secrets in an example, log output or public client-side application.
Add images and documents
{
"ClientId": "YOUR_CLIENT_ID",
"AppKey": "YOUR_APP_KEY",
"Environment": "production",
"SessionId": "YOUR_SESSION_ID",
"UserToken": "YOUR_USER_TOKEN",
"ProductId": 5001,
"VariantId": null,
"Name": "Product Campaign Image",
"Url": "https://cdn.example.com/products/campaign.png",
"FileName": "campaign.png",
"FolderId": null,
"SortOrder": 5
}POST /api/v2/products/documents · CreateProductDocument (URL example){
"ClientId": "YOUR_CLIENT_ID",
"AppKey": "YOUR_APP_KEY",
"Environment": "production",
"SessionId": "YOUR_SESSION_ID",
"UserToken": "YOUR_USER_TOKEN",
"ProductId": 5001,
"VariantId": null,
"Name": "User Manual EN",
"Url": "https://cdn.example.com/docs/manual.pdf",
"FileName": "manual.pdf",
"SortOrder": 1
}POST /api/v2/variants/pictures · CreateVariantPicture (URL example){
"ClientId": "YOUR_CLIENT_ID",
"AppKey": "YOUR_APP_KEY",
"Environment": "production",
"SessionId": "YOUR_SESSION_ID",
"UserToken": "YOUR_USER_TOKEN",
"VariantId": 1001,
"ProductId": 5001,
"Name": "Black Variant Image",
"Url": "https://cdn.example.com/products/black.png",
"FileName": "variant-black.png",
"SortOrder": 1
}Source examples show Base64 input; URLs above demonstrate the documented alternative input mode. Use the endpoint reference to check exact request field naming and file validation in your deployment.
Update existing media without re-uploading
- Product or variant PATCH operations do not accept new Base64/URL uploads through the product/variant object. Use dedicated media create endpoints.
- Within product/variant PATCH, identify existing media by
PictureIdorProductDocumentIdand adjust supported fields such asSortOrderandIsCover. - For media-specific updates use the dedicated
/picturesand/documentsPATCH routes. - DELETE media operations send identification fields in a JSON request body; they do not delete the master product/variant.
{
"ClientId": "YOUR_CLIENT_ID",
"AppKey": "YOUR_APP_KEY",
"Environment": "production",
"SessionId": "YOUR_SESSION_ID",
"UserToken": "YOUR_USER_TOKEN",
"VariantId": 1001,
"PictureId": 601,
"IsCover": true,
"SortOrder": 1,
"Status": 1
}DELETE /api/v2/products/documents · DeleteProductDocument{
"ClientId": "YOUR_CLIENT_ID",
"AppKey": "YOUR_APP_KEY",
"ProductId": 5001,
"ProductDocumentId": 201
}POST /api/v2/query/product-media-list · GetProductMediaList{
"ClientId": "YOUR_CLIENT_ID",
"AppKey": "YOUR_APP_KEY",
"ProductIds": [
5001
],
"Skip": 0,
"Take": 50
}Some supplied DELETE examples show only ClientId, AppKey and entity IDs while the general metadata rule lists additional fields. Verify the exact live DELETE request schema before setting up automation.
Response and error handling
{
"result": [],
"resultCount": 0,
"totalCount": 0,
"type": 1,
"code": "200",
"message": "Operation completed successfully.",
"errors": [],
"preProcessingTook": 8,
"serviceTook": 32,
"totalTook": 40
}| HTTP | Meaning | What to check |
|---|---|---|
400 | Bad Request | Required fields, metadata session values, category schema and the errors array. |
401 | Unauthorized | Root-level ClientId and AppKey, plus access permission. |
404 | Not Found | Record or relationship ID and tenant context. |
429 | Too Many Requests | Use Retry-After and retry with backoff. |
500 | Internal Server Error | Capture request context and trace information for support. |