Create a custom relationship
POST/pcm/custom-relationships
Custom relationships can either be bi-directional or uni-directional.
-
Uni-Directional: By setting
bi_directional
tofalse
(or omitted from request) a uni-directional custom relationship will be created. Within a uni-directional relationship, if Product A links to Product B, Product B will not link back to Product A. This is ideal when one product (e.g., a base product) recommends another (e.g., an upsell), but the reverse recommendation is unnecessary. -
Bi-Directional: By setting
bi_directional
totrue
a bi-directional custom relationship will be created. Within a bi-directional relationship, if Product A is linked to Product B, Product B will automatically link back to Product A. This bi-directionality ensures a consistent experience, where products always suggest each other as related items.
For more information on use cases, see Custom Relationships.
Custom Relationship slugs must meet the following criteria:
- be unique
- be prefixed with
CRP_
. Product Experience Manager automatically adds theCRP_
prefix if you do not include it. - contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.
Once a custom relationship has been created, you can:
- Add the custom relationship to a product. See Attach a custom relationship to a product.
- Associate a product to multiple products. See Associate a product with other products under a custom relationship.
Request
Responses
- 201
- 422
- 500
Returns a created custom relationship with the following attributes.
Bad request. The request failed validation.
Internal server error. There was a system failure in the platform.