Create a custom relationship
POST/pcm/custom_relationships
Create a custom relationship
Request
- application/json
Body
required
data object
Possible values: [custom-relationship
]
This represents the type of resource object being returned. Always custom-relationship
.
attributes objectrequired
The name of the custom relationship, such as Kitchen electrics
.
A description of the custom relationship.
A unique slug for the custom relationship. Must match the slug specified in the request path.
Responses
- 201
- 422
- 500
Returns a created custom relationship with the following attributes.
- application/json
- Schema
- Example (from schema)
- created-custom-relationship
Schema
data object
A unique identifier generated when a custom relationship is created.
Possible values: [custom-relationship
]
This represents the type of resource object being returned. Always hierarchy
.
attributes object
The name of the custom relationship, such as Kitchen electrics
.
A description of the custom relationship.
A unique slug for the custom relationship.
meta object
The owner of the resource.
timestamps object
The date and time the resource is created.
The date and time the resource is updated.
{
"data": {
"id": "string",
"type": "custom-relationship",
"attributes": {
"name": "string",
"description": "string",
"slug": "string"
},
"meta": {
"owner": "store",
"timestamps": {
"created_at": "2024-01-10T20:16:35.343Z",
"updated_at": "2024-01-10T20:16:35.343Z"
}
}
}
}
{
"data": {
"type": "custom-relationship",
"id": "f3297ee8-da90-45e9-ae56-a2654aebbdfe",
"attributes": {
"name": "Kitchen electrics",
"description": "Kitchen electric devices",
"slug": "CRP_kitchen_individual_devices"
},
"meta": {
"owner": "store",
"timestamps": {
"created_at": "2024-01-10T20:16:35.343Z",
"updated_at": "2024-01-10T20:16:35.343Z"
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- failed-validation
Schema
- Array [
- ]
errors undefined[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Internal request ID.
Additional supporting meta data for the error.
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Failed Validation",
"status": "422",
"detail": "<XYZ> can not be empty"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
- Array [
- ]
errors undefined[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
Internal request ID.
Additional supporting meta data for the error.
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"status": "500",
"title": "Internal Server Error",
"detail": "There was an internal server error, you can report with your request id.",
"request_id": "635da56d-75a1-43cd-b696-7ab119756b3a"
}
]
}