Tutorial

Exploring basic rules

Let’s try exploring the /lots endpoint:

GET /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea2.openprocurement.net

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

Just invoking it reveals empty set.

Now let’s attempt creating a lot:

POST /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 4
Content-Type: application/x-www-form-urlencoded
Host: lb.api-sandbox.registry.ea2.openprocurement.net

Response: 415 Unsupported Media Type
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "status": "error", 
  "errors": [
    {
      "description": "Content-Type header should be one of ['application/json']", 
      "location": "header", 
      "name": "Content-Type"
    }
  ]
}

Error states that the only accepted Content-Type is application/json.

Let’s satisfy the Content-type requirement:

POST /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 4
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net

Response: 422 Unprocessable Entity
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "status": "error", 
  "errors": [
    {
      "description": "Expecting value: line 1 column 1 (char 0)", 
      "location": "body", 
      "name": "data"
    }
  ]
}

Error states that no data has been found in JSON body.

Creating lot

You can create lot with relatedProcesses at once. It`s called a batch mode.

POST /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 236
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID"
      }
    ], 
    "lotType": "redemption", 
    "relatedProcesses": [
      {
        "type": "asset", 
        "relatedProcessID": "13aca930afb34ab0ab78838811213aac"
      }
    ]
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots/b5caff0875214c02bf220302786d38da
X-Content-Type-Options: nosniff
{
  "access": {
    "transfer": "08f0ebbddd9c46749cc6f8b1370ed831", 
    "token": "9d9a68e7046c4a69a55b5343dc886080"
  }, 
  "data": {
    "status": "draft", 
    "lotID": "UA-LR-DGF-2019-03-12-000001", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "f2205eaf4dbb458885e8cd7aa5f1a2d9"
      }
    ], 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "6c6b3f8570104128b3fc28ca348207c2", 
        "decisionOf": "lot"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.248759+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.231779+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.231801+02:00", 
        "id": "7ceb59e74f4746a185a20fb231ec7ba0"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "procurementMethodType": "reporting", 
        "id": "eb19155463a542f9ae34ee6f9dde84e6"
      }
    ], 
    "date": "2019-03-12T13:28:56.246941+02:00", 
    "relatedProcesses": [
      {
        "type": "asset", 
        "id": "cbed9e6a264142a78cface1e257d82ce", 
        "relatedProcessID": "13aca930afb34ab0ab78838811213aac"
      }
    ], 
    "id": "b5caff0875214c02bf220302786d38da"
  }
}

Let’s create lot with the minimal data set:

POST /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 139
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "lotType": "redemption", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID"
      }
    ]
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656
X-Content-Type-Options: nosniff
{
  "access": {
    "transfer": "91a0de6c4fb7482bb462871390b467f0", 
    "token": "7e25ecd2e7254c469bb16c87fb5adf51"
  }, 
  "data": {
    "status": "draft", 
    "lotID": "UA-LR-DGF-2019-03-12-000002", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "9a501623597642f2a58793bc6f2f2a48"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.305241+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.286818+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.286854+02:00", 
        "id": "212eafc66f6d4ef3bd8aac70efc52354"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "procurementMethodType": "reporting", 
        "id": "0253e7e2c9aa4d2c9c9cad1c38ddb88e"
      }
    ], 
    "date": "2019-03-12T13:28:56.302003+02:00", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "8f5a2e677e4a49fda06c850aa0ea98ea", 
        "decisionOf": "lot"
      }
    ], 
    "id": "86f5b7cf26c4446ca23707c1ed405656"
  }
}

The object you’re trying to add initially receives draft status. You should manually switch this object from draft to composing (2 Phase Commit mechanism) so that to add the auction conditions (value.amount, minimalStep.amount, etc.):

PATCH /api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656?acc_token=7e25ecd2e7254c469bb16c87fb5adf51 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 33
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "status": "composing"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "composing", 
    "lotID": "UA-LR-DGF-2019-03-12-000002", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "9a501623597642f2a58793bc6f2f2a48"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.385230+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.286818+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.286854+02:00", 
        "id": "212eafc66f6d4ef3bd8aac70efc52354"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "procurementMethodType": "reporting", 
        "id": "0253e7e2c9aa4d2c9c9cad1c38ddb88e"
      }
    ], 
    "date": "2019-03-12T13:28:56.384625+02:00", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "8f5a2e677e4a49fda06c850aa0ea98ea", 
        "decisionOf": "lot"
      }
    ], 
    "id": "86f5b7cf26c4446ca23707c1ed405656"
  }
}

You see that lot.auctions structure has been added with the set of auto-generated data.

Now let’s add relatedProcesses:

POST /api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656/related_processes HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 83
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
X-Access-Token: 7e25ecd2e7254c469bb16c87fb5adf51
DATA:
{
  "data": {
    "type": "asset", 
    "relatedProcessID": "b014dd89b9c94e30964a8ce6dcc68a91"
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656/related_processes/ed95cd7dfabd4f3da3818ae742d14c36
X-Content-Type-Options: nosniff
{
  "data": {
    "type": "asset", 
    "id": "ed95cd7dfabd4f3da3818ae742d14c36", 
    "relatedProcessID": "b014dd89b9c94e30964a8ce6dcc68a91"
  }
}

To enable further manipulations with the lot, its status should be manually switched to verification.

PATCH /api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656?acc_token=7e25ecd2e7254c469bb16c87fb5adf51 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 36
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "status": "verification"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "verification", 
    "lotID": "UA-LR-DGF-2019-03-12-000002", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "9a501623597642f2a58793bc6f2f2a48"
      }
    ], 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "8f5a2e677e4a49fda06c850aa0ea98ea", 
        "decisionOf": "lot"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.550936+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.286818+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.286854+02:00", 
        "id": "212eafc66f6d4ef3bd8aac70efc52354"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "bankAccount": {
          "accountIdentification": [
            {
              "scheme": "accountNumber", 
              "id": "111111-8", 
              "description": "some description"
            }
          ], 
          "bankName": "name of bank"
        }, 
        "procurementMethodType": "reporting", 
        "value": {
          "currency": "UAH", 
          "amount": 3000.87, 
          "valueAddedTaxIncluded": true
        }, 
        "id": "0253e7e2c9aa4d2c9c9cad1c38ddb88e", 
        "guarantee": {
          "currency": "UAH", 
          "amount": 700.87
        }
      }
    ], 
    "date": "2019-03-12T13:28:56.550431+02:00", 
    "relatedProcesses": [
      {
        "type": "asset", 
        "id": "ed95cd7dfabd4f3da3818ae742d14c36", 
        "relatedProcessID": "b014dd89b9c94e30964a8ce6dcc68a91"
      }
    ], 
    "id": "86f5b7cf26c4446ca23707c1ed405656"
  }
}

Success! Now we can see that new object was created. Response code is 201 and Location response header reports the location of the created object. The body of response reveals the information about the created asset: its internal id (that matches the Location segment), its official assetID and dateModified datestamp stating the moment when asset was last modified. Note that lot is created with pending status.

Let’s access the URL of the created object (the Location header of the response):

We can see the same response we got after creating lot.

POST /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 139
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "lotType": "redemption", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID"
      }
    ]
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656
X-Content-Type-Options: nosniff
{
  "access": {
    "transfer": "91a0de6c4fb7482bb462871390b467f0", 
    "token": "7e25ecd2e7254c469bb16c87fb5adf51"
  }, 
  "data": {
    "status": "draft", 
    "lotID": "UA-LR-DGF-2019-03-12-000002", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "9a501623597642f2a58793bc6f2f2a48"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.305241+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.286818+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.286854+02:00", 
        "id": "212eafc66f6d4ef3bd8aac70efc52354"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "procurementMethodType": "reporting", 
        "id": "0253e7e2c9aa4d2c9c9cad1c38ddb88e"
      }
    ], 
    "date": "2019-03-12T13:28:56.302003+02:00", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "8f5a2e677e4a49fda06c850aa0ea98ea", 
        "decisionOf": "lot"
      }
    ], 
    "id": "86f5b7cf26c4446ca23707c1ed405656"
  }
}

Let’s see what listing of lots reveals us:

GET /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea2.openprocurement.net

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

We do see the internal id of the lot (that can be used to construct full URL http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.4/lots/8286cc7863814271afe23cb2646237ed`) and its dateModified date stamp.

