Create a product relation
Create a new relation between multiple products using a specified relation type
/api/v1/{team_slug}/{app_slug}/relations- API
- Management
- OpenAPI
- management-api
- Updated
- Apr 26, 2026
management-api:POST:/api/v1/{team_slug}/{app_slug}/relations
Create a new relation between multiple products using a specified relation type
API ownership
- API family: Management API
- Best for: Trusted back-office workflows that create, update, organize, or delete merchant-owned data.
- Do not use from: Browser-only storefront code or public clients.
- Guide route: /apis/management/latest
The OpenAPI contract defines the method, path, parameters, request body, and responses for this operation.
Operation
- Method:
POST - Path:
/api/v1/\{team_slug\}/\{app_slug\}/relations - Summary: Create a product relation
- Description: Create a new relation between multiple products using a specified relation type
- OpenAPI contract: management-api
- Operation ID: Not documented in the OpenAPI contract.
Operation key uses API family, method, and path because this OpenAPI contract does not publish an operation ID.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| app_slug | path | Yes | string | App slug |
| team_slug | path | Yes | string | Team slug |
Request body
- Required: Yes
- Description: Relation data
- Content: application/json (object)
Relation Request
| Property | Type | Required | Details |
|---|---|---|---|
direction | enum("one_way", "two_way") | No | default: "two_way" Default two_way |
primary_product_id | string | No | - |
product_ids | string[] | Yes | minItems: 1 |
relation_type_id | string | Yes | - |
Generated example (synthetic):
{
"direction": "one_way",
"primary_product_id": "string",
"product_ids": [
"string"
],
"relation_type_id": "string"
}Responses
| Status | Description | Content |
|---|---|---|
| 200 | Relation created successfully | application/json (object) |
| 400 | Invalid request (e.g. bad UUID, validation error) | application/json (object) |
| 401 | Unauthorized access | application/json (object) |
| 422 | Invalid request and not parsable by backend | application/json (object) |
| 500 | Internal server error | application/json (object) |
200 - object
Relation Response
| Property | Type | Required | Details |
|---|---|---|---|
data | object | No | - |
details | string[] | No | Additional contextual information about the response. Used to provide supplementary details beyond the main data payload, such as validation warnings or processing notes |
success | boolean | No | - |
Relation
| Property | Type | Required | Details |
|---|---|---|---|
direction | string | No | - |
id | string | No | - |
primary_product_id | string | No | - |
products | object[] | No | - |
title | string | No | - |
type | string | No | - |
type_id | string | No | - |
Relation Product
| Property | Type | Required | Details |
|---|---|---|---|
description | string | No | - |
id | string | No | - |
image_url | string | No | - |
product_name | string | No | - |
product_number | string | No | - |
slug | string | No | - |
Generated example (synthetic):
{
"data": {
"direction": "string",
"id": "string",
"primary_product_id": "string",
"products": [
{
"description": "string",
"id": "string",
"image_url": "string",
"product_name": "string",
"product_number": "string",
"slug": "string"
}
],
"title": "string",
"type": "string",
"type_id": "string"
},
"details": [
"string"
],
"success": false
}400 - object
Error Message
| Property | Type | Required | Details |
|---|---|---|---|
details | string[] | No | - |
message | string | No | - |
success | boolean | No | - |
Generated example (synthetic):
{
"details": [
"string"
],
"message": "string",
"success": false
}401 - object
Error Message
| Property | Type | Required | Details |
|---|---|---|---|
details | string[] | No | - |
message | string | No | - |
success | boolean | No | - |
Generated example (synthetic):
{
"details": [
"string"
],
"message": "string",
"success": false
}422 - object
Error Message
| Property | Type | Required | Details |
|---|---|---|---|
details | string[] | No | - |
message | string | No | - |
success | boolean | No | - |
Generated example (synthetic):
{
"details": [
"string"
],
"message": "string",
"success": false
}500 - object
Error Message
| Property | Type | Required | Details |
|---|---|---|---|
details | string[] | No | - |
message | string | No | - |
success | boolean | No | - |
Generated example (synthetic):
{
"details": [
"string"
],
"message": "string",
"success": false
}Contract identity
Use these fields to confirm you are implementing the intended endpoint contract.
- API family: Management API
- Method:
POST - Path:
/api/v1/\{team_slug\}/\{app_slug\}/relations - Operation ID: Not documented in the OpenAPI contract.
- OpenAPI tag: Relations
- OpenAPI summary: Create a product relation