Tutorial

Exploring basic rules

Let’s try exploring the /contracts endpoint:

GET /api/2.5/contracts HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "next_page": {
    "path": "/api/2.5/contracts?offset=",
    "uri": "http://lb.api-sandbox.registry.ea.openprocurement.net/api/2.5/contracts?offset=",
    "offset": ""
  },
  "data": []
}

Just invoking it reveals an empty set.

Contract is transferred from the auction system by an automated process.

Creating contract

Let’s say that we have conducted procedure and it has complete status. When the procedure is completed, contract (that has been created in the auction system) is transferred to the contract system automatically.

Brokers (eMalls) can’t create contracts in the contract system.

The contract initially receives active.confirmaition status.

GET /api/2.5/contracts/08edeb5a34f3463aae55c1b9780be761 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.confirmation",
    "merchandisingObject": "a930574bf8cd999cb7f9c9ed4ca68061",
    "title": "Test Contract",
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        },
        "description": "Земля для військовослужбовців",
        "classification": {
          "scheme": "CPV",
          "description": "Земельні ділянки",
          "id": "66113000-5"
        },
        "additionalClassifications": [
          {
            "scheme": "CAV",
            "id": "39513200-3",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "address": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "id": "6cb841dc37984ad7860d93d9bf8488e6",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "period": {
      "startDate": "2018-07-12T14:02:50.678865+03:00",
      "endDate": "2018-08-11T14:02:50.678870+03:00"
    },
    "dateSigned": "2018-07-12T14:02:50.678838+03:00",
    "procuringEntity": {
      "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": "м. Київ"
      },
      "additionalContactPoints": [
        {
          "name": "Державне управління справами",
          "telephone": "0440000000"
        }
      ]
    },
    "owner": "contracting",
    "contractType": "ceasefire",
    "awardID": "376d560b2b2d452a80543865f3cab43e",
    "id": "08edeb5a34f3463aae55c1b9780be761",
    "contractID": "a930574bf8cd405cb7f9c9ed4ca68061"
  }
}

Getting contract

Let’s access the URL of the created object. The internal identification of the contract (id) is noted within the Lots Registry (lot.contracts.relatedProcessID):

GET /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.confirmation",
    "merchandisingObject": "a930574bf8cd999cb7f9c9ed4ca68061",
    "title": "Test Contract",
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        },
        "description": "Земля для військовослужбовців",
        "classification": {
          "scheme": "CPV",
          "description": "Земельні ділянки",
          "id": "66113000-5"
        },
        "additionalClassifications": [
          {
            "scheme": "CAV",
            "id": "39513200-3",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "address": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "id": "167e02bf440e43bb972fb7f9309ad82c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "period": {
      "startDate": "2018-07-13T16:34:36.559259+03:00",
      "endDate": "2018-08-12T16:34:36.559264+03:00"
    },
    "dateSigned": "2018-07-13T16:34:36.559240+03:00",
    "procuringEntity": {
      "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": "м. Київ"
      },
      "additionalContactPoints": [
        {
          "name": "Державне управління справами",
          "telephone": "0440000000"
        }
      ]
    },
    "owner": "contracting",
    "contractType": "ceasefire",
    "awardID": "376d560b2b2d452a80543865f3cab43e",
    "id": "dda226649ee64264aded84f41f7f7a13",
    "contractID": "a930574bf8cd405cb7f9c9ed4ca68061"
  }
}

Getting access

In order to get rights for future contract editing, you need to use access transfer mechanism.

Let’s create a transfer:

POST /api/2.5/transfers HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 12
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {}
}

Response: 201 Created
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "access": {
    "transfer": "226e63d0f42a4791a9567d0452cb1e03",
    "token": "3b4905dbfbaf4ffaac2ff8f30dac2ae6"
  },
  "data": {
    "date": "2018-07-13T16:34:37.053910+03:00",
    "id": "4d4d01d4623e5f39a415d6603204794f"
  }
}

To acquire ownership on the contract, we must to use that transfer:

POST /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/ownership HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 100
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "transfer": "b04f2563ac9c4a88b6c221d635bba8e5",
    "id": "4d4d01d4623e5f39a415d6603204794f"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.confirmation",
    "merchandisingObject": "a930574bf8cd999cb7f9c9ed4ca68061",
    "title": "Test Contract",
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        },
        "description": "Земля для військовослужбовців",
        "classification": {
          "scheme": "CPV",
          "description": "Земельні ділянки",
          "id": "66113000-5"
        },
        "additionalClassifications": [
          {
            "scheme": "CAV",
            "id": "39513200-3",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "address": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "id": "167e02bf440e43bb972fb7f9309ad82c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "period": {
      "startDate": "2018-07-13T16:34:36.559259+03:00",
      "endDate": "2018-08-12T16:34:36.559264+03:00"
    },
    "dateSigned": "2018-07-13T16:34:36.559240+03:00",
    "procuringEntity": {
      "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": "м. Київ"
      },
      "additionalContactPoints": [
        {
          "name": "Державне управління справами",
          "telephone": "0440000000"
        }
      ]
    },
    "owner": "broker",
    "contractType": "ceasefire",
    "awardID": "376d560b2b2d452a80543865f3cab43e",
    "id": "dda226649ee64264aded84f41f7f7a13",
    "contractID": "a930574bf8cd405cb7f9c9ed4ca68061"
  }
}

For futher actions to be applied you need to activate the contract. Using access_token change status of the contract to active.payment:

PATCH /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 38
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "active.payment"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.payment",
    "milestones": [
      {
        "status": "processing",
        "type": "financing",
        "id": "f4a8d4e93c68484d999dea2648f69fba",
        "dueDate": "2018-10-08T18:00:00+03:00"
      },
      {
        "status": "scheduled",
        "type": "approval",
        "id": "f4884f4dbd074d5dbb3a91567dbdd9c8"
      },
      {
        "status": "scheduled",
        "type": "reporting",
        "id": "754aae61b4184c95ad7ac9351e2a48a8"
      }
    ],
    "merchandisingObject": "a930574bf8cd999cb7f9c9ed4ca68061",
    "title": "Test Contract",
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        },
        "description": "Земля для військовослужбовців",
        "classification": {
          "scheme": "CPV",
          "description": "Земельні ділянки",
          "id": "66113000-5"
        },
        "additionalClassifications": [
          {
            "scheme": "CAV",
            "id": "39513200-3",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "address": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "id": "167e02bf440e43bb972fb7f9309ad82c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "period": {
      "startDate": "2018-07-13T16:34:36.559259+03:00",
      "endDate": "2018-08-12T16:34:36.559264+03:00"
    },
    "dateSigned": "2018-07-13T16:34:36.559240+03:00",
    "procuringEntity": {
      "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": "м. Київ"
      },
      "additionalContactPoints": [
        {
          "name": "Державне управління справами",
          "telephone": "0440000000"
        }
      ]
    },
    "owner": "broker",
    "contractType": "ceasefire",
    "awardID": "376d560b2b2d452a80543865f3cab43e",
    "id": "dda226649ee64264aded84f41f7f7a13",
    "contractID": "a930574bf8cd405cb7f9c9ed4ca68061"
  }
}

Now let’s view contracts.

GET /api/2.5/contracts HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "next_page": {
    "path": "/api/2.5/contracts?offset=2018-07-13T16%3A34%3A37.122544%2B03%3A00",
    "uri": "http://lb.api-sandbox.registry.ea.openprocurement.net/api/2.5/contracts?offset=2018-07-13T16%3A34%3A37.122544%2B03%3A00",
    "offset": "2018-07-13T16:34:37.122544+03:00"
  },
  "data": [
    {
      "id": "dda226649ee64264aded84f41f7f7a13",
      "dateModified": "2018-07-13T16:34:37.122544+03:00"
    }
  ]
}

Milestones

There are 3 milestones within:

  • financing milestone;
  • approval milestone;
  • reporting milestone.

Working with the financing milestone

The milestone initially receives processing status with an auto-generated dueDate equal to (dateSigned + 60 days):

GET /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/f4a8d4e93c68484d999dea2648f69fba HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "processing",
    "type": "financing",
    "id": "f4a8d4e93c68484d999dea2648f69fba",
    "dueDate": "2018-10-08T18:00:00+03:00"
  }
}

It is then when the winner has to introduce the payment (the sum suggested within the auction). As soon as the payment is received, the Organizer has to mention this date within the dateMet field. If dateMet lies within the suggested frames (up to dueDate), the milestone status will be automatically switched to met:

PATCH /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/f4a8d4e93c68484d999dea2648f69fba?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 50
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "dateMet": "2018-10-06T18:00:00+03:00"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "met",
    "dateModified": "2018-07-13T16:34:37.504172+03:00",
    "id": "f4a8d4e93c68484d999dea2648f69fba",
    "dateMet": "2018-10-06T18:00:00+03:00",
    "type": "financing",
    "dueDate": "2018-10-08T18:00:00+03:00"
  }
}

If dateMet is after dueDate, the milestone status will be switched to partiallyMet:

PATCH /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/f4a8d4e93c68484d999dea2648f69fba?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 50
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "dateMet": "2018-10-10T18:00:00+03:00"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "partiallyMet",
    "dateModified": "2018-07-13T16:34:37.535284+03:00",
    "id": "f4a8d4e93c68484d999dea2648f69fba",
    "dateMet": "2018-10-10T18:00:00+03:00",
    "type": "financing",
    "dueDate": "2018-10-08T18:00:00+03:00"
  }
}

Both of the described actions result in contract being changed its status from active.payment to active.approval:

GET /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.approval",
    "milestones": [
      {
        "status": "partiallyMet",
        "dateModified": "2018-07-13T16:34:37.535284+03:00",
        "id": "f4a8d4e93c68484d999dea2648f69fba",
        "dateMet": "2018-10-10T18:00:00+03:00",
        "type": "financing",
        "dueDate": "2018-10-08T18:00:00+03:00"
      },
      {
        "status": "processing",
        "type": "approval",
        "id": "f4884f4dbd074d5dbb3a91567dbdd9c8",
        "dueDate": "2018-11-07T18:00:00+03:00"
      },
      {
        "status": "scheduled",
        "type": "reporting",
        "id": "754aae61b4184c95ad7ac9351e2a48a8"
      }
    ],
    "merchandisingObject": "a930574bf8cd999cb7f9c9ed4ca68061",
    "title": "Test Contract",
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        },
        "description": "Земля для військовослужбовців",
        "classification": {
          "scheme": "CPV",
          "description": "Земельні ділянки",
          "id": "66113000-5"
        },
        "additionalClassifications": [
          {
            "scheme": "CAV",
            "id": "39513200-3",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "address": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "id": "167e02bf440e43bb972fb7f9309ad82c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "period": {
      "startDate": "2018-07-13T16:34:36.559259+03:00",
      "endDate": "2018-08-12T16:34:36.559264+03:00"
    },
    "dateSigned": "2018-07-13T16:34:36.559240+03:00",
    "procuringEntity": {
      "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": "м. Київ"
      },
      "additionalContactPoints": [
        {
          "name": "Державне управління справами",
          "telephone": "0440000000"
        }
      ]
    },
    "owner": "broker",
    "contractType": "ceasefire",
    "awardID": "376d560b2b2d452a80543865f3cab43e",
    "id": "dda226649ee64264aded84f41f7f7a13",
    "contractID": "a930574bf8cd405cb7f9c9ed4ca68061"
  }
}

The Organizer can also switch the milestone status to notMet if the payment has not been introduced at all. This one will change the contract status to pending.unsuccessful. As long as the lot becomes pending.dissolution, the contract receives unsuccessful status.

We don’t show a request for this, because it’s irreversable action, and after it we cannot fully demonstrate the work with contracts.

Working with the approval milestone

The milestone initially receives scheduled status. As long as the contract receives active.approval, status of the approval milestone is changed to processing. The dueDate here is equal to (financing milestone’s dateMet + 20 business days)

GET /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/f4884f4dbd074d5dbb3a91567dbdd9c8 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "processing",
    "type": "approval",
    "id": "f4884f4dbd074d5dbb3a91567dbdd9c8",
    "dueDate": "2018-11-07T18:00:00+03:00"
  }
}

The Organizer can also optionally set the dueDate of the reporting milestone. It can be done only when the reporting milestone has status scheduled. If dueDate will not be set manually, it will be set automatically.

PATCH /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/754aae61b4184c95ad7ac9351e2a48a8?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 50
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "dueDate": "2022-02-19T18:00:00+03:00"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "scheduled",
    "dateModified": "2018-07-13T16:34:37.592359+03:00",
    "type": "reporting",
    "dueDate": "2022-02-19T18:00:00+03:00",
    "id": "754aae61b4184c95ad7ac9351e2a48a8"
  }
}

It is then when the Organizer has to upload the Small-Scale Privatization Completion Report (documentType: approvalProtocol), note the date when the Report has been signed (dateMet field) and change status of the current milestone to met (if dateMet lies within the suggested frames) or partiallyMet (if not) by setting actual dateMet:

PATCH /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/f4884f4dbd074d5dbb3a91567dbdd9c8?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 50
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "dateMet": "2018-11-05T18:00:00+03:00"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "met",
    "dateModified": "2018-07-13T16:34:37.620588+03:00",
    "id": "f4884f4dbd074d5dbb3a91567dbdd9c8",
    "dateMet": "2018-11-05T18:00:00+03:00",
    "type": "approval",
    "dueDate": "2018-11-07T18:00:00+03:00"
  }
}

The actions performed lead to the contract being changed its status from active.approval to active:

GET /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active",
    "milestones": [
      {
        "status": "partiallyMet",
        "dateModified": "2018-07-13T16:34:37.535284+03:00",
        "id": "f4a8d4e93c68484d999dea2648f69fba",
        "dateMet": "2018-10-10T18:00:00+03:00",
        "type": "financing",
        "dueDate": "2018-10-08T18:00:00+03:00"
      },
      {
        "status": "met",
        "dateModified": "2018-07-13T16:34:37.620588+03:00",
        "id": "f4884f4dbd074d5dbb3a91567dbdd9c8",
        "dateMet": "2018-11-05T18:00:00+03:00",
        "type": "approval",
        "dueDate": "2018-11-07T18:00:00+03:00"
      },
      {
        "status": "processing",
        "dateModified": "2018-07-13T16:34:37.592359+03:00",
        "type": "reporting",
        "dueDate": "2022-02-19T18:00:00+03:00",
        "id": "754aae61b4184c95ad7ac9351e2a48a8"
      }
    ],
    "merchandisingObject": "a930574bf8cd999cb7f9c9ed4ca68061",
    "title": "Test Contract",
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        },
        "description": "Земля для військовослужбовців",
        "classification": {
          "scheme": "CPV",
          "description": "Земельні ділянки",
          "id": "66113000-5"
        },
        "additionalClassifications": [
          {
            "scheme": "CAV",
            "id": "39513200-3",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "address": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "id": "167e02bf440e43bb972fb7f9309ad82c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "period": {
      "startDate": "2018-07-13T16:34:36.559259+03:00",
      "endDate": "2018-08-12T16:34:36.559264+03:00"
    },
    "dateSigned": "2018-07-13T16:34:36.559240+03:00",
    "procuringEntity": {
      "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": "м. Київ"
      },
      "additionalContactPoints": [
        {
          "name": "Державне управління справами",
          "telephone": "0440000000"
        }
      ]
    },
    "owner": "broker",
    "contractType": "ceasefire",
    "awardID": "376d560b2b2d452a80543865f3cab43e",
    "id": "dda226649ee64264aded84f41f7f7a13",
    "contractID": "a930574bf8cd405cb7f9c9ed4ca68061"
  }
}

In case of the Completion Report has not been introduced, the Organizer has to manually switch milestone status to notMet. This one will change the contract status to pending.unsuccessful. As long as the lot becomes pending.dissolution, the contract receives unsuccessful status.

Working with the reporting milestone

The milestone initially receives scheduled status. As long as the contract receives active, status of the reporting milestone is changed to processing. The dueDate here is equal to either (reporting milestone’s dateMet + 3 years) or the date mentioned before.

GET /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/754aae61b4184c95ad7ac9351e2a48a8 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "processing",
    "dateModified": "2018-07-13T16:34:37.592359+03:00",
    "type": "reporting",
    "dueDate": "2022-02-19T18:00:00+03:00",
    "id": "754aae61b4184c95ad7ac9351e2a48a8"
  }
}

As long as all of the contract conditions have been met, the Organizer has to mention the appropriate dateMet and change status of the current milestone to met (if dateMet lies within the suggested frames) or partiallyMet (if not):

PATCH /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/milestones/754aae61b4184c95ad7ac9351e2a48a8?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 50
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "dateMet": "2022-02-17T18:00:00+03:00"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "met",
    "dateModified": "2018-07-13T16:34:37.683352+03:00",
    "id": "754aae61b4184c95ad7ac9351e2a48a8",
    "dateMet": "2022-02-17T18:00:00+03:00",
    "type": "reporting",
    "dueDate": "2022-02-19T18:00:00+03:00"
  }
}

The actions performed lead to the contract being changed its status from active to pending.terminated:

GET /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending.terminated",
    "milestones": [
      {
        "status": "partiallyMet",
        "dateModified": "2018-07-13T16:34:37.535284+03:00",
        "id": "f4a8d4e93c68484d999dea2648f69fba",
        "dateMet": "2018-10-10T18:00:00+03:00",
        "type": "financing",
        "dueDate": "2018-10-08T18:00:00+03:00"
      },
      {
        "status": "met",
        "dateModified": "2018-07-13T16:34:37.620588+03:00",
        "id": "f4884f4dbd074d5dbb3a91567dbdd9c8",
        "dateMet": "2018-11-05T18:00:00+03:00",
        "type": "approval",
        "dueDate": "2018-11-07T18:00:00+03:00"
      },
      {
        "status": "met",
        "dateModified": "2018-07-13T16:34:37.683352+03:00",
        "id": "754aae61b4184c95ad7ac9351e2a48a8",
        "dateMet": "2022-02-17T18:00:00+03:00",
        "type": "reporting",
        "dueDate": "2022-02-19T18:00:00+03:00"
      }
    ],
    "merchandisingObject": "a930574bf8cd999cb7f9c9ed4ca68061",
    "title": "Test Contract",
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        },
        "description": "Земля для військовослужбовців",
        "classification": {
          "scheme": "CPV",
          "description": "Земельні ділянки",
          "id": "66113000-5"
        },
        "additionalClassifications": [
          {
            "scheme": "CAV",
            "id": "39513200-3",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "address": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "id": "167e02bf440e43bb972fb7f9309ad82c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "period": {
      "startDate": "2018-07-13T16:34:36.559259+03:00",
      "endDate": "2018-08-12T16:34:36.559264+03:00"
    },
    "dateSigned": "2018-07-13T16:34:36.559240+03:00",
    "procuringEntity": {
      "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": "м. Київ"
      },
      "additionalContactPoints": [
        {
          "name": "Державне управління справами",
          "telephone": "0440000000"
        }
      ]
    },
    "owner": "broker",
    "contractType": "ceasefire",
    "awardID": "376d560b2b2d452a80543865f3cab43e",
    "id": "dda226649ee64264aded84f41f7f7a13",
    "contractID": "a930574bf8cd405cb7f9c9ed4ca68061"
  }
}

As long as the lot becomes pending.sold, the contract receives terminated status so that any future modification to the contract are not allowed.

In case of the conditions have not been met, the Organizer has to manually switch milestone status to notMet. This one will change the contract status to pending.unsuccessful. As long as the lot becomes pending.dissolution, the contract receives unsuccessful status.

Uploading milestone document

Document has to be added in two stages:

  • you should upload document
  • you should set document properties "documentOf": "milesone" and "relatedItem": "{milestone.id}" in order to bind the uploaded document to the milestone:
POST /api/2.5/contracts/dda226649ee64264aded84f41f7f7a13/documents?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 389
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "hash": "md5:00000000000000000000000000000000",
    "format": "application/msword",
    "url": "http://localhost/get/50f99bbf153e425cb6b5083b858a0d0f?KeyID=172d32c8&Signature=qhgD%2FYqFEh6Al6YkHzHuZEtWyconzWwU2MlKcvVrNHoeajAuRh4gafOCu9Zc1TVtFsfIc7gSU%2BhU1o2eZvl9CA%3D%3D",
    "title": "укр.doc",
    "documentOf": "milestone",
    "relatedItem": "f4a8d4e93c68484d999dea2648f69fba"
  }
}

Response: 201 Created
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "hash": "md5:00000000000000000000000000000000",
    "title": "укр.doc",
    "url": "http://localhost/get/50f99bbf153e425cb6b5083b858a0d0f?KeyID=172d32c8&Signature=qhgD%2FYqFEh6Al6YkHzHuZEtWyconzWwU2MlKcvVrNHoeajAuRh4gafOCu9Zc1TVtFsfIc7gSU%2BhU1o2eZvl9CA%3D%3D",
    "format": "application/msword",
    "documentOf": "milestone",
    "datePublished": "2018-07-13T16:34:37.727546+03:00",
    "id": "270392a2094047c3a84023b4271a7e94",
    "relatedItem": "f4a8d4e93c68484d999dea2648f69fba",
    "dateModified": "2018-07-13T16:34:37.727563+03:00"
  }
}

Uploading documentation

Procuring entity can upload PDF files into the created contract. Uploading should follow the Documents Uploading rules.

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.5/contracts/dda226649ee64264aded84f41f7f7a13/documents/270392a2094047c3a84023b4271a7e94?acc_token=3b4905dbfbaf4ffaac2ff8f30dac2ae6 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "hash": "md5:00000000000000000000000000000000",
    "title": "укр.doc",
    "url": "http://localhost/get/50f99bbf153e425cb6b5083b858a0d0f?KeyID=172d32c8&Signature=qhgD%2FYqFEh6Al6YkHzHuZEtWyconzWwU2MlKcvVrNHoeajAuRh4gafOCu9Zc1TVtFsfIc7gSU%2BhU1o2eZvl9CA%3D%3D",
    "format": "application/msword",
    "documentOf": "milestone",
    "datePublished": "2018-07-13T16:34:37.727546+03:00",
    "id": "270392a2094047c3a84023b4271a7e94",
    "relatedItem": "f4a8d4e93c68484d999dea2648f69fba",
    "dateModified": "2018-07-13T16:34:37.727563+03:00"
  }
}