Let’s try creating another lot:

POST /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 139
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "lotType": "redemption", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID"
      }
    ]
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots/51885c40fd69474087424adb80403ac3
X-Content-Type-Options: nosniff
{
  "access": {
    "transfer": "772367bf069244c382850010c21d72dc", 
    "token": "fadbe1f5c36c4b0db64b6a3a0621f22f"
  }, 
  "data": {
    "status": "draft", 
    "lotID": "UA-LR-DGF-2019-03-12-000003", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "226bc4dcebc549c8998b1c1ef53ecb7c"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.658438+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.629617+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.629663+02:00", 
        "id": "54fd16b06e7941809a2e01f72ef85ecd"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "procurementMethodType": "reporting", 
        "id": "f8709898a0cd459cac6935a20847d6b8"
      }
    ], 
    "date": "2019-03-12T13:28:56.655923+02:00", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "7bc35bca8f3b46b4832f1d29dd5ff664", 
        "decisionOf": "lot"
      }
    ], 
    "id": "51885c40fd69474087424adb80403ac3"
  }
}

And again we have 201 Created response code, Location header and body with extra id, lotID, and dateModified properties.

Switch second lot to ‘composing’ status’:

PATCH /api/2.5/lots/51885c40fd69474087424adb80403ac3?acc_token=fadbe1f5c36c4b0db64b6a3a0621f22f HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 33
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "status": "composing"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "composing", 
    "lotID": "UA-LR-DGF-2019-03-12-000003", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "226bc4dcebc549c8998b1c1ef53ecb7c"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.730774+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.629617+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.629663+02:00", 
        "id": "54fd16b06e7941809a2e01f72ef85ecd"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "procurementMethodType": "reporting", 
        "id": "f8709898a0cd459cac6935a20847d6b8"
      }
    ], 
    "date": "2019-03-12T13:28:56.730490+02:00", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "7bc35bca8f3b46b4832f1d29dd5ff664", 
        "decisionOf": "lot"
      }
    ], 
    "id": "51885c40fd69474087424adb80403ac3"
  }
}

