3. Documents

120Documents 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/documentsAPI v4 endpoint

🚧

This endpoint is unitary and creates a single resource at a time, in a single data language. In order to specify content in a specific data language, you need to use the target_culture URL parameter (see code example).

HTTP MethodPOST
Query Parameters
targetCulturestringCode of the data locale.
Request Body
Required Attributescodestring The unique code of the document to be created.
classification_codestringThe unique code of the classification to contain the document.
document_type_codestring The unique code of the document type to be assigned to the document. This is only required during document creation.
Accepted AttributesactivebooleanIf 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_codestring 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

🚧

This endpoint is unitary and modifies a single resource at a time, in a single data language. In order to specify content in a specific data language, you need to use the target_culture URL parameter (see code example).

HTTP MethodPUT
Query Parameters
target_culturestring Code of the data locale.
Request Body
Required Attributescodestring The unique code of the document to be updated.
Accepted Attributesactiveboolean 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_codestring The unique code of the attribute set used for the document.
classification_codestring The unique code of the classification to contain the document.
document_type_codestring 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.

❗️

When deleting a document, its variants and assets (if any) automatically become orphaned. They are not deleted from Quable PIM.

URL Parameters
Endpoint/documents/{{code}}

Note: {{code}} is the unique code of the document to update.
API v4 endpoint
HTTP MethodDELETE
Query Parameters
Required Attributescodestring 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)