Updates a Taxon
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
taxon: {
taxonomy_id: '<string>',
parent_id: '<string>',
name: '<string>',
public_metadata: {},
private_metadata: {}
}
})
};
fetch('http://{defaultHost}/api/v2/platform/taxons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "60",
"type": "taxon",
"attributes": {
"position": 0,
"name": "T-Shirts",
"permalink": "taxonomy-32/taxon-20",
"lft": 4,
"rgt": 5,
"description": null,
"created_at": "2022-11-08T19:35:51.420Z",
"updated_at": "2022-11-08T19:35:51.665Z",
"meta_title": null,
"meta_description": null,
"meta_keywords": null,
"depth": 1,
"public_metadata": {
"profitability": 3
},
"private_metadata": {},
"pretty_name": "taxonomy_32 -> T-Shirts",
"seo_title": "T-Shirts",
"is_root": false,
"is_child": true,
"is_leaf": true
},
"relationships": {
"parent": {
"data": {
"id": "58",
"type": "taxon"
}
},
"taxonomy": {
"data": {
"id": "32",
"type": "taxonomy"
}
},
"children": {
"data": []
},
"image": {
"data": {
"id": "103",
"type": "taxon_image"
}
}
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes
Show child attributes
Record updated
Show child attributes
Was this page helpful?
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
taxon: {
taxonomy_id: '<string>',
parent_id: '<string>',
name: '<string>',
public_metadata: {},
private_metadata: {}
}
})
};
fetch('http://{defaultHost}/api/v2/platform/taxons/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "60",
"type": "taxon",
"attributes": {
"position": 0,
"name": "T-Shirts",
"permalink": "taxonomy-32/taxon-20",
"lft": 4,
"rgt": 5,
"description": null,
"created_at": "2022-11-08T19:35:51.420Z",
"updated_at": "2022-11-08T19:35:51.665Z",
"meta_title": null,
"meta_description": null,
"meta_keywords": null,
"depth": 1,
"public_metadata": {
"profitability": 3
},
"private_metadata": {},
"pretty_name": "taxonomy_32 -> T-Shirts",
"seo_title": "T-Shirts",
"is_root": false,
"is_child": true,
"is_leaf": true
},
"relationships": {
"parent": {
"data": {
"id": "58",
"type": "taxon"
}
},
"taxonomy": {
"data": {
"id": "32",
"type": "taxonomy"
}
},
"children": {
"data": []
},
"image": {
"data": {
"id": "103",
"type": "taxon_image"
}
}
}
}
}