POST api/Agreements
Add an agreement.
Request Information
URI Parameters
None.
Body Parameters
AgreementPostRequest| Name | Description | Type | Additional information |
|---|---|---|---|
| OwnerUserName | string |
Required Max length: 256 |
|
| Number | integer |
Required |
|
| Name | string |
Required Max length: 40 |
|
| BranchId | integer |
Required |
|
| ValidFrom | date |
Required |
|
| ValidTo | date |
Required |
|
| GeneralAgreementNo | integer |
None. |
|
| PriceListId | globally unique identifier |
Required |
|
| FixedArticlePrices | boolean |
Required |
|
| FixedArticlePricesUntil | date |
None. |
|
| ZoneId | 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": "2026-01-21 22:49:43",
"ValidTo": "2026-01-21 22:49:43",
"GeneralAgreementNo": 1,
"PriceListId": "65597209-f711-42f3-84bf-bde9f1971765",
"FixedArticlePrices": true,
"FixedArticlePricesUntil": "2026-01-21 22:49:43",
"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>2026-01-21T22:49:43.796755+01:00</FixedArticlePricesUntil> <GeneralAgreementNo>1</GeneralAgreementNo> <Name>sample string 3</Name> <Number>2</Number> <PriceListId>65597209-f711-42f3-84bf-bde9f1971765</PriceListId> <ValidFrom>2026-01-21T22:49:43.796755+01:00</ValidFrom> <ValidTo>2026-01-21T22:49:43.796755+01:00</ValidTo> <ZoneId>1</ZoneId> <OwnerUserName>sample string 1</OwnerUserName> </AgreementPostRequest>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
AgreementPostResponse| Name | Description | Type | Additional information |
|---|---|---|---|
| Errors | Collection of PostAgreementError |
None. |
|
| Success | 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>