Skip to main content
POST
Create price
PriceType, Price, CurrencyId, StartDate and EndDate are required.
  • Price must be greater than 0 (2302).
  • Discount is a percentage or a fixed amount depending on IsDiscountPercentage (default true); it cannot be negative (2303), and as a percentage it cannot exceed 100 (2304).
  • EndDate must be after StartDate (2306).
  • UnitId is required and must be one of the product’s own units: its main unit (UnitId) or, if the product has a second/third unit, one of those. Any other unit in the company, or a unit that does not belong to the product, is rejected (2309).
  • IncludesVat says whether Price includes VAT.

Scope

A price row has at most one scope; if none are sent, it is a general price open to everyone.
  • CustomerId cannot be combined with either group field (2314).
  • CustomerGroupDetailId cannot be sent without CustomerGroupId (2313); selecting a detail alone is not meaningful, the group must be specified first.

Authorizations

Authorization
string
header
required

Access token obtained from the Noyax auth service with your API key.

Headers

X-UserID
integer<int32>
required

ID of the Noyax user the request is made on behalf of. Written to the audit fields of created, updated and deleted records.

Required range: x >= 1
X-CompanyID
integer<int32>
required

ID of the company. The user must be assigned to this company. All reads and writes are limited to this company.

Required range: x >= 1
X-PeriodID
integer<int32>

ID of the accounting period. Optional for customer endpoints; if sent, it is written to created records.

Required range: x >= 1

Path Parameters

productId
string<uuid>
required

Product ID.

Body

PriceType
integer<int32>

Required. 1: Purchase, 2: Sales.

Example:

2

Price
number<double>

Required. Must be greater than 0.

Example:

450

CurrencyId
null | string<uuid>

Required. ID of a currency from GET /api/v1/definitions/currencies.

IncludesVat
boolean

Whether Price includes VAT.

Example:

false

Discount
number<double>

Discount amount or percentage, depending on IsDiscountPercentage. Cannot be negative.

Example:

10

IsDiscountPercentage
boolean

Whether Discount is a percentage (0-100) rather than a fixed amount. Defaults to true.

Example:

true

UnitId
null | string<uuid>

Required. Must be one of the product's own units: its main unit (UnitId on the product) or, for products with a second/third unit, one of those.

StartDate
null | string<date-time>

Required. Start of the validity period.

EndDate
null | string<date-time>

Required. End of the validity period. Must be after StartDate.

CustomerId
null | string<uuid>

Scope: applies only to this customer. Cannot be combined with CustomerGroupId or CustomerGroupDetailId. Leave every scope field empty for a general price.

CustomerGroupId
null | string<uuid>

Scope: applies to every customer in this group (from GET /api/v1/customers/groups), unless CustomerGroupDetailId narrows it to one detail. Cannot be combined with CustomerId.

CustomerGroupDetailId
null | string<uuid>

Scope: narrows CustomerGroupId to customers with this group detail. Requires CustomerGroupId to be set.

Description
null | string

Description. At most 255 characters.

Response

Created

Success
boolean
required

Whether the operation succeeded.

Example:

true

ResultCode
string
required

"0000" on success. On failure, the code of the first error; all errors are listed in Errors.

Example:

"0000"

Data
object
required
Message
null | string

Error message when Success is false. Messages of all errors are joined into a single text.