Skip to main content

Create an Entry Relationship

POST 

https://euwest.api.elasticpath.com/v2/flows/:flowSlug/entries/:flowEntryID/relationships/:flowFieldSlug

  • In Commerce, create an entry relationship to one or more resources. If any relationships already exist, the ones made in the request are added to them.
  • In Product Experience Manager, create an entry relationship with the product to which you want to associate the template.

Request

Path Parameters

    flowSlug stringrequired

    The slug of the flow/template that the entry belongs to.

    flowFieldSlug stringrequired

    The slug of the field/attribute that the relationship belongs to.

    flowEntryID stringrequired

    The ID of the entry you are requesting.

Bodyrequired

    data object[]

    The data to be stored.

  • Array [
  • iduuid

    A unique identifier for a resource.

    Example: 00000000-0000-0000-0000-000000000000
    typestring

    The resource type of the object.

  • ]

Responses

Created

Schema
    data object[]
  • Array [
  • iduuid

    A unique identifier for a resource.

    Example: 00000000-0000-0000-0000-000000000000
    typestring

    Represents the type of object being returned.

    Example: brand
  • ]

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/flows/:flowSlug/entries/:flowEntryID/relationships/:flowFieldSlug");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": [\n {\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"type\": \"string\"\n }\n ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
Parameters
— pathrequired
— pathrequired
— pathrequired
Body required
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "string"
    }
  ]
}
ResponseClear

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

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.