Let’s check what lot registry contains:

GET /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea2.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "next_page": {
    "path": "/api/2.5/lots?offset=2019-03-12T13%3A28%3A56.550936%2B02%3A00", 
    "uri": "http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots?offset=2019-03-12T13%3A28%3A56.550936%2B02%3A00", 
    "offset": "2019-03-12T13:28:56.550936+02:00"
  }, 
  "data": [
    {
      "id": "86f5b7cf26c4446ca23707c1ed405656", 
      "dateModified": "2019-03-12T13:28:56.550936+02:00"
    }
  ]
}

And indeed we have 2 lots now.

Modifying Lot

Let’s update lot description:

PATCH /api/2.5/lots/51885c40fd69474087424adb80403ac3?acc_token=fadbe1f5c36c4b0db64b6a3a0621f22f HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 53
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "description": "Lot description modified"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "composing", 
    "lotID": "UA-LR-DGF-2019-03-12-000003", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "226bc4dcebc549c8998b1c1ef53ecb7c"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:56.730774+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.629617+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.629663+02:00", 
        "id": "54fd16b06e7941809a2e01f72ef85ecd"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "procurementMethodType": "reporting", 
        "id": "f8709898a0cd459cac6935a20847d6b8"
      }
    ], 
    "date": "2019-03-12T13:28:56.730490+02:00", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "7bc35bca8f3b46b4832f1d29dd5ff664", 
        "decisionOf": "lot"
      }
    ], 
    "id": "51885c40fd69474087424adb80403ac3"
  }
}

We see the added properties have merged with existing lot data. Additionally, the dateModified property was updated to reflect the last modification date stamp.

Note that lot can be modified only within the rectification period (up to rectificationPeriod.endDate).

Checking the listing again reflects the new modification date:

GET /api/2.5/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea2.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "next_page": {
    "path": "/api/2.5/lots?offset=2019-03-12T13%3A28%3A56.730774%2B02%3A00", 
    "uri": "http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots?offset=2019-03-12T13%3A28%3A56.730774%2B02%3A00", 
    "offset": "2019-03-12T13:28:56.730774+02:00"
  }, 
  "data": [
    {
      "id": "86f5b7cf26c4446ca23707c1ed405656", 
      "dateModified": "2019-03-12T13:28:56.550936+02:00"
    }, 
    {
      "id": "51885c40fd69474087424adb80403ac3", 
      "dateModified": "2019-03-12T13:28:56.730774+02:00"
    }
  ]
}

