---
title: Create a price point
slug: docs/demo/create-a-price-point
description: Learn how to make a successful POST request to the Fictive REST API using this code example. Create a new price point for a specific product effortlessly with the provided headers and JSON data.
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "tAcXS9CNcekaTp57YXkof",
  "data": {
    "url": "https://api.fictive.com/REST/api/products/{productReference}/price-points",
    "name": "Create a price point",
    "method": "POST",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "productReference",
          "type": "string"
        }
      ],
      "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": "pricePointRequest",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "role",
              "type": "string",
              "example": "",
              "description": "Gets or sets the Role name"
            },
            {
              "kind": "optional",
              "name": "amount",
              "type": "number<double>",
              "example": "",
              "description": "Gets or sets the Amount"
            },
            {
              "kind": "optional",
              "name": "isGross",
              "type": "boolean",
              "example": "",
              "description": "Specify whether is gross amount"
            },
            {
              "kind": "optional",
              "name": "taxCategory",
              "type": "string",
              "example": "",
              "description": "Tax category name"
            },
            {
              "kind": "optional",
              "name": "paymentMethod",
              "type": "string",
              "example": "",
              "description": "Payment method name"
            },
            {
              "kind": "optional",
              "name": "currency",
              "type": "string",
              "example": "",
              "description": "Three letter currency ISO code"
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.PricePointRequest",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.PricePointRequest",
          "isExpanded": true,
          "description": "Request DTO V1 for the Product Price Point."
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "role",
                "type": "string",
                "example": "",
                "description": "Gets or sets the Role name"
              },
              {
                "kind": "optional",
                "name": "amount",
                "type": "number<double>",
                "example": "",
                "description": "Gets or sets the Amount"
              },
              {
                "kind": "optional",
                "name": "isGross",
                "type": "boolean",
                "example": "",
                "description": "Specify whether is gross amount"
              },
              {
                "kind": "optional",
                "name": "priceReference",
                "type": "string",
                "example": "",
                "description": "Unique price reference"
              },
              {
                "kind": "optional",
                "name": "taxCategory",
                "type": "string",
                "example": "",
                "description": "Tax category name"
              },
              {
                "kind": "optional",
                "name": "paymentMethod",
                "type": "string",
                "example": "",
                "description": "Payment method name"
              },
              {
                "kind": "optional",
                "name": "currency",
                "type": "string",
                "example": "",
                "description": "Three letter currency ISO code"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.PricePointResponse",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.PricePointResponse",
            "isExpanded": true,
            "description": "Response DTO V1 for the Product Price Point."
          }
        ],
        "isExpanded": true,
        "statusCode": "201",
        "description": "Created",
        "jsonExample": "{\n  \"role\": \"Default\",\n  \"amount\": 20.52,\n  \"isGross\": true,\n  \"priceReference\": \"0010FN2NS2K63HEHC0\",\n  \"taxCategory\": \"Standard\",\n  \"paymentMethod\": \"CreditCard\",\n  \"currency\": \"GBP\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Please provide the price as a number with no more than 2 decimal places\r\n            <br /> Invalid payment method provided\r\n            <br /> Invalid currency provided",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Product cannot be found",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "409",
        "description": "A price point exists for the role, payment method and currency provided. Please update the existing price point",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "412",
        "description": "Role is not configured\r\n            <br /> Role must be provided\r\n            <br /> Category is not configured as a tax category\r\n            <br /> Currency is not configured\r\n            <br /> Currency must be provided\r\n            <br /> Payment method must be provided",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "Calling this endpoint will allow you to create a new price point against an existing product",
    "examples": {
      "languages": [
        {
          "id": "GnWb1GNf6Ygr9-bEU30dJ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/products/{productReference}/price-points \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "oZUJkf7k_hD6PCcyj9BuO",
          "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/products/{productReference}/price-points\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "kMXDnUsTo13fCEILwsXC7",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/products/{productReference}/price-points\")\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": "Owij9wGitM_0hPL7RjcDz",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/products/{productReference}/price-points\"\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": "GnWb1GNf6Ygr9-bEU30dJ"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "{\n  \"role\": \"Default\",\n  \"amount\": 20.52,\n  \"isGross\": true,\n  \"priceReference\": \"0010FN2NS2K63HEHC0\",\n  \"taxCategory\": \"Standard\",\n  \"paymentMethod\": \"CreditCard\",\n  \"currency\": \"GBP\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Please provide the price as a number with no more than 2 decimal places\r\n             Invalid payment method provided\r\n             Invalid currency provided\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Product cannot be found\n"
        },
        {
          "id": "response-4-409",
          "language": "409",
          "code": "// A price point exists for the role, payment method and currency provided. Please update the existing price point\n"
        },
        {
          "id": "response-5-412",
          "language": "412",
          "code": "// Role is not configured\r\n             Role must be provided\r\n             Category is not configured as a tax category\r\n             Currency is not configured\r\n             Currency must be provided\r\n             Payment method must be provided\n"
        },
        {
          "id": "response-6-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}