Tutorial

Exploring basic rules

Let’s try exploring the /lots endpoint:

GET /api/0.1/lots?opt_pretty=1 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/0.1/lots?offset=", 
    "uri": "http://lb.api-sandbox.registry.ea.openprocurement.net/api/0.1/lots?offset=", 
    "offset": ""
  }, 
  "data": []
}

Just invoking it reveals empty set.

Now let’s attempt creating a lot:

POST /api/0.1/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.ea.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/0.1/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 4
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.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

Let’s create lot with the minimal (only required) data set:

POST /api/0.1/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1104
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "lotIdentifier": "Q81318b19827", 
    "lotCustodian": {
      "contactPoint": {
        "name": "Державне управління справами", 
        "telephone": "0440000000"
      }, 
      "identifier": {
        "scheme": "UA-EDR", 
        "id": "00037256", 
        "uri": "http://www.dus.gov.ua/"
      }, 
      "name": "Державне управління справами", 
      "address": {
        "countryName": "Україна", 
        "postalCode": "01220", 
        "region": "м. Київ", 
        "streetAddress": "вул. Банкова, 11, корпус 1", 
        "locality": "м. Київ"
      }
    }, 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ], 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "description": "Щось там тестове"
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea.openprocurement.net/api/0.1/lots/f0c5e8decc17498cabe79808ee889cc3
X-Content-Type-Options: nosniff
{
  "access": {
    "token": "5b2eae27ea3a41cfa4197fab969a0859"
  }, 
  "data": {
    "status": "draft", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000001", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:03.426524+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:03.424179+02:00", 
    "id": "f0c5e8decc17498cabe79808ee889cc3", 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ]
  }
}
PATCH /api/0.1/lots/f0c5e8decc17498cabe79808ee889cc3?acc_token=5b2eae27ea3a41cfa4197fab969a0859 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 31
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "pending"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000001", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:03.473538+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:03.473361+02:00", 
    "id": "f0c5e8decc17498cabe79808ee889cc3", 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ]
  }
}
PATCH /api/0.1/lots/f0c5e8decc17498cabe79808ee889cc3?acc_token=5b2eae27ea3a41cfa4197fab969a0859 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 36
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "verification"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "verification", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000001", 
    "description": "Змінений опис тестового лоту", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:03.566111+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:03.565938+02:00", 
    "id": "f0c5e8decc17498cabe79808ee889cc3", 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ]
  }
}

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 lot: its internal id (that matches the Location segment), its official lotID and dateModified datestamp stating the moment in time when lot was last modified. Pay attention to the lotType. Note that lot is created with verification 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.

GET /api/0.1/lots?opt_pretty=1 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/0.1/lots?offset=2018-01-15T15%3A33%3A03.512434%2B02%3A00", 
    "uri": "http://lb.api-sandbox.registry.ea.openprocurement.net/api/0.1/lots?offset=2018-01-15T15%3A33%3A03.512434%2B02%3A00", 
    "offset": "2018-01-15T15:33:03.512434+02:00"
  }, 
  "data": [
    {
      "id": "f0c5e8decc17498cabe79808ee889cc3", 
      "dateModified": "2018-01-15T15:33:03.512434+02:00"
    }
  ]
}

Let’s see what listing of lots reveals us:

We do see the internal id of the lot (that can be used to construct full URL by prepending https://lb.api-sandbox.registry.ea.openprocurement.net/api/0.1/lots/) and its dateModified datestamp.

The previous lot contained only required fields. Let’s try creating lot with more data (lot has status created):

POST /api/0.1/lots?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1104
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "lotIdentifier": "Q81318b19827", 
    "lotCustodian": {
      "contactPoint": {
        "name": "Державне управління справами", 
        "telephone": "0440000000"
      }, 
      "identifier": {
        "scheme": "UA-EDR", 
        "id": "00037256", 
        "uri": "http://www.dus.gov.ua/"
      }, 
      "name": "Державне управління справами", 
      "address": {
        "countryName": "Україна", 
        "postalCode": "01220", 
        "region": "м. Київ", 
        "streetAddress": "вул. Банкова, 11, корпус 1", 
        "locality": "м. Київ"
      }
    }, 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ], 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "description": "Щось там тестове"
  }
}

