---
updatedAt: 2026-05-27T08:29:53.000Z
agentTools:
  projectIndex: https://developer.xentral.com/llms.txt
---

# Create purchase price V1

Creates new purchase price

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Xentral API",
    "version": "v0.1",
    "description": "Xentral is an ERP platform.",
    "contact": {
      "name": "Xentral",
      "url": "https://xentral.com",
      "email": "api@xentral.com"
    }
  },
  "tags": [
    {
      "name": "Purchase Price",
      "description": "PurchasePrices determine the prices used for the purchasing of products."
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token obtained in POST /tokens endpoint or pregenerated in the system."
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://{xentralId}.xentral.biz",
      "description": "Your Xentral Instance",
      "variables": {
        "xentralId": {
          "default": "xentral"
        }
      }
    },
    {
      "url": "https://{domain}",
      "description": "Xentral at a custom domain",
      "variables": {
        "domain": {
          "default": "xentral.com"
        }
      }
    }
  ],
  "x-readme": {
    "samples-languages": []
  },
  "paths": {
    "/api/v1/purchasePrices": {
      "post": {
        "tags": [
          "Purchase Price"
        ],
        "deprecated": true,
        "operationId": "purchasePrice.create",
        "summary": "Create purchase price V1",
        "description": "Creates new purchase price",
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "product",
                  "fromQuantity",
                  "price",
                  "validFrom",
                  "expiresAt"
                ],
                "properties": {
                  "product": {
                    "description": "Reference to another resource",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "\\d+",
                        "example": "17",
                        "description": "Resource identifier."
                      }
                    },
                    "example": {
                      "id": "1337"
                    }
                  },
                  "supplier": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "\\d+",
                        "example": "17",
                        "description": "Resource identifier."
                      }
                    },
                    "description": "Reference to a supplier for this price",
                    "example": {
                      "id": "194"
                    }
                  },
                  "isStandardSupplier": {
                    "description": "Loose boolean type which accepts boolean, number 0 or 1 and string 'true' or 'false'",
                    "example": "'true'",
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number",
                        "enum": [
                          0,
                          1
                        ]
                      },
                      {
                        "type": "string",
                        "enum": [
                          "true",
                          "false",
                          "True",
                          "False",
                          "TRUE",
                          "FALSE"
                        ]
                      }
                    ]
                  },
                  "supplierDesignation": {
                    "type": "string",
                    "description": "The designation of the supplier",
                    "example": "Xentral"
                  },
                  "supplierItemNumber": {
                    "type": "string",
                    "description": "Supplier item number",
                    "example": "4992042-20"
                  },
                  "fromQuantity": {
                    "type": "number",
                    "format": "float",
                    "description": "Minimum quantity for this price",
                    "example": 1
                  },
                  "packageAmount": {
                    "type": "number",
                    "format": "float",
                    "nullable": true,
                    "description": "Amount of items in a package",
                    "example": 10
                  },
                  "price": {
                    "description": "Price of the product",
                    "example": {
                      "amount": 7.3,
                      "currency": "EUR"
                    },
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "amount": {
                        "x-description-missing": true,
                        "type": "number",
                        "format": "float",
                        "example": 7.3
                      },
                      "currency": {
                        "x-description-missing": true,
                        "type": "string",
                        "enum": [
                          "EUR",
                          "PLN",
                          "CHF",
                          "USD",
                          "GBP"
                        ],
                        "example": "EUR"
                      }
                    }
                  },
                  "validFrom": {
                    "type": "string",
                    "format": "date",
                    "nullable": true,
                    "description": "Date from which the price is valid",
                    "example": "2023-12-01"
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date",
                    "nullable": true,
                    "description": "Date until which the price is valid",
                    "example": "2024-12-12"
                  }
                }
              },
              "examples": {
                "Create purchase price": {
                  "value": {
                    "product": {
                      "id": "18"
                    },
                    "supplier": {
                      "id": "194"
                    },
                    "isStandardSupplier": true,
                    "supplierDesignation": "Pillow 20x20",
                    "supplierItemNumber": "4992042-20",
                    "fromQuantity": 50,
                    "packageAmount": 10,
                    "validFrom": "2021-01-01",
                    "expiresAt": null,
                    "price": {
                      "amount": 7.3,
                      "currency": "EUR"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Resource successfully created response",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "example": "https://example.xentral.biz/api/users/17"
                },
                "description": "URI of the created resource"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "enum": [
                    ""
                  ],
                  "nullable": true
                }
              }
            }
          },
          "400": {
            "description": "IETF RFC 9457 Problem API compliant response",
            "content": {
              "application/problem+json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "violations"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/request-validation"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "example": "Request payload validation failed."
                        },
                        "violations": {
                          "oneOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "example": {
                                  "username": [
                                    "This value should not be blank."
                                  ],
                                  "email": [
                                    "This value is not a valid email address."
                                  ]
                                }
                              },
                              "description": "This field will be a mirrored request payload with only invalid fields and values replaced by error messages."
                            },
                            {
                              "type": "object",
                              "example": {
                                "_": [
                                  "This value should contain at most `9` elements."
                                ]
                              },
                              "description": "This field will be a mirrored request payload with only invalid fields and values replaced by error messages."
                            }
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "messages"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/generic-validation"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "messages"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/conflict"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "items"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/conflictItems"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "id",
                              "title",
                              "messages"
                            ],
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "title": {
                                "type": "string",
                                "minLength": 1
                              },
                              "messages": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "scopes"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://developer.xentral.com/reference/problems#token-scopes"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "title",
                        "messages"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "https://api.xentral.biz/problems/generic-validation"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1
                        },
                        "messages": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unable to authenticate the client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message explaining why the request failed.",
                      "example": "Missing required scopes: customer:create."
                    }
                  }
                },
                "example": {
                  "message": "Missing required scopes: customer:create."
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "example": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Unable to authorize the client"
          },
          "415": {
            "description": "Resource representation send in the request is not supported."
          },
          "429": {
            "description": "Too many API calls made."
          }
        }
      }
    }
  }
}
```