Deleting Lot

Let’s delete lot:

A document with the documentType: canellationDetails has to be added first:

POST /api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656/documents HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 348
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
X-Access-Token: 7e25ecd2e7254c469bb16c87fb5adf51
DATA:
{
  "data": {
    "url": "http://localhost/get/0daf251e8f744e8a91b321e6e0861b93?KeyID=172d32c8&Signature=iYMdZPbLOMr6eQns5t2v1rU%2F6vJBEIqG9x9iyzDObTBWt3TpjTNUvPdqxJadkDtJUlhvAzezRXFA7w7PziRbCQ%3D%3D", 
    "title": "укр.doc", 
    "format": "application/msword", 
    "hash": "md5:00000000000000000000000000000000", 
    "documentType": "cancellationDetails"
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea2.openprocurement.net/api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656/documents/0ec306f01d3746af89d8d090f6b10273
X-Content-Type-Options: nosniff
{
  "data": {
    "hash": "md5:00000000000000000000000000000000", 
    "author": "lot_owner", 
    "title": "укр.doc", 
    "url": "http://localhost/get/0daf251e8f744e8a91b321e6e0861b93?KeyID=172d32c8&Signature=Fc9VACppAhMOnwBCVzVWlgz5wiYzYqSIgdj08J59LAvVnn6%2FRHO4uaf05ji1uZsayl5zJWnDsO902Vg7DY9nDA%253D%253D", 
    "format": "application/msword", 
    "documentOf": "lot", 
    "datePublished": "2019-03-12T13:28:57.221917+02:00", 
    "documentType": "cancellationDetails", 
    "dateModified": "2019-03-12T13:28:57.221982+02:00", 
    "id": "0ec306f01d3746af89d8d090f6b10273"
  }
}

So now lot can be easily deleted:

PATCH /api/2.5/lots/86f5b7cf26c4446ca23707c1ed405656?acc_token=7e25ecd2e7254c469bb16c87fb5adf51 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 39
Content-Type: application/json
Host: lb.api-sandbox.registry.ea2.openprocurement.net
DATA:
{
  "data": {
    "status": "pending.deleted"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending.deleted", 
    "lotHolder": {
      "identifier": {
        "scheme": "AE-ADCD", 
        "id": "11111-4"
      }, 
      "name": "Власник лоту"
    }, 
    "lotID": "UA-LR-DGF-2019-03-12-000002", 
    "description": "Нежитлове приміщення для збереження насіння", 
    "title": "Нежитлове приміщення", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "9a501623597642f2a58793bc6f2f2a48"
      }
    ], 
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        }, 
        "description": "футляри до державних нагород", 
        "classification": {
          "scheme": "CPV", 
          "description": "Description", 
          "id": "73110000-6"
        }, 
        "additionalClassifications": [
          {
            "scheme": "UA-EDR", 
            "description": "папір і картон гофровані, паперова й картонна тара", 
            "id": "111111-4"
          }
        ], 
        "address": {
          "countryName": "Ukraine"
        }, 
        "id": "0", 
        "unit": {
          "code": "code"
        }, 
        "quantity": 5.0001
      }
    ], 
    "lotType": "redemption", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:56.203380+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "8f5a2e677e4a49fda06c850aa0ea98ea", 
        "decisionOf": "lot"
      }, 
      {
        "relatedItem": "652ea7afe73d4e6bb05df61e11753fd9", 
        "decisionDate": "2019-03-12T13:28:56.853351+02:00", 
        "decisionID": "11111-4-5", 
        "id": "8f7291b82c6244e08bc12842c656d666", 
        "decisionOf": "asset"
      }
    ], 
    "dateModified": "2019-03-12T13:28:57.391852+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "contactPoint": {
        "name": "Сергій", 
        "email": "segiy@mail.com"
      }, 
      "identifier": {
        "scheme": "AE-ADCD", 
        "id": "11111-4"
      }, 
      "name": "Зберігач лоту", 
      "address": {
        "countryName": "Україна"
      }
    }, 
    "auctions": [
      {
        "status": "scheduled", 
        "bankAccount": {
          "accountIdentification": [
            {
              "scheme": "accountNumber", 
              "id": "111111-8", 
              "description": "some description"
            }
          ], 
          "bankName": "name of bank"
        }, 
        "procurementMethodType": "reporting", 
        "value": {
          "currency": "UAH", 
          "amount": 3000.87, 
          "valueAddedTaxIncluded": true
        }, 
        "id": "0253e7e2c9aa4d2c9c9cad1c38ddb88e", 
        "guarantee": {
          "currency": "UAH", 
          "amount": 700.87
        }
      }
    ], 
    "date": "2019-03-12T13:28:57.391507+02:00", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:56.286818+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:56.286854+02:00", 
        "id": "212eafc66f6d4ef3bd8aac70efc52354"
      }, 
      {
        "hash": "md5:00000000000000000000000000000000", 
        "author": "lot_owner", 
        "title": "укр.doc", 
        "url": "http://localhost/get/0daf251e8f744e8a91b321e6e0861b93?KeyID=172d32c8&Signature=Fc9VACppAhMOnwBCVzVWlgz5wiYzYqSIgdj08J59LAvVnn6%2FRHO4uaf05ji1uZsayl5zJWnDsO902Vg7DY9nDA%253D%253D", 
        "format": "application/msword", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:57.221917+02:00", 
        "documentType": "cancellationDetails", 
        "dateModified": "2019-03-12T13:28:57.221982+02:00", 
        "id": "0ec306f01d3746af89d8d090f6b10273"
      }
    ], 
    "relatedProcesses": [
      {
        "identifier": "UA-AR-P-2018-08-17-000002-1", 
        "type": "asset", 
        "id": "ed95cd7dfabd4f3da3818ae742d14c36", 
        "relatedProcessID": "b014dd89b9c94e30964a8ce6dcc68a91"
      }
    ], 
    "id": "86f5b7cf26c4446ca23707c1ed405656"
  }
}

