Add a document to a product
POST/v1/materials/:type/:id/documents
Stores a document of the product, such as a manual or a warranty. Send a form (multipart/form-data) with a PDF in file; name and description are optional. Offers take their parts' documents over (POST /v1/offers/{id}/documents/datasheets).
A product holds a file once. When it has the very same file already, the call answers 409 document_already_on_material and names the document in documentId, so a call whose answer you did not get can simply be repeated. Requires the write:materials scope.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 413
- 415
- 429
- 500
The new document.
validation_error: the body is no form, the file is missing or empty, or a field is not valid. message names the problem.
missing_api_key or invalid_api_key: no API key was sent, or it is wrong, expired or revoked.
insufficient_scope: the API key does not have the scope this endpoint needs. required names it.
not_found: there is no such product of this type in your catalog.
document_already_on_material: the product has this very file already, as documentId.
file_too_large: the file has more than 20 MiB.
file_type_not_allowed: the file is no PDF.
rate_limited: the API key has stored 1000 files within the hour. Try again after the seconds in the Retry-After header.
Response Headers
db_error: the database refused or failed the request. storage_error: the file could not be stored. message has the details.