Get a custom relationship
GET/pcm/custom-relationships/:customRelationshipSlug
Gets a Custom Relationship.
To see a list of custom relationships a product is attached to, see Get all Custom Relationships attached to a Product.
To see a list of products that a product is related to, see Get all Related Products of a Products' attached Custom Relationship.
Request
Path Parameters
A custom relationship slug.
Responses
- 200
- 400
- 404
- 500
Returns a custom relationship with the following attributes.
- application/json
- Schema
- Example (from schema)
- get-custom-relationship
Schema
data objectrequired
A unique identifier generated when a custom relationship is created.
Possible values: [custom-relationship
]
This represents the type of resource object being returned. Always custom-relationship
.
attributes objectrequired
The name of the custom relationship to display to shoppers, such as Kitchen electrics
.
A description of the custom relationship.
Possible values: Value must match regular expression ^[A-Za-z0-9._-]+$
A unique slug for the custom relationship. Must match the slug specified in the request path. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.
The order in which the custom relationship should be displayed in relation to others. A lower value represents a higher priority in the display order. If set to NULL, the sort order will be removed.
The shopper-facing name for the custom relationship. This value will be displayed to shoppers in the store-front, replacing the internal name if present. If set to NULL, the external name will be removed.
The shopper-facing description for the custom relationship. This value will be shown to shoppers in the store-front, replacing the internal description if present. If set to NULL, the external description will be removed.
Is this relationship one way or bi-directional true
or false
. Default is false
meta objectrequired
The owner of the resource.
timestamps objectrequired
The date and time the resource is created.
The date and time the resource is updated.
{
"data": {
"id": "string",
"type": "custom-relationship",
"attributes": {
"name": "Related Products",
"description": "A list of related products shown on the PDP.",
"slug": "CRP_related_products",
"sort_order": 5,
"external_name": "Similar items to consider",
"external_description": "Check out these similar products that may also meet your needs or match your preferences.",
"bi_directional": false
},
"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": "Related Products",
"description": "A list of related products shown on the PDP",
"slug": "CRP_related_products",
"sort_order": 5,
"external_name": "Similar items to consider",
"external_description": "Check out these similar products that may also meet your needs or match your preferences.",
"bi_directional": false
},
"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)
- bad-request
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": "Bad Request",
"detail": "Could not parse the supplied filter",
"status": "400"
}
]
}
Bad Request. Not Found.
- 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": [
{
"title": "Not Found",
"status": "404"
}
]
}
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"
}
]
}