Concierge operations

For lot to be formed, you need to specify id of the asset which is to be included in that lot. If this assets is available, it will be attached to lot and status of a lot itself will be changed to pending. The given lot becomes:

GET /api/2.5/lots/d27e2f7197bd45e8aebfe4f5dc3e3db2 HTTP/1.0
Authorization: Basic Y29uY2llcmdlOg==
Host: lb.api-sandbox.registry.ea2.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending", 
    "lotHolder": {
      "identifier": {
        "scheme": "AE-ADCD", 
        "id": "11111-4"
      }, 
      "name": "Власник лоту"
    }, 
    "lotID": "UA-LR-DGF-2019-03-12-000002", 
    "description": "Нежитлове приміщення для збереження насіння", 
    "title": "Нежитлове приміщення", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "eddda59bfe6e4316a41580e547da271f"
      }
    ], 
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        }, 
        "description": "футляри до державних нагород", 
        "classification": {
          "scheme": "CPV", 
          "description": "Description", 
          "id": "73110000-6"
        }, 
        "additionalClassifications": [
          {
            "scheme": "UA-EDR", 
            "description": "папір і картон гофровані, паперова й картонна тара", 
            "id": "111111-4"
          }
        ], 
        "address": {
          "countryName": "Ukraine"
        }, 
        "id": "0", 
        "unit": {
          "code": "code"
        }, 
        "quantity": 5.0001
      }
    ], 
    "lotType": "redemption", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:57.910939+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "457a3a9afd614e5695cb42127c0ab0bb", 
        "decisionOf": "lot"
      }, 
      {
        "relatedItem": "10e8427741c04083a58fe213ca6a7005", 
        "decisionDate": "2019-03-12T13:28:58.181645+02:00", 
        "decisionID": "11111-4-5", 
        "id": "51bf01fdf0e740d3a1467e26cd4aefe1", 
        "decisionOf": "asset"
      }
    ], 
    "dateModified": "2019-03-12T13:28:58.388932+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "contactPoint": {
        "name": "Сергій", 
        "email": "segiy@mail.com"
      }, 
      "identifier": {
        "scheme": "AE-ADCD", 
        "id": "11111-4"
      }, 
      "name": "Зберігач лоту", 
      "address": {
        "countryName": "Україна"
      }
    }, 
    "auctions": [
      {
        "status": "scheduled", 
        "bankAccount": {
          "accountIdentification": [
            {
              "scheme": "accountNumber", 
              "id": "111111-8", 
              "description": "some description"
            }
          ], 
          "bankName": "name of bank"
        }, 
        "procurementMethodType": "reporting", 
        "value": {
          "currency": "UAH", 
          "amount": 3000.87, 
          "valueAddedTaxIncluded": true
        }, 
        "id": "4108d6a55abd4c52a3323f56327f2d37", 
        "guarantee": {
          "currency": "UAH", 
          "amount": 700.87
        }
      }
    ], 
    "date": "2019-03-12T13:28:58.388596+02:00", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:57.915305+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:57.915325+02:00", 
        "id": "0ba040f4ec7243579270497975ba2152"
      }
    ], 
    "relatedProcesses": [
      {
        "identifier": "UA-AR-P-2018-08-17-000002-1", 
        "type": "asset", 
        "id": "57008d55778b44f99db68faab5c5c17a", 
        "relatedProcessID": "36483bc5df2a42c3aecba97e5b2d8387"
      }
    ], 
    "id": "d27e2f7197bd45e8aebfe4f5dc3e3db2"
  }
}

