Skip to main content

Create a custom relationship

POST 

https://euwest.api.elasticpath.com/pcm/custom_relationships

Create a custom relationship

Request

Body

required
    data object
    type stringrequired

    Possible values: [custom-relationship]

    This represents the type of resource object being returned. Always custom-relationship.

    attributes objectrequired
    name string

    The name of the custom relationship, such as Kitchen electrics.

    description string

    A description of the custom relationship.

    slug string

    A unique slug for the custom relationship. Must match the slug specified in the request path.

Responses

Returns a created custom relationship with the following attributes.

Schema
    data object
    id string

    A unique identifier generated when a custom relationship is created.

    type string

    Possible values: [custom-relationship]

    This represents the type of resource object being returned. Always hierarchy.

    attributes object
    name string

    The name of the custom relationship, such as Kitchen electrics.

    description string

    A description of the custom relationship.

    slug string

    A unique slug for the custom relationship.

    meta object
    owner string

    The owner of the resource.

    timestamps object
    created_at date-time

    The date and time the resource is created.

    updated_at date-time

    The date and time the resource is updated.

Authorization: http

name: bearerAuthtype: httpscheme: bearer
curl -L -X POST 'https://euwest.api.elasticpath.com/pcm/custom_relationships' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"data": {
"type": "custom-relationship",
"attributes": {
"name": "string",
"description": "string",
"slug": "string"
}
}
}'
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
Body required
{
  "data": {
    "type": "custom-relationship",
    "attributes": {
      "name": "string",
      "description": "string",
      "slug": "string"
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!