Documents display all of the attributes that describe your products. You may have several different types of documents in your Quable PIM classifications, so it's important to understand your hierarchy before importing documents. |
There are three possible steps to ensure that your documents are imported correctly:
- Create new documents
- Modify existing document data
- Delete existing documents
Create Documents
To create a new document, you must include the document's code, type, and classification.
To create the new document within a specific classification hierarchy level, you can also include the codes for an attribute set and the classification for the document.
You can also include the document's attributes and their values.
URL Parameters | |||
Endpoint | /documents | API v4 endpoint
| |
HTTP Method | POST | ||
Query Parameters | |||
targetCulture | string | Code of the data locale. | |
Request Body | |||
Required Attributes | code | string | The unique code of the document to be created. |
classification_code | string | The unique code of the classification to contain the document. | |
document_type_code | string | The unique code of the document type to be assigned to the document. This is only required during document creation. | |
Accepted Attributes | active | boolean | If False, the document becomes inactive and is unavailable via the interface. |
{{_attribute_}} | string | Any attribute code with its value(s) (e.g., reference_name in the code example). | |
attribute_set_code | string | The unique code of the attribute set used for the document. |
Example
import requests
url= "https://{{YOUR-PIM}}.quable.com.quable.com/api_1.php/documents?target_culture=en_US"
payload={
"classification_code" : "subfamily_12",
"document_type_code": "reference",
"attribute_set_code" : "shoes",
"code": "blue_suede_shoe",
"reference_erp_subref": "IYIAY37642",
"reference_name": "Blue suede shoe",
"reference_sellable": true,
"reference_erp_created_at": "2021-05-12T12:23:11",
"reference_gender": [{
"code": "men"
},{
"code": "women"
}]
}
headers= {
'Content-Type': 'application/json',
'Authorization': 'Bearer ...'
}
response= requests.request("POST", url, headers=headers,
Edit Documents
To edit a document, you must identify the document's unique code.
URL Parameters | |||
Endpoint | /documents/{{code}} Note: {{code}} is the current unique code of the document to update. | API v4 endpoint
| |
HTTP Method | PUT | ||
Query Parameters | |||
target_culture | string | Code of the data locale. | |
Request Body | |||
Required Attributes | code | string | The unique code of the document to be updated. |
Accepted Attributes | active | boolean | If False, the document becomes inactive and is unavailable via the interface. |
{{_attribute_}} | string | Any attribute code with its value(s) (e.g., name in the code example). | |
attribute_set_code | string | The unique code of the attribute set used for the document. | |
classification_code | string | The unique code of the classification to contain the document. | |
document_type_code | string | The unique code of the document type to be assigned to the document. This is only required during document creation. |
Example
import requests
url= "https://{{YOUR-PIM}}.quable.com.quable.com/api_1.php/documents/blue_suede_shoe?target_culture=fr_FR"
payload={
"code" : "blue_suede_shoe",
"name": "Chaussure en suédine bleu"
}
headers= {
'Content-Type': 'application/json',
'Authorization': 'Bearer ...'
}
response= requests.request("PUT", url, headers=headers, data=payload)
Delete Documents
It may become necessary at some point to delete a document from Quable PIM (e.g., to synchronize with a change in your ERP). To delete a document, you must identify the document's unique code. |
|
URL Parameters | |||
Endpoint | /documents/{{code}} Note: {{code}} is the unique code of the document to update. | API v4 endpoint | |
HTTP Method | DELETE | ||
Query Parameters | |||
Required Attributes | code | string | The unique code of the document to be created. |
Example
import requests
url= "https://{{YOUR-PIM}}.quable.com.quable.com/api_1.php/documents/blue_suede_shoe"
headers= {
'Content-Type': 'application/json',
'Authorization': 'Bearer ...'
}
response= requests.request("DELETE", url, headers=headers)