In case of this assets is unavailable, status of the current lot will turn to invalid The given lot becomes:

GET /api/2.5/lots/3def48a27483417ab51f7d8431f8b11a HTTP/1.0
Authorization: Basic Y29uY2llcmdlOg==
Host: lb.api-sandbox.registry.ea2.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "invalid", 
    "lotID": "UA-LR-DGF-2019-03-12-000001", 
    "contracts": [
      {
        "status": "scheduled", 
        "type": "yoke", 
        "id": "d253e1686aec4f94a626bd58a060a77a"
      }
    ], 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:57.486294+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "f8381939fe7b48259d02e3be71c08d5c", 
        "decisionOf": "lot"
      }, 
      {
        "relatedItem": "11111111111111111111111111111111", 
        "decisionDate": "2019-03-12T13:28:57.749143+02:00", 
        "decisionID": "decisionAssetID", 
        "id": "a52dc53311554f22a57e5443cce8e62d", 
        "decisionOf": "asset"
      }
    ], 
    "lotType": "redemption", 
    "dateModified": "2019-03-12T13:28:57.873564+02:00", 
    "owner": "broker", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:57.491799+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:57.491824+02:00", 
        "id": "7a4b1f971b0b4aa2a4b3fca3e6848946"
      }
    ], 
    "auctions": [
      {
        "status": "scheduled", 
        "bankAccount": {
          "accountIdentification": [
            {
              "scheme": "accountNumber", 
              "id": "111111-8", 
              "description": "some description"
            }
          ], 
          "bankName": "name of bank"
        }, 
        "procurementMethodType": "reporting", 
        "value": {
          "currency": "UAH", 
          "amount": 3000.87, 
          "valueAddedTaxIncluded": true
        }, 
        "id": "55e279b4447a424ca952cffffa355b46", 
        "guarantee": {
          "currency": "UAH", 
          "amount": 700.87
        }
      }
    ], 
    "date": "2019-03-12T13:28:57.873301+02:00", 
    "relatedProcesses": [
      {
        "type": "asset", 
        "id": "427ba4c528d44e41a69c0dafb253e05d", 
        "relatedProcessID": "e59cf6de07ea4220a9d2ed990df96b77"
      }
    ], 
    "id": "3def48a27483417ab51f7d8431f8b11a"
  }
}

When bot finds that status of lot is pending.deleted, it turns status of the asset being attached to that lot to pending. Status of the lot itself will become deleted. The given lot becomes:

GET /api/2.5/lots/d27e2f7197bd45e8aebfe4f5dc3e3db2 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: lb.api-sandbox.registry.ea2.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "deleted", 
    "lotHolder": {
      "identifier": {
        "scheme": "AE-ADCD", 
        "id": "11111-4"
      }, 
      "name": "Власник лоту"
    }, 
    "lotID": "UA-LR-DGF-2019-03-12-000002", 
    "description": "Нежитлове приміщення для збереження насіння", 
    "title": "Нежитлове приміщення", 
    "contracts": [
      {
        "status": "cancelled", 
        "type": "yoke", 
        "id": "eddda59bfe6e4316a41580e547da271f"
      }
    ], 
    "items": [
      {
        "registrationDetails": {
          "status": "unknown"
        }, 
        "description": "футляри до державних нагород", 
        "classification": {
          "scheme": "CPV", 
          "description": "Description", 
          "id": "73110000-6"
        }, 
        "additionalClassifications": [
          {
            "scheme": "UA-EDR", 
            "description": "папір і картон гофровані, паперова й картонна тара", 
            "id": "111111-4"
          }
        ], 
        "address": {
          "countryName": "Ukraine"
        }, 
        "id": "0", 
        "unit": {
          "code": "code"
        }, 
        "quantity": 5.0001
      }
    ], 
    "lotType": "redemption", 
    "decisions": [
      {
        "decisionDate": "2019-03-12T13:28:57.910939+02:00", 
        "decisionID": "initialDecisionID", 
        "id": "457a3a9afd614e5695cb42127c0ab0bb", 
        "decisionOf": "lot"
      }, 
      {
        "relatedItem": "10e8427741c04083a58fe213ca6a7005", 
        "decisionDate": "2019-03-12T13:28:58.181645+02:00", 
        "decisionID": "11111-4-5", 
        "id": "51bf01fdf0e740d3a1467e26cd4aefe1", 
        "decisionOf": "asset"
      }
    ], 
    "dateModified": "2019-03-12T13:28:58.712570+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "contactPoint": {
        "name": "Сергій", 
        "email": "segiy@mail.com"
      }, 
      "identifier": {
        "scheme": "AE-ADCD", 
        "id": "11111-4"
      }, 
      "name": "Зберігач лоту", 
      "address": {
        "countryName": "Україна"
      }
    }, 
    "auctions": [
      {
        "status": "cancelled", 
        "bankAccount": {
          "accountIdentification": [
            {
              "scheme": "accountNumber", 
              "id": "111111-8", 
              "description": "some description"
            }
          ], 
          "bankName": "name of bank"
        }, 
        "procurementMethodType": "reporting", 
        "value": {
          "currency": "UAH", 
          "amount": 3000.87, 
          "valueAddedTaxIncluded": true
        }, 
        "id": "4108d6a55abd4c52a3323f56327f2d37", 
        "guarantee": {
          "currency": "UAH", 
          "amount": 700.87
        }
      }
    ], 
    "date": "2019-03-12T13:28:58.712351+02:00", 
    "documents": [
      {
        "description": "Перелік та реквізити авторизованих електронних майданчиків (найменування установи банку, її адреса та номери рахунків, відкритих для внесення гарантійного внеску, реєстраційного внеску)", 
        "title": "Перелік та реквізити авторизованих електронних майданчиків", 
        "url": "https://prozorro.sale/info/elektronni-majdanchiki-ets-prozorroprodazhi-cbd2", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:57.915305+02:00", 
        "documentType": "x_PlatformLegalDetails", 
        "dateModified": "2019-03-12T13:28:57.915325+02:00", 
        "id": "0ba040f4ec7243579270497975ba2152"
      }, 
      {
        "hash": "md5:00000000000000000000000000000000", 
        "author": "lot_owner", 
        "title": "укр.doc", 
        "url": "http://localhost/get/d457ab53bbfd4b9886cddb76cc106a85?KeyID=172d32c8&Signature=7qZhVR0uxBOv1QVyjzVKP1UoWMo3MuYSkEERB%2FhTuuuFCDbzatmQ4qi5Blzj8MwtAA6SsnKnaKj11RKi4bddCA%253D%253D", 
        "format": "application/msword", 
        "documentOf": "lot", 
        "datePublished": "2019-03-12T13:28:58.462505+02:00", 
        "documentType": "cancellationDetails", 
        "dateModified": "2019-03-12T13:28:58.462528+02:00", 
        "id": "f2028d67694c4eddacb0faa8c0355903"
      }
    ], 
    "relatedProcesses": [
      {
        "identifier": "UA-AR-P-2018-08-17-000002-1", 
        "type": "asset", 
        "id": "57008d55778b44f99db68faab5c5c17a", 
        "relatedProcessID": "36483bc5df2a42c3aecba97e5b2d8387"
      }
    ], 
    "id": "d27e2f7197bd45e8aebfe4f5dc3e3db2"
  }
}