POST api/Agreements

Add an agreement.

Request Information

URI Parameters

None.

Body Parameters

AgreementPostRequest
NameDescriptionTypeAdditional information
OwnerUserName

Owner of the agreement

string

Required

Max length: 256

Number

Agreement number

integer

Required

Name

Name of the agreement

string

Required

Max length: 40

BranchId

Id of the branch

integer

Required

ValidFrom

Date when agreement is valid from

date

Required

ValidTo

Date when agreement is not valid anymore

date

Required

GeneralAgreementNo

Agreementnumber for the main agreement

integer

None.

PriceListId

Id of the price list

globally unique identifier

Required

FixedArticlePrices

If true: Articleprice can't be changed on an order

boolean

Required

FixedArticlePricesUntil

Date for how long the article prices may not be changed

date

None.

ZoneId

Id of the zone

integer

None.

Document

string

Max length: 4000

Remarks

None.

Example

//To get the agreement that is added, use following action:
//Gets the agrement with number 1010
http://localhost/api/Agreements/1010

Request Formats

application/json, text/json

Sample:
{
  "OwnerUserName": "sample string 1",
  "Number": 2,
  "Name": "sample string 3",
  "BranchId": 1,
  "ValidFrom": "12/21/2025 1:02:45 PM",
  "ValidTo": "12/21/2025 1:02:45 PM",
  "GeneralAgreementNo": 1,
  "PriceListId": "8f92e5f0-4d1b-4da8-90d0-10b9f0d6809a",
  "FixedArticlePrices": true,
  "FixedArticlePricesUntil": "12/21/2025 1:02:45 PM",
  "ZoneId": 1,
  "Document": "sample string 8"
}

application/xml, text/xml

Sample:
<AgreementPostRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Agreement">
  <BranchId>1</BranchId>
  <Document>sample string 8</Document>
  <FixedArticlePrices>true</FixedArticlePrices>
  <FixedArticlePricesUntil>2025-12-21T13:02:45.3354107+00:00</FixedArticlePricesUntil>
  <GeneralAgreementNo>1</GeneralAgreementNo>
  <Name>sample string 3</Name>
  <Number>2</Number>
  <PriceListId>8f92e5f0-4d1b-4da8-90d0-10b9f0d6809a</PriceListId>
  <ValidFrom>2025-12-21T13:02:45.3354107+00:00</ValidFrom>
  <ValidTo>2025-12-21T13:02:45.3354107+00:00</ValidTo>
  <ZoneId>1</ZoneId>
  <OwnerUserName>sample string 1</OwnerUserName>
</AgreementPostRequest>

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 'AgreementPostRequest'.

Response Information

Resource Description

AgreementPostResponse
NameDescriptionTypeAdditional information
Errors

List of errors when creating an agreement

Collection of PostAgreementError

None.

Success

True if agreement was created otherwise false

boolean

None.

Response Formats

application/json, text/json

Sample:
{
  "Errors": [
    {
      "ErrorCode": 1,
      "ErrorMessage": "sample string 1"
    },
    {
      "ErrorCode": 1,
      "ErrorMessage": "sample string 1"
    }
  ],
  "Success": true
}

application/xml, text/xml

Sample:
<AgreementPostResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Agreement">
  <Errors>
    <PostAgreementError>
      <ErrorCode>InternalServerError</ErrorCode>
      <ErrorMessage>sample string 1</ErrorMessage>
    </PostAgreementError>
    <PostAgreementError>
      <ErrorCode>InternalServerError</ErrorCode>
      <ErrorMessage>sample string 1</ErrorMessage>
    </PostAgreementError>
  </Errors>
  <Success>true</Success>
</AgreementPostResponse>