Skip to main content
POST
Create price
PriceType, Price, CurrencyCode, 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).
  • UnitCode is required and must be one of the product’s own units: its main unit (UnitCode) 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.
  • CustomerCode cannot be combined with either group field (2314).
  • CustomerGroupDetail cannot be sent without CustomerGroup (2313); selecting a detail alone is not meaningful, the group must be specified first.

Error codes

Codes this endpoint can return. The general errors that apply to every endpoint (authentication, permissions, request headers, request limits) are not repeated here.

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; 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

Required. 1: Purchase, 2: Sales.

Example:

2

Price
number<double>
required

Required. Must be greater than 0.

Example:

450

CurrencyCode
null | string
required

Required. Currency code from GET /api/v1/definitions/currencies.

Example:

"TRY"

UnitCode
null | string
required

Required. Unit code (the unit's universal code, for example C62, or its name when it has no universal code). It must be one of the product's own units: its main unit or, for products with a second/third unit, one of those.

Example:

"C62"

StartDate
null | string<date-time>
required

Required. Start of the validity period.

EndDate
null | string<date-time>
required

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

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

CustomerCode
null | string

Scope: applies only to the customer with this customer code. Cannot be combined with CustomerGroup or CustomerGroupDetail. Leave every scope field empty for a general price.

CustomerGroup
null | string

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

CustomerGroupDetail
null | string

Scope: narrows CustomerGroup to customers with this group detail (detail name). Requires CustomerGroup 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.