---
title: Create a product list
slug: docs/demo/create-a-product-list
description: Learn how to use a CURL command to make a POST request in this informative document. Discover how to send headers and data to a specified URL and create a new product list on a fictive API endpoint. Explore the example code which includes sending an empty
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "Rb35iGW7qMl0pGwNoVKEF",
  "data": {
    "url": "https://api.fictive.com/REST/api/product-lists",
    "name": "Create a product list",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "productListRequest",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "name",
              "type": "string",
              "example": "",
              "description": "Product list name."
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ProductListRequest",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ProductListRequest",
          "isExpanded": true,
          "description": "Product list request wrapper."
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "productListReference",
                "type": "string",
                "example": "",
                "description": "Product list reference."
              },
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": "",
                "description": "product list name."
              },
              {
                "kind": "optional",
                "name": "associatedProducts",
                "type": "array",
                "example": [],
                "itemType": "string",
                "customType": "string[]",
                "description": "Associated products with the product list.",
                "itemExample": ""
              },
              {
                "kind": "optional",
                "name": "createdDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:22.9636152",
                "description": "Created date."
              },
              {
                "kind": "optional",
                "name": "lastUpdatedDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:22.9636152",
                "description": "Last updated date."
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ProductListResponse",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ProductListResponse",
            "isExpanded": true,
            "description": "Product list response wrapper."
          }
        ],
        "isExpanded": true,
        "statusCode": "201",
        "description": "Created",
        "jsonExample": "{\n  \"productListReference\": \"001PLTRFD456544FD\",\n  \"name\": \"A list\",\n  \"associatedProducts\": [\n    \"0010BBLEC8GZAZA853\",\n    \"0010BZURPNZ3LJEM22\"\n  ],\n  \"createdDate\": \"2021-09-21T05:33:23.0417433\",\n  \"lastUpdatedDate\": \"2021-09-21T05:33:23.0417433\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Request is invalid.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "409",
        "description": "Product list exists with the provided name.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will allow you to create a new product list on your instance of eSuite that Products can then be associated to.",
    "examples": {
      "languages": [
        {
          "id": "Bb_NP3-3NR9XI08FGWSaS",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/product-lists \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "CizXqMrjREvxE7neJ_1II",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/product-lists\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "EbPM93yK44G4VUOL28LFn",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/product-lists\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "PkN2TMxtIEOc6AglLomQD",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/product-lists\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Bb_NP3-3NR9XI08FGWSaS"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "{\n  \"productListReference\": \"001PLTRFD456544FD\",\n  \"name\": \"A list\",\n  \"associatedProducts\": [\n    \"0010BBLEC8GZAZA853\",\n    \"0010BZURPNZ3LJEM22\"\n  ],\n  \"createdDate\": \"2021-09-21T05:33:23.0417433\",\n  \"lastUpdatedDate\": \"2021-09-21T05:33:23.0417433\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Request is invalid.\n"
        },
        {
          "id": "response-2-409",
          "language": "409",
          "code": "// Product list exists with the provided name.\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error.\n"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}