Giao diện
API · product-file
Trang sinh tự động
Parse từ schema.graphql (SDL backend export) bằng parser graphql. Mô tả và quyền lấy nguyên văn từ description trong SDL.
2 query · 2 mutation.
Query
productImportPreflight
Checks a chosen file before 'Kiểm tra dữ liệu': not an .xlsx template or no data row -> invalid_format; more than 1,000 data rows -> too_many_rows. Rows are counted, not validated. The caller's own READY upload only (else not_found); no run is recorded. Requires catalog.write.
query · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
fileMediaId | ID! |
Trả về ProductImportPreflight!
| Field | Kiểu | Mô tả |
|---|---|---|
ok | Boolean! | True when 'Kiểm tra dữ liệu' may be enabled for this file. |
fileError | ProductImportFileError | invalid_format or too_many_rows; never any data of the file's rows. |
productImportTemplate
The .xlsx import template: sheet 1 'Sản phẩm' (the only sheet the import reads) holds the header row, then one format-notes row and one example row that the user deletes before importing (every non-blank row under the header is read as data); sheet 2 'Hướng dẫn' holds the same example row, the format notes and the active units. Requires catalog.write, like the import itself.
query · quyền: catalog.write
Không có tham số.
Trả về ProductImportTemplate!
| Field | Kiểu | Mô tả |
|---|---|---|
fileName | String! | |
mimeType | String! | The .xlsx MIME type. |
contentBase64 | String! | The .xlsx bytes, base64. Small and tenant-free, so inline. |
Mutation
exportProducts
Export every product matching the list filters to .xlsx in one step (no page, no selection, no row cap): all product/combo columns except images, creator and last editor by Admin name. Nothing matching -> rowCount 0, file null, no file created. Formula-like text is neutralised. A file over the storage cap is conflict/export_too_large. Requires catalog.read.
mutation · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | ExportProductsInput! |
Trả về ExportProductsResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
rowCount | Int! | |
file | ProductExportFile | Null when nothing matches (AC05 'No data to export', no file created). |
importProducts
Validate or import products from an Excel file (<= 1,000 rows): every row is checked and reported with all of its issues, VALIDATE writes nothing but its run, and the import is all or nothing. Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | ImportProductsInput! |
Trả về ImportProductsResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
run | ProductImportRun! |