Response: 201 Created
Content-Type: application/json
Location: http://lb.api-sandbox.registry.ea.openprocurement.net/api/0.1/lots/462705149c174132b41d723ac081a816
X-Content-Type-Options: nosniff
{
  "access": {
    "token": "f48bb882fb7e49e9b629053657581259"
  }, 
  "data": {
    "status": "draft", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000002", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:03.614369+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:03.612730+02:00", 
    "id": "462705149c174132b41d723ac081a816", 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ]
  }
}
PATCH /api/0.1/lots/462705149c174132b41d723ac081a816?acc_token=f48bb882fb7e49e9b629053657581259 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 31
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "pending"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000002", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:03.644639+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:03.644468+02:00", 
    "id": "462705149c174132b41d723ac081a816", 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ]
  }
}
PATCH /api/0.1/lots/df82d57c54b84ff6a78bdc9a727859f6?acc_token=61630dbc933a42bc84ada62b3c712ce7 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 43
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "pending.dissolution"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending.dissolution", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000003", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.148178+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.148017+02:00", 
    "id": "df82d57c54b84ff6a78bdc9a727859f6", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

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

Let’s check what lot registry contains:

GET /api/0.1/lots?opt_pretty=1 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/0.1/lots?offset=2018-01-15T15%3A33%3A03.566111%2B02%3A00", 
    "uri": "http://lb.api-sandbox.registry.ea.openprocurement.net/api/0.1/lots?offset=2018-01-15T15%3A33%3A03.566111%2B02%3A00", 
    "offset": "2018-01-15T15:33:03.566111+02:00"
  }, 
  "data": [
    {
      "id": "f0c5e8decc17498cabe79808ee889cc3", 
      "dateModified": "2018-01-15T15:33:03.566111+02:00"
    }
  ]
}

And indeed we have 2 lots now.

Assume that we have lot in active.salable status and we want to modify this lot. For such purposes recomposed status exists.

PATCH /api/0.1/lots/34b371dc3b8f47a0869a8cac45be1181?acc_token=9791acb0d26647c48dd0a2570b7b53e3 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 34
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "recomposed"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "recomposed", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000005", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.952634+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.952462+02:00", 
    "id": "34b371dc3b8f47a0869a8cac45be1181", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

After some checks have been done, lot status will be switched to pending automatically.

Modifying Lot

Let’s update lot description:

PATCH /api/0.1/lots/f0c5e8decc17498cabe79808ee889cc3?acc_token=5b2eae27ea3a41cfa4197fab969a0859 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 182
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "description": "Змінений опис тестового лоту"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000001", 
    "description": "Змінений опис тестового лоту", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:03.512434+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:03.473361+02:00", 
    "id": "f0c5e8decc17498cabe79808ee889cc3", 
    "assets": [
      "b49f767133cb4d0bbcfd9c404ece8b01"
    ]
  }
}

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

Checking the listing again reflects the new modification date:

GET /api/0.1/lots?opt_pretty=1 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/0.1/lots?offset=", 
    "uri": "http://lb.api-sandbox.registry.ea.openprocurement.net/api/0.1/lots?offset=", 
    "offset": ""
  }, 
  "data": []
}

Deleting Lot

Let’s delete lot:

Integration with assets

Concierge operations

For lot to be formed, you need to specify some id of the assets to be included in that lot. If all of the assets are available, they will be attached to lot and status will be changed to active.salable:

GET /api/0.1/lots/df82d57c54b84ff6a78bdc9a727859f6 HTTP/1.0
Authorization: Basic Y29uY2llcmdlOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.salable", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000003", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.100775+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.100596+02:00", 
    "id": "df82d57c54b84ff6a78bdc9a727859f6", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

In case of at least one of the assets is unavailable (e.g. it has already been attached to another lot), status of the current one will be turned to pending:

GET /api/0.1/lots/f1f4c4b5df334cf087215b7e2f29e113 HTTP/1.0
Authorization: Basic Y29uY2llcmdlOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000004", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.333455+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.333259+02:00", 
    "id": "f1f4c4b5df334cf087215b7e2f29e113", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

When bot finds that status of lot is pending.dissolution, it turns status of the assets being attached to that lot to pending. Status of the lot itself will become dissolved.

PATCH /api/0.1/lots/df82d57c54b84ff6a78bdc9a727859f6 HTTP/1.0
Authorization: Basic Y29uY2llcmdlOg==
Content-Length: 33
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "dissolved"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "dissolved", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000003", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.184140+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.183968+02:00", 
    "id": "df82d57c54b84ff6a78bdc9a727859f6", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

When bot finds that status of lot is recomposed, it turns status of the assets being attached to that lot to pending. Status of the lot itself becomes pending as well.

PATCH /api/0.1/lots/34b371dc3b8f47a0869a8cac45be1181 HTTP/1.0
Authorization: Basic Y29uY2llcmdlOg==
Content-Length: 31
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
  "data": {
    "status": "pending"
  }
}

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000005", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.990049+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.989886+02:00", 
    "id": "34b371dc3b8f47a0869a8cac45be1181", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

When bot finds that status of lot is pending.sold, it turns status of the assets being attached to that lot to complete. Status of the lot itself turns to sold.

GET /api/0.1/lots/f1f4c4b5df334cf087215b7e2f29e113 HTTP/1.0
Authorization: Basic Y29uY2llcmdlOg==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "sold", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000004", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.733583+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.733416+02:00", 
    "id": "f1f4c4b5df334cf087215b7e2f29e113", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

Convoy operations

When lot is finally formed (active.salable) it can be used in the procedure within CDB. For this to be done, you need to specify lot id. By doing this, you will find the merchandisingObject field with the current lot id in the created procedure and id of the auction within which it is going to be sold. Status of the lot used will be automatically changed to active.awaiting in RDB. This indicates that Organizer is creating some auction with this lot within CDB, so it is currently unavailable for usage.

GET /api/0.1/lots/f1f4c4b5df334cf087215b7e2f29e113 HTTP/1.0
Authorization: Basic Y29udm95Og==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.awaiting", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000004", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.471010+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.470846+02:00", 
    "id": "f1f4c4b5df334cf087215b7e2f29e113", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

When the procedure is successfully created, lot status will be changed to active.auction:

GET /api/0.1/lots/f1f4c4b5df334cf087215b7e2f29e113 HTTP/1.0
Authorization: Basic Y29udm95Og==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.auction", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000004", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.620778+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.620586+02:00", 
    "id": "f1f4c4b5df334cf087215b7e2f29e113", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

After lot has been sold in the auction, its status is turned to pending.sold within RDB:

GET /api/0.1/lots/f1f4c4b5df334cf087215b7e2f29e113 HTTP/1.0
Authorization: Basic Y29udm95Og==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "pending.sold", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000004", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.678385+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.678224+02:00", 
    "id": "f1f4c4b5df334cf087215b7e2f29e113", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}

In case of that lot has not been sold, its status will be changed to active.salable in RDB:

GET /api/0.1/lots/f1f4c4b5df334cf087215b7e2f29e113 HTTP/1.0
Authorization: Basic Y29udm95Og==
Host: lb.api-sandbox.registry.ea.openprocurement.net

Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
  "data": {
    "status": "active.salable", 
    "lotIdentifier": "Q81318b19827", 
    "lotID": "UA-LR-DGF-2018-01-15-000004", 
    "description": "Щось там тестове", 
    "title": "Тестовий лот", 
    "lotType": "basic", 
    "dateModified": "2018-01-15T15:33:04.521993+02:00", 
    "owner": "broker", 
    "lotCustodian": {
      "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": "м. Київ"
      }
    }, 
    "date": "2018-01-15T15:33:04.521820+02:00", 
    "id": "f1f4c4b5df334cf087215b7e2f29e113", 
    "assets": [
      "d7017f6e2c474d4fa8b25f8363b45d70"
    ]
  }
}