Add

[POST] .../v1/pricetype/add

Adds a price type. Use this method to create a price type before assigning prices to items or using it in pricing workflows. It creates one price type and returns new_id after validating a non-empty name, name length, markup below 1000, round_to below 10000 and max_discount not greater than 100. The caller must have price type add permission; missing body, invalid fields, denied access, duplicate or storage validation failures and persistent errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
currency_additional_id Int64 Optional Additional currency ID.
currency_id Int64 Optional Currency ID.
markup Decimal Optional Price type markup. The value must be less than 1000.
max_discount Decimal Optional Maximum discount. The value must not be greater than 100.
name String Required Price type name. It cannot be empty and must be no longer than 150 characters.
round_to Decimal Optional Rounding increment. The value must be less than 10000.

Request Example

{
  "name": "Retail",
  "currency_id": 860,
  "currency_additional_id": 840,
  "round_to": 0.01,
  "markup": 25.00,
  "max_discount": 10.00
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 4
  }
}