Welcome to openprocurement.contracting.api’s documentation!¶
Please report any problems or suggestions for improvement either via the mailing list or the issue tracker.
Contents:
Overview¶
The Open Procurement Contracting is plugin to Open Procurement API software.
REST-ful interface to plugin is in line with core software design principles.
Conventions¶
This plugin conventions follow the Open Procurement API conventions.
API stability¶
API is highly unstable, and while API endpoints are expected to remain relatively stable the data exchange formats are expected to be changed a lot. The changes in the API are communicated via Open Procurement API maillist. Questions can be asked via Gitter.
Data Standard¶
Data standard is modelled along the Open Contracting Standard with extensions in areas that were not covered by it.
Contract¶
Schema¶
id: | uid, auto-generated OpenContracting Description: The identifier for this contract. |
||||||||
---|---|---|---|---|---|---|---|---|---|
awardID: | string, required OpenContracting Description: The Award.id against which this contract is being issued. |
||||||||
contractID: | string, auto-generated, read-only |
||||||||
contractNumber: | string |
||||||||
title: | string OpenContracting Description: Contract title |
||||||||
description: | string OpenContracting Description: Contract description |
||||||||
status: | string, required OpenContracting Description: The current status of the contract. Possible values are:
|
||||||||
period: |
OpenContracting Description: The start and end date for the contract. |
||||||||
items: | List of Item objects, auto-generated, read-only OpenContracting Description: The goods, services, and any intangible outcomes in this contract. Note: If the items are the same as the award do not repeat. |
||||||||
procuringEntity: | |||||||||
OpenContracting Description: The entity managing the procurement, which may be different from the buyer who is paying / using the items being procured. |
|||||||||
suppliers: | List of Organization objects, auto-generated, read-only |
||||||||
value: | Value object, auto-generated, read-only OpenContracting Description: The total value of this contract. |
||||||||
dateSigned: | string, Date, auto-generated OpenContracting Description: The date the contract was signed. In the case of multiple signatures, the date of the last signature. |
||||||||
documents: | List of Document objects OpenContracting Description: All documents and attachments related to the contract, including any notices. |
||||||||
changes: | List of Change objects. |
||||||||
amountPaid: |
Amount of money actually paid. |
||||||||
terminationDetails: | |||||||||
string, required for unsuccessful contract Reasons for contract termination. Presence of this field indicates that contract is unsuccessful. |
Document¶
Schema¶
id: | string, auto-generated |
---|---|
documentType: | string
|
title: | string, multilingual OpenContracting Description: The document title. |
description: | string, multilingual OpenContracting Description: A short description of the document. In the event the document is not accessible online, the description field can be used to describe arrangements for obtaining a copy of the document. |
format: | string OpenContracting Description: The format of the document taken from the IANA Media Types code list, with the addition of one extra value for ‘offline/print’, used when this document entry is being used to describe the offline publication of a document. |
url: | string, auto-generated OpenContracting Description: Direct link to the document or attachment. |
datePublished: | string, Date OpenContracting Description: The date on which the document was first published. |
dateModified: | string, Date OpenContracting Description: Date that the document was last modified |
language: | string Possible values are:
OpenContracting Description: Specifies the language of the linked document using either two-digit ISO 639-1, or extended BCP47 language tags. |
documentOf: | string Possible values are:
|
relatedItem: | string |
Organization¶
Schema¶
name: | string, multilingual, uk (title) and en (title_en) translations are required OpenContracting Description: The common name of the organization. |
---|---|
identifier: |
OpenContracting Description: The primary identifier for this organization. |
additionalIdentifiers: | |
List of Identifier objects |
|
address: | Address, required |
contactPoint: | ContactPoint, required |
Identifier¶
Schema¶
scheme: | string OpenContracting Description: Organization identifiers be drawn from an existing identification scheme. This field is used to indicate the scheme or codelist in which the identifier will be found. This value should be drawn from the Organization Identifier Scheme. |
---|---|
id: | string, required OpenContracting Description: The identifier of the organization in the selected scheme. The allowed codes are the ones found in “Organisation Registration Agency” codelist of IATI Standard with addition of UA-EDR code for organizations registered in Ukraine (EDRPOU and IPN). |
legalName: | string, multilingual OpenContracting Description: The legally registered name of the organization. |
uri: | uri OpenContracting Description: A URI to identify the organization, such as those provided by Open Corporates or some other relevant URI provider. This is not for listing the website of the organization: that can be done through the url field of the Organization contact point. |
Address¶
Schema¶
streetAddress: | string, required OpenContracting Description: The street address. For example, 1600 Amphitheatre Pkwy. |
---|---|
locality: | string, required OpenContracting Description: The locality. For example, Mountain View. |
region: | string, required OpenContracting Description: The region. For example, CA. |
postalCode: | string, required OpenContracting Description: The postal code. For example, 94043. |
countryName: | string, multilingual, required OpenContracting Description: The country name. For example, United States. |
ContactPoint¶
Schema¶
name: | string, multilingual, required OpenContracting Description: The name of the contact person, department, or contact point, for correspondence relating to this contracting process. |
---|---|
email: | OpenContracting Description: The e-mail address of the contact point/person. |
telephone: | string OpenContracting Description: The telephone number of the contact point/person. This should include the international dialling code. |
faxNumber: | string OpenContracting Description: The fax number of the contact point/person. This should include the international dialling code. |
url: | url OpenContracting Description: A web address for the contact point/person. |
availableLanguage: | |
string Possible values are:
Specifies the language of communication. |
Either email or telephone field has to be provided.
Item¶
Schema¶
id: | string, auto-generated |
||||||
---|---|---|---|---|---|---|---|
description: | string, multilingual, required OpenContracting Description: A description of the goods, services to be provided. |
||||||
classification: |
OpenContracting Description: The primary classification for the item. See the itemClassificationScheme to identify preferred classification lists, including CPV and GSIN. It is mandatory for classification.scheme to be CPV. The classification.id should be valid CPV code. |
||||||
additionalClassifications: | |||||||
List of Classification objects OpenContracting Description: An array of additional classifications for the item. See the itemClassificationScheme codelist for common options to use in OCDS. This may also be used to present codes from an internal classification scheme. It is mandatory to have at least one item with ДКПП as scheme. |
|||||||
unit: |
OpenContracting Description: Description of the unit which the good comes in e.g. hours, kilograms. Made up of a unit name, and the value of a single unit. |
||||||
quantity: | integer OpenContracting Description: The number of units required |
||||||
deliveryDate: | Period, required Period during which the item should be delivered. |
||||||
deliveryAddress: | |||||||
Address, required Address, where the item should be delivered. |
|||||||
deliveryLocation: | |||||||
dictionary Geographical coordinates of delivery location. Element consist of the following items:
deliveryLocation usually takes precedence over deliveryAddress if both are present. |
|||||||
relatedLot: | string Id of related Lot. |
Classification¶
Schema¶
scheme: | string OpenContracting Description: A classification should be drawn from an existing scheme or list of codes. This field is used to indicate the scheme/codelist from which the classification is drawn. For line item classifications, this value should represent a known Item Classification Scheme wherever possible. |
---|---|
id: | string OpenContracting Description: The classification code drawn from the selected scheme. |
description: | string OpenContracting Description: A textual description or title for the code. |
uri: | uri OpenContracting Description: A URI to identify the code. In the event individual URIs are not available for items in the identifier scheme this value should be left blank. |
Unit¶
Schema¶
code: | string, required UN/CEFACT Recommendation 20 unit code. |
---|---|
name: | string OpenContracting Description: Name of the unit |
Period¶
Date¶
Date/time in Date Format: ISO 8601.
Value¶
Schema¶
amount: | float, required OpenContracting Description: Amount as a number. Should be positive. |
---|---|
currency: | string, required OpenContracting Description: The currency in 3-letter ISO 4217 format. |
valueAddedTaxIncluded: | |
bool, required |
Change¶
Schema¶
id: | uid, auto-generated The identifier for this Change. |
---|---|
rationale: | string, multilingual, required Reason for contract change |
rationaleTypes: | List of strings, required Type of the rationale behind contract change Changes to the contract can be made in cases described in the 4th part of Article 36 of the Law “On the Public Procurement”. Possible string values are:
|
date: | string, Date, auto-generated |
dateSigned: | string, Date |
contractNumber: | string |
status: | string, required The current status of the change. Possible values are:
|
Tutorial¶
Exploring basic rules¶
Let’s try exploring the /contracts endpoint:
GET /api/2.3/contracts HTTP/1.0
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"next_page": {
"path": "/api/2.3/contracts?offset=",
"uri": "http://api-sandbox.openprocurement.org/api/2.3/contracts?offset=",
"offset": ""
},
"data": []
}
Just invoking it reveals an empty set.
Contract is transferred from the tender system by an automated process.
Creating contract¶
Let’s say that we have conducted tender and it has complete
status. When the tender is completed, contract (that has been created in the tender system) is transferred to the contract system automatically.
Brokers (eMalls) can’t create contracts in the contract system.
Getting contract¶
Contract in the tender system
GET /api/2.3/tenders/7dc086c4a213492ab9c43b95b43bd817/contracts/bebdbaf7777d4bd39756f3e8872c1f46 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "active",
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
},
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "c008a4d57c584dafa187ea72647e3cb7",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"value": {
"currency": "UAH",
"amount": 500.0,
"valueAddedTaxIncluded": true
},
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"date": "2017-06-21T17:53:04.600513+03:00",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"contractID": "UA-2017-06-21-000001-1"
}
}
Contract id is the same in both tender and contract system.
Let’s access the URL of the created object:
GET /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46 HTTP/1.0
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "active",
"value": {
"currency": "UAH",
"amount": 500.0,
"valueAddedTaxIncluded": true
},
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
},
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "c008a4d57c584dafa187ea72647e3cb7",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"dateModified": "2017-06-21T17:53:04.877904+03:00",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"kind": "general",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
},
"contractID": "UA-2017-06-21-000001-1",
"owner": "broker",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"tender_id": "7dc086c4a213492ab9c43b95b43bd817"
}
}
Getting access¶
In order to get rights for future contract editing, you need to use this view PATCH: /contracts/{id}/credentials?acc_token={tender_token}
with the API key of the eMall (broker), where tender was generated.
In the PATCH: /contracts/{id}/credentials?acc_token={tender_token}
:
id
stands for contract id,tender_token
is tender’s token (is used for contract token generation).
Response will contain access.token
for the contract that can be used for further contract modification.
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/credentials?acc_token=7d16511a9bb949ad9df35d12de325162 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 0
Content-Type: application/json
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"access": {
"token": "2f1294ae618e49219d85607d17afabf6"
},
"data": {
"status": "active",
"value": {
"currency": "UAH",
"amount": 500.0,
"valueAddedTaxIncluded": true
},
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
},
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "c008a4d57c584dafa187ea72647e3cb7",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"dateModified": "2017-06-21T17:53:04.954121+03:00",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"kind": "general",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
},
"contractID": "UA-2017-06-21-000001-1",
"owner": "broker",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"tender_id": "7dc086c4a213492ab9c43b95b43bd817"
}
}
Let’s view contracts.
GET /api/2.3/contracts HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"next_page": {
"path": "/api/2.3/contracts?offset=2017-06-21T17%3A53%3A04.954121%2B03%3A00",
"uri": "http://api-sandbox.openprocurement.org/api/2.3/contracts?offset=2017-06-21T17%3A53%3A04.954121%2B03%3A00",
"offset": "2017-06-21T17:53:04.954121+03:00"
},
"data": [
{
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"dateModified": "2017-06-21T17:53:04.954121+03:00"
}
]
}
We do see the internal id of a contract (that can be used to construct full URL by prepending http://api-sandbox.openprocurement.org/api/0/contracts/) and its dateModified datestamp.
Modifying contract¶
You can make changes to the contract in cases described in the 4th part of Article 36 of the Law “On the Public Procurement”.
Essential contract terms can be modified by the submission of a new Change object to the Contract.changes container.
All changes are processed by the endpoint /contracts/{id}/changes.
Submitting a change¶
Let’s add new change to the contract:
POST /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/changes?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 267
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"rationale": "Опис причини змін контракту"
}
}
Response: 201 Created
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "pending",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"rationale": "Опис причини змін контракту",
"date": "2017-06-21T17:53:05.109702+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
}
Note that you can provide more than one value in rationaleTypes
field.
You can view the change:
GET /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/changes/c382f2a7da3647bbb4e8fea2af514157 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "pending",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"rationale": "Опис причини змін контракту",
"date": "2017-06-21T17:53:05.109702+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
}
Change can be modified while it is in the pending
status:
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/changes/c382f2a7da3647bbb4e8fea2af514157?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 255
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"rationale": "Друга і третя поставка має бути розфасована"
}
}
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "pending",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:05.109702+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
}
Uploading change document¶
Document can be added only while change is in the pending
status.
Document has to be added in two stages:
- you should upload document
POST /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 199
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy995442828706$
Host: api-sandbox.openprocurement.org
Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7
{
"data": {
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
}
}
- you should set document properties
"documentOf": "change"
and"relatedItem": "{change.id}"
in order to bind the uploaded document to the change:
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 85
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"documentOf": "change",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157"
}
}
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
}
}
Updating contract properties¶
Now you can update contract properties which belong to the change.
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 144
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"period": {
"startDate": "2017-06-21T17:53:05.582663+03:00",
"endDate": "2017-07-21T17:53:05.582718+03:00"
},
"value": {
"amount": 438
}
}
}
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "active",
"value": {
"currency": "UAH",
"amount": 438.0,
"valueAddedTaxIncluded": true
},
"documents": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
}
],
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
},
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "c008a4d57c584dafa187ea72647e3cb7",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"period": {
"startDate": "2017-06-21T17:53:05.582663+03:00",
"endDate": "2017-07-21T17:53:05.582718+03:00"
},
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"kind": "general",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
},
"contractID": "UA-2017-06-21-000001-1",
"owner": "broker",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"changes": [
{
"status": "pending",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:05.109702+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
],
"dateModified": "2017-06-21T17:53:05.673576+03:00",
"tender_id": "7dc086c4a213492ab9c43b95b43bd817"
}
}
We see the added properties have merged with existing contract data. Additionally, the dateModified property was updated to reflect the last modification datestamp.
Fields that can be modified: title, description, status, value.amount, period, items, amountPaid.amount, terminationDetails.
See examples of items customization below. You can:
- update item:
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 42
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"items": [
{
"quantity": 2
},
{}
]
}
}
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "active",
"value": {
"currency": "UAH",
"amount": 438.0,
"valueAddedTaxIncluded": true
},
"documents": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
}
],
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 2
},
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "c008a4d57c584dafa187ea72647e3cb7",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 5
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"period": {
"startDate": "2017-06-21T17:53:05.582663+03:00",
"endDate": "2017-07-21T17:53:05.582718+03:00"
},
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"kind": "general",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
},
"contractID": "UA-2017-06-21-000001-1",
"owner": "broker",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"changes": [
{
"status": "pending",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:05.109702+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
],
"dateModified": "2017-06-21T17:53:05.807714+03:00",
"tender_id": "7dc086c4a213492ab9c43b95b43bd817"
}
}
- delete item:
Request example for cases when contract has several items:
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1160
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 2
}
]
}
}
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "active",
"value": {
"currency": "UAH",
"amount": 438.0,
"valueAddedTaxIncluded": true
},
"documents": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
}
],
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 2
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"period": {
"startDate": "2017-06-21T17:53:05.582663+03:00",
"endDate": "2017-07-21T17:53:05.582718+03:00"
},
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"kind": "general",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
},
"contractID": "UA-2017-06-21-000001-1",
"owner": "broker",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"changes": [
{
"status": "pending",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:05.109702+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
],
"dateModified": "2017-06-21T17:53:05.942313+03:00",
"tender_id": "7dc086c4a213492ab9c43b95b43bd817"
}
}
Applying the change¶
Change can be applied by switching to the active
status.
In order to apply active
status dateSigned field must be set.
After this change can’t be modified anymore.
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/changes/c382f2a7da3647bbb4e8fea2af514157?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 80
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"status": "active",
"dateSigned": "2017-06-21T17:53:05.978602+03:00"
}
}
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "active",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"dateSigned": "2017-06-21T17:53:05.978602+03:00",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:06.002992+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
}
dateSigned field validation:
- for the first contract change date should be after contract.dateSigned;
- for all next change objects date should be after the previous change.dateSigned.
You can view all changes:
GET /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/changes HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": [
{
"status": "active",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"dateSigned": "2017-06-21T17:53:05.978602+03:00",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:06.002992+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
]
}
All changes are also listed on the contract view.
GET /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "active",
"value": {
"currency": "UAH",
"amount": 438.0,
"valueAddedTaxIncluded": true
},
"documents": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
}
],
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 2
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"period": {
"startDate": "2017-06-21T17:53:05.582663+03:00",
"endDate": "2017-07-21T17:53:05.582718+03:00"
},
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"kind": "general",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
},
"contractID": "UA-2017-06-21-000001-1",
"owner": "broker",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"changes": [
{
"status": "active",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"dateSigned": "2017-06-21T17:53:05.978602+03:00",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:06.002992+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
],
"dateModified": "2017-06-21T17:53:06.006808+03:00",
"tender_id": "7dc086c4a213492ab9c43b95b43bd817"
}
}
Uploading documentation¶
Procuring entity can upload PDF files into the created contract. Uploading should follow the Documents Uploading rules.
POST /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 191
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy679645668448$
Host: api-sandbox.openprocurement.org
Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/398c861329694c5fb8aad22169159606
{
"data": {
"title": "contract.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/398c861329694c5fb8aad22169159606?download=a0d8357d8aca4a81aafce6912df0a6f7",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.124541+03:00",
"id": "398c861329694c5fb8aad22169159606",
"dateModified": "2017-06-21T17:53:06.124581+03:00"
}
}
201 Created response code and Location header confirm document creation. We can additionally query the documents collection API endpoint to confirm the action:
GET /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
},
{
"title": "contract.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/398c861329694c5fb8aad22169159606?download=a0d8357d8aca4a81aafce6912df0a6f7",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.124541+03:00",
"id": "398c861329694c5fb8aad22169159606",
"dateModified": "2017-06-21T17:53:06.124581+03:00"
}
]
}
And again we can confirm that there are two documents uploaded.
POST /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 215
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy730885500672$
Host: api-sandbox.openprocurement.org
Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1
{
"data": {
"title": "contract_additional_docs.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?download=e071206d6e464a2590fa505a5ba91c3d",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.232704+03:00",
"id": "167427d8f0ed431784f1a9b7dafe91b1",
"dateModified": "2017-06-21T17:53:06.232747+03:00"
}
}
In case we made an error, we can reupload the document over the older version:
PUT /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 226
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy0158879343206$
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"title": "contract_additional_docs.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?download=f9f4d77eb7fb4dfba28f96e89993e75e",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.232704+03:00",
"id": "167427d8f0ed431784f1a9b7dafe91b1",
"dateModified": "2017-06-21T17:53:06.301704+03:00"
}
}
And we can see that it is overriding the original version:
GET /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"title": "contract_additional_docs.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?download=f9f4d77eb7fb4dfba28f96e89993e75e",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.232704+03:00",
"previousVersions": [
{
"title": "contract_additional_docs.doc",
"url": "/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?download=e071206d6e464a2590fa505a5ba91c3d",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.232704+03:00",
"id": "167427d8f0ed431784f1a9b7dafe91b1",
"dateModified": "2017-06-21T17:53:06.232747+03:00"
}
],
"id": "167427d8f0ed431784f1a9b7dafe91b1",
"dateModified": "2017-06-21T17:53:06.301704+03:00"
}
}
Completing contract¶
Before contract can be completed amountPaid
field value should be set (regardless whether the contract was successful or unsuccessful).
Contract can be completed by switching to terminated
status.
Let’s perform these actions in single request:
PATCH /api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46?acc_token=2f1294ae618e49219d85607d17afabf6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 65
Content-Type: application/json
Host: api-sandbox.openprocurement.org
DATA:
{
"data": {
"status": "terminated",
"amountPaid": {
"amount": 430
}
}
}
Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "terminated",
"value": {
"currency": "UAH",
"amount": 438.0,
"valueAddedTaxIncluded": true
},
"changes": [
{
"status": "active",
"rationaleTypes": [
"volumeCuts",
"priceReduction"
],
"rationale_en": "Contract change cause",
"dateSigned": "2017-06-21T17:53:05.978602+03:00",
"rationale": "Друга і третя поставка має бути розфасована",
"date": "2017-06-21T17:53:06.002992+03:00",
"id": "c382f2a7da3647bbb4e8fea2af514157"
}
],
"documents": [
{
"title": "contract_changes.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/853ad85f888c403eb64b3db2ce16fed7?download=6b9d115c4fa94edb8d1f07615ed5b85c",
"format": "application/msword",
"documentOf": "change",
"datePublished": "2017-06-21T17:53:05.477533+03:00",
"id": "853ad85f888c403eb64b3db2ce16fed7",
"relatedItem": "c382f2a7da3647bbb4e8fea2af514157",
"dateModified": "2017-06-21T17:53:05.477575+03:00"
},
{
"title": "contract.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/398c861329694c5fb8aad22169159606?download=a0d8357d8aca4a81aafce6912df0a6f7",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.124541+03:00",
"id": "398c861329694c5fb8aad22169159606",
"dateModified": "2017-06-21T17:53:06.124581+03:00"
},
{
"title": "contract_additional_docs.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?download=e071206d6e464a2590fa505a5ba91c3d",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.232704+03:00",
"id": "167427d8f0ed431784f1a9b7dafe91b1",
"dateModified": "2017-06-21T17:53:06.232747+03:00"
},
{
"title": "contract_additional_docs.doc",
"url": "http://api-sandbox.openprocurement.org/api/2.3/contracts/bebdbaf7777d4bd39756f3e8872c1f46/documents/167427d8f0ed431784f1a9b7dafe91b1?download=f9f4d77eb7fb4dfba28f96e89993e75e",
"format": "application/msword",
"documentOf": "contract",
"datePublished": "2017-06-21T17:53:06.232704+03:00",
"id": "167427d8f0ed431784f1a9b7dafe91b1",
"dateModified": "2017-06-21T17:53:06.301704+03:00"
}
],
"items": [
{
"description": "футляри до державних нагород",
"classification": {
"scheme": "ДК021",
"description": "Cartons",
"id": "44617100-9"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "17.21.1",
"description": "папір і картон гофровані, паперова й картонна тара"
}
],
"deliveryAddress": {
"postalCode": "79000",
"countryName": "Україна",
"streetAddress": "вул. Банкова 1",
"region": "м. Київ",
"locality": "м. Київ"
},
"deliveryDate": {
"startDate": "2017-06-23T17:53:02.070092+03:00",
"endDate": "2017-06-26T17:53:02.070092+03:00"
},
"id": "f8a311c2c9a34ff08bdf59bbc8092348",
"unit": {
"code": "44617100-9",
"name": "item"
},
"quantity": 2
}
],
"suppliers": [
{
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
}
],
"period": {
"startDate": "2017-06-21T17:53:05.582663+03:00",
"endDate": "2017-07-21T17:53:05.582718+03:00"
},
"dateSigned": "2017-06-21T17:53:04.594612+03:00",
"id": "bebdbaf7777d4bd39756f3e8872c1f46",
"procuringEntity": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256",
"uri": "http://www.dus.gov.ua/"
},
"name": "Державне управління справами",
"kind": "general",
"address": {
"postalCode": "01220",
"countryName": "Україна",
"streetAddress": "вул. Банкова, 11, корпус 1",
"region": "м. Київ",
"locality": "м. Київ"
}
},
"contractID": "UA-2017-06-21-000001-1",
"owner": "broker",
"awardID": "2f549474497c475b8023d51845cbb2bd",
"amountPaid": {
"currency": "UAH",
"amount": 430.0,
"valueAddedTaxIncluded": true
},
"dateModified": "2017-06-21T17:53:06.561834+03:00",
"tender_id": "7dc086c4a213492ab9c43b95b43bd817"
}
}
Note that you can set/change only amountPaid.amount
value. amountPaid.currency
and amountPaid.valueAddedTaxIncluded
fields’ values are generated from Contract.value
field.
If contract is unsuccessful reasons for termination terminationDetails
should be specified.
Any future modification to the contract are not allowed.