curl --request PATCH \
--url https://api.fabric.inc/v3/products/{id}/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"op": "add",
"path": "/attributes/-",
"value": {
"id": "6454e9e045276428de74c554",
"value": "blue"
}
}
]
}
'{
"id": "5g7329dfd5288b00113323p7",
"sku": "QWERTTY56DDFFVVV",
"type": "ITEM",
"isActive": true,
"hasDraft": true,
"hasLive": true,
"status": "LIVE",
"attributes": [
{
"id": "227329dfd5288b0011332315",
"name": "Color",
"type": "string",
"isDeleted": false,
"value": "blue",
"isInherited": true
}
],
"localizedProperties": {
"en-US": {
"attributes": [
{
"id": "637329dfd5288b0011332354",
"name": "Color",
"type": "string",
"isDeleted": false,
"value": "blue",
"isInherited": true
}
]
},
"en-IN": {
"attributes": [
{
"id": "8f7329dfd5288b0011332334",
"name": "Colour",
"type": "string",
"isDeleted": false,
"value": "blue",
"isInherited": true
}
]
}
},
"variants": [
{
"id": "967329dfd5288b0011332356"
}
],
"categoryId": "7f7329dfd5288b0011332378",
"createdAt": "2021-09-14T22:10:30.618Z",
"updatedAt": "2021-09-14T22:10:30.618Z"
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Unable to find or create product"
}
]
}{
"type": "UNAUTHORIZED_ERROR",
"message": "The requester is unauthorized"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "NOT_FOUND",
"message": "Resource not found"
}{
"message": "Internal Server Error",
"type": "SERVER_ERROR"
}Partially Update Product Attributes by ID
Product attributes are the objective and factual descriptions of products that shoppers see when they browse through an e-commerce platform. Attributes may be technical specifications like size, weight, etc., design specifications like color, material, etc., or basic specifications such as name, description, ID, etc. With this endpoint, you can partially update attributes of a given product. Note:
1. This endpoint is recommended over PUT /products/{id}/attributes (Update product attributes by ID) if you want to update only specific attributes without affecting the others.
2. If you don’t have product ID, use the corresponding SKU-based endpoint - PATCH /products/sku/{sku}/attributes.
curl --request PATCH \
--url https://api.fabric.inc/v3/products/{id}/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"op": "add",
"path": "/attributes/-",
"value": {
"id": "6454e9e045276428de74c554",
"value": "blue"
}
}
]
}
'{
"id": "5g7329dfd5288b00113323p7",
"sku": "QWERTTY56DDFFVVV",
"type": "ITEM",
"isActive": true,
"hasDraft": true,
"hasLive": true,
"status": "LIVE",
"attributes": [
{
"id": "227329dfd5288b0011332315",
"name": "Color",
"type": "string",
"isDeleted": false,
"value": "blue",
"isInherited": true
}
],
"localizedProperties": {
"en-US": {
"attributes": [
{
"id": "637329dfd5288b0011332354",
"name": "Color",
"type": "string",
"isDeleted": false,
"value": "blue",
"isInherited": true
}
]
},
"en-IN": {
"attributes": [
{
"id": "8f7329dfd5288b0011332334",
"name": "Colour",
"type": "string",
"isDeleted": false,
"value": "blue",
"isInherited": true
}
]
}
},
"variants": [
{
"id": "967329dfd5288b0011332356"
}
],
"categoryId": "7f7329dfd5288b0011332378",
"createdAt": "2021-09-14T22:10:30.618Z",
"updatedAt": "2021-09-14T22:10:30.618Z"
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Unable to find or create product"
}
]
}{
"type": "UNAUTHORIZED_ERROR",
"message": "The requester is unauthorized"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "NOT_FOUND",
"message": "Resource not found"
}{
"message": "Internal Server Error",
"type": "SERVER_ERROR"
}Authorizations
S2S access token (JWT) from fabric Identity service (during Login)
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
"517fa9dfd42d8b00g1o3k312"
Unique request ID
"263e731c-45c8-11ed-b878-0242ac120002"
Path Parameters
24-character system-generated product ID.
Query Parameters
Comma-separated statuses indicating the preferred order of the product versions considered for this operation (endpoint action). For example,
1. When the status is DRAFT, this operations will only apply to the Draft version of product, if it exists
2. When the status is LIVE, this operation will only apply to the Live version of the product, if it exists
3 When the status is LIVE,DRAFT, this operation will prioritize Live version first, if it exists. Otherwise, the Draft version is considered.
4 When the status is DRAFT,LIVE this operation will prioritize the Draft version first, if it exists. Otherwise, the Live version is considered.
"DRAFT"
Body
Request for partial update
1Show child attributes
Show child attributes
Response
OK
Details of Item by ID
Product ID
"AASSBCC12334FCD12334V"
Unique product ID that maps to fabric's standard attribute called SKU.
Note: sku shouldn't include ; or =
^[^;=]*$"XP-123345"
Supported product types
ITEM, VARIANT, BUNDLE "ITEM"
true: Product is active
false: Product is inactive
true
true: Product has a Draft version
false: Product doesn't have a Draft version
true
true: Product has a Live version
false: Product doesn't have a Live version
true
Represents the current status of product. This value takes precedence over isActive if both are sent in the request.
DRAFT, LIVE "LIVE"
Attributes of product
Show child attributes
Show child attributes
Localized attribute names
Show child attributes
Show child attributes
{
"en-US": {
"attributes": [
{
"id": "4e7329dfd5288b0011332366",
"name": "Color",
"type": "string",
"isDeleted": false,
"value": "blue",
"isInherited": true
}
]
}
}
Parent item ID of the Variant
Show child attributes
Show child attributes
Product variants by ID
Show child attributes
Show child attributes
24-character system-generated category ID of product
"6h7329dfd5288b001133231d"
Items or variants that are part of Bundle by ID
Show child attributes
Show child attributes
Time of product creation (UTC)
"2021-09-14T22:10:30.618Z"
Time of last update to product (UTC)
"2021-09-14T22:10:30.618Z"
Was this page helpful?
