POST api/Products

Creates a product.

Request Information

URI Parameters

None.

Body Parameters

The product model to create with.

ProductDto
NameDescriptionTypeAdditional information
Id

globally unique identifier

None.

Name

string

Required

String length: inclusive between 0 and 250

ComplianceReference

string

String length: inclusive between 0 and 50

Description

string

None.

ProductCode

string

Required

String length: inclusive between 0 and 50

CreationDate

date

Required

ExpiryDate

date

None.

SortIndex

integer

None.

TemplateId

globally unique identifier

Required

IsRequired

boolean

Required

VatApplicable

boolean

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": "5dc02f02-e795-42a9-81df-4feefd0fe6b6",
  "Name": "sample string 2",
  "ComplianceReference": "sample string 3",
  "Description": "sample string 4",
  "ProductCode": "sample string 5",
  "CreationDate": "2025-12-11T17:29:52.5912316Z",
  "ExpiryDate": "2025-12-11T17:29:52.5912316Z",
  "SortIndex": 1,
  "TemplateId": "554b8fcd-f7b1-47fe-a119-7fe0e71d3ef2",
  "IsRequired": true,
  "VatApplicable": true
}

application/xml, text/xml

Sample:
<ProductDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Aardvark.Template.Models">
  <ComplianceReference>sample string 3</ComplianceReference>
  <CreationDate>2025-12-11T17:29:52.5912316+00:00</CreationDate>
  <Description>sample string 4</Description>
  <ExpiryDate>2025-12-11T17:29:52.5912316+00:00</ExpiryDate>
  <Id>5dc02f02-e795-42a9-81df-4feefd0fe6b6</Id>
  <IsRequired>true</IsRequired>
  <Name>sample string 2</Name>
  <ProductCode>sample string 5</ProductCode>
  <SortIndex>1</SortIndex>
  <TemplateId>554b8fcd-f7b1-47fe-a119-7fe0e71d3ef2</TemplateId>
  <VatApplicable>true</VatApplicable>
</ProductDto>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'ProductDto'.

Response Information

Resource Description

globally unique identifier

Response Formats

application/json, text/json

Sample:
"74eee57e-9bcc-4c26-bea0-ee0e69a8c904"

application/xml, text/xml

Sample:
<guid xmlns="http://schemas.microsoft.com/2003/10/Serialization/">74eee57e-9bcc-4c26-bea0-ee0e69a8c904</guid>