Tutorial

Exploring basic rules

Let’s try exploring the /tenders endpoint:

$ http http://api-sandbox.openprocurement.org/api/0/tenders
GET /api/0/tenders HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [],
    "next_page": {
        "offset": "2014-11-22T04:27:49.300971+02:00",
        "path": "/api/0/tenders?offset=2014-11-22T04%3A27%3A49.300971%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-11-22T04%3A27%3A49.300971%2B02%3A00"
    }
}

Just invoking it reveals empty set.

Now let’s attempt creating some tender:

$ http POST http://api-sandbox.openprocurement.org/api/0/tenders
POST /api/0/tenders HTTP/1.1



HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json; charset=UTF-8

{
    "errors": [
        {
            "description": "Content-Type header should be one of ['application/json']",
            "location": "header",
            "name": "Content-Type"
        }
    ],
    "status": "error"
}

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

Let’s satisfy the Content-type requirement:

$ http -j POST http://api-sandbox.openprocurement.org/api/0/tenders
POST /api/0/tenders HTTP/1.1
Content-Type: application/json; charset=utf-8



HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=UTF-8

{
    "errors": [
        {
            "description": "No JSON object could be decoded",
            "location": "body",
            "name": "data"
        }
    ],
    "status": "error"
}

Error states that no data found in JSON body.

Creating tender

Let’s provide the data attribute in the body submitted:

$ http -j POST http://api-sandbox.openprocurement.org/api/0/tenders data:={}
POST /api/0/tenders HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {}
}

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/ad41df97f2364911a27a7c744a8e3e62

{
    "data": {
        "dateModified": "2014-11-22T04:27:50.716220+02:00",
        "enquiryPeriod": {
            "startDate": "2014-11-22T04:27:50.716220+02:00"
        },
        "id": "ad41df97f2364911a27a7c744a8e3e62",
        "status": "enquiries",
        "tenderID": "UA-ad41df97f2364911a27a7c744a8e3e62"
    }
}

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

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

$ http http://api-sandbox.openprocurement.org/api/0/tenders/ad41df97f2364911a27a7c744a8e3e62
GET /api/0/tenders/ad41df97f2364911a27a7c744a8e3e62 HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": {
        "dateModified": "2014-11-22T04:27:50.716220+02:00",
        "enquiryPeriod": {
            "startDate": "2014-11-22T04:27:50.716220+02:00"
        },
        "id": "ad41df97f2364911a27a7c744a8e3e62",
        "status": "enquiries",
        "tenderID": "UA-ad41df97f2364911a27a7c744a8e3e62"
    }
}

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

Let’s see what listing of tenders reveals us:

$ http http://api-sandbox.openprocurement.org/api/0/tenders
GET /api/0/tenders HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "dateModified": "2014-11-22T04:27:50.716220+02:00",
            "id": "ad41df97f2364911a27a7c744a8e3e62"
        }
    ],
    "next_page": {
        "offset": "2014-11-22T04:27:51.565761+02:00",
        "path": "/api/0/tenders?offset=2014-11-22T04%3A27%3A51.565761%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-11-22T04%3A27%3A51.565761%2B02%3A00"
    }
}

We do see the internal id of a tender (that can be used to construct full URL by prepending http://api-sandbox.openprocurement.org/api/0/tenders/) and its modified datestamp.

Let’s try creating tender with more data, passing the procuringEntity of a tender:

$ http -j POST http://api-sandbox.openprocurement.org/api/0/tenders data:=@./school-tender.json
POST /api/0/tenders HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "procuringEntity": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21027",
                "region": "м. Вінниця",
                "streetAddress": "вул. Стахурського. 22"
            },
            "identifier": {
                "id": "21725150",
                "legalName": "Заклад \"Загальноосвітня школа І-ІІІ ступенів № 10 Вінницької міської ради\"",
                "scheme": "https://ns.openprocurement.org/ua/edrpou",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ЗОСШ #10 м.Вінниці"
        }
    }
}

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba

{
    "data": {
        "dateModified": "2014-11-22T04:27:52.011949+02:00",
        "enquiryPeriod": {
            "startDate": "2014-11-22T04:27:52.011949+02:00"
        },
        "id": "e1c4e54be2314868bab3ecfcf6241cba",
        "procuringEntity": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21027",
                "region": "м. Вінниця",
                "streetAddress": "вул. Стахурського. 22"
            },
            "identifier": {
                "id": "21725150",
                "legalName": "Заклад \"Загальноосвітня школа І-ІІІ ступенів № 10 Вінницької міської ради\"",
                "scheme": "https://ns.openprocurement.org/ua/edrpou",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ЗОСШ #10 м.Вінниці"
        },
        "status": "enquiries",
        "tenderID": "UA-e1c4e54be2314868bab3ecfcf6241cba"
    }
}

And again we have 201 Created response code, Location header and body wth extra id, tenderID, and modified properties.

Let’s check what tender registry contains:

$ http http://api-sandbox.openprocurement.org/api/0/tenders
GET /api/0/tenders HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "dateModified": "2014-11-22T04:27:50.716220+02:00",
            "id": "ad41df97f2364911a27a7c744a8e3e62"
        },
        {
            "dateModified": "2014-11-22T04:27:52.011949+02:00",
            "id": "e1c4e54be2314868bab3ecfcf6241cba"
        }
    ],
    "next_page": {
        "offset": "2014-11-22T04:27:52.454826+02:00",
        "path": "/api/0/tenders?offset=2014-11-22T04%3A27%3A52.454826%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-11-22T04%3A27%3A52.454826%2B02%3A00"
    }
}

And indeed we have 2 tenders now.

Modifying tender

Let’s update tender by providing it with all other essential properties:

$ http -j PATCH http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba data:=@./school-tender-patch.json
PATCH /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "enquiryPeriod": {
            "endDate": "2015-05-29T00:00:00"
        },
        "items": [
            {
                "additionalClassifications": [
                    {
                        "description": "Послуги шкільних їдалень",
                        "id": "55.51.10.300",
                        "scheme": "ДКПП"
                    }
                ],
                "classification": {
                    "description": "Послуги з харчування у школах",
                    "id": "55523100-3",
                    "scheme": "CPV"
                },
                "description": "Послуги шкільних їдалень",
                "quantity": 5,
                "unit": {
                    "name": "item"
                }
            }
        ],
        "minimalStep": {
            "amount": 35000,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        },
        "tenderPeriod": {
            "endDate": "2015-06-07T10:00:00",
            "startDate": "2014-11-03T00:00:00"
        },
        "value": {
            "amount": 500000,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": {
        "dateModified": "2014-11-22T04:27:52.922493+02:00",
        "enquiryPeriod": {
            "endDate": "2015-05-29T00:00:00+02:02",
            "startDate": "2014-11-22T04:27:52.011949+02:00"
        },
        "id": "e1c4e54be2314868bab3ecfcf6241cba",
        "items": [
            {
                "additionalClassifications": [
                    {
                        "description": "Послуги шкільних їдалень",
                        "id": "55.51.10.300",
                        "scheme": "ДКПП"
                    }
                ],
                "classification": {
                    "description": "Послуги з харчування у школах",
                    "id": "55523100-3",
                    "scheme": "CPV"
                },
                "description": "Послуги шкільних їдалень",
                "quantity": 5,
                "unit": {
                    "name": "item"
                }
            }
        ],
        "minimalStep": {
            "amount": 35000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        },
        "procuringEntity": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21027",
                "region": "м. Вінниця",
                "streetAddress": "вул. Стахурського. 22"
            },
            "identifier": {
                "id": "21725150",
                "legalName": "Заклад \"Загальноосвітня школа І-ІІІ ступенів № 10 Вінницької міської ради\"",
                "scheme": "https://ns.openprocurement.org/ua/edrpou",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ЗОСШ #10 м.Вінниці"
        },
        "status": "enquiries",
        "tenderID": "UA-e1c4e54be2314868bab3ecfcf6241cba",
        "tenderPeriod": {
            "endDate": "2015-06-07T10:00:00+02:02",
            "startDate": "2014-11-03T00:00:00+02:02"
        },
        "value": {
            "amount": 500000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

We see the added properies merged with existing data of tender. Additionally the modified property updated to reflect the last modification datestamp.

Checking the listing again reflects the new modification date:

$ http http://api-sandbox.openprocurement.org/api/0/tenders
GET /api/0/tenders HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "dateModified": "2014-11-22T04:27:50.716220+02:00",
            "id": "ad41df97f2364911a27a7c744a8e3e62"
        },
        {
            "dateModified": "2014-11-22T04:27:52.922493+02:00",
            "id": "e1c4e54be2314868bab3ecfcf6241cba"
        }
    ],
    "next_page": {
        "offset": "2014-11-22T04:27:53.431962+02:00",
        "path": "/api/0/tenders?offset=2014-11-22T04%3A27%3A53.431962%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-11-22T04%3A27%3A53.431962%2B02%3A00"
    }
}

Uploading documentation

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

$ http --form POST http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents file@./Notice.pdf
POST /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents HTTP/1.1
Content-Type: multipart/form-data; boundary=b6e42b4cecc747e7bbd27a5175c0f0e2



+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/7c98d9830fee4dcabc4e470afb9add7e

{
    "data": {
        "dateModified": "2014-11-22T04:27:54.268654+02:00",
        "datePublished": "2014-11-22T04:27:54.268610+02:00",
        "format": "text/plain",
        "id": "7c98d9830fee4dcabc4e470afb9add7e",
        "title": "Notice.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/7c98d9830fee4dcabc4e470afb9add7e?download=8d7b8ef98462408c9cb824c4168f3a5b"
    }
}

201 Created response code and Location header confirm document creation. We can additionally query the documents collection API endpoint to confirm the action:

$ http http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents
GET /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "dateModified": "2014-11-22T04:27:54.268654+02:00",
            "datePublished": "2014-11-22T04:27:54.268610+02:00",
            "format": "text/plain",
            "id": "7c98d9830fee4dcabc4e470afb9add7e",
            "title": "Notice.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/7c98d9830fee4dcabc4e470afb9add7e?download=8d7b8ef98462408c9cb824c4168f3a5b"
        }
    ]
}

The single array element describes the document uploaded. We can upload more documents:

$ http --form POST http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents file@./AwardCriteria.pdf
POST /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents HTTP/1.1
Content-Type: multipart/form-data; boundary=f126b3e5dc904f978e5c5ee0e7c96b4f



+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/31da6e5d23464cff9e5f016871865480

{
    "data": {
        "dateModified": "2014-11-22T04:27:55.536314+02:00",
        "datePublished": "2014-11-22T04:27:55.536271+02:00",
        "format": "text/plain",
        "id": "31da6e5d23464cff9e5f016871865480",
        "title": "AwardCriteria.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/31da6e5d23464cff9e5f016871865480?download=dd718ccc5033495b82e36d9efcef5882"
    }
}

And again we can confirm that there are two documents uploaded.

$ http http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents
GET /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "dateModified": "2014-11-22T04:27:54.268654+02:00",
            "datePublished": "2014-11-22T04:27:54.268610+02:00",
            "format": "text/plain",
            "id": "7c98d9830fee4dcabc4e470afb9add7e",
            "title": "Notice.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/7c98d9830fee4dcabc4e470afb9add7e?download=8d7b8ef98462408c9cb824c4168f3a5b"
        },
        {
            "dateModified": "2014-11-22T04:27:55.536314+02:00",
            "datePublished": "2014-11-22T04:27:55.536271+02:00",
            "format": "text/plain",
            "id": "31da6e5d23464cff9e5f016871865480",
            "title": "AwardCriteria.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/31da6e5d23464cff9e5f016871865480?download=dd718ccc5033495b82e36d9efcef5882"
        }
    ]
}

In case we made an error, we can reupload the document over the older version:

$ http --form PUT http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/31da6e5d23464cff9e5f016871865480 file@./AwardCriteria-v2.pdf
PUT /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/31da6e5d23464cff9e5f016871865480 HTTP/1.1
Content-Type: multipart/form-data; boundary=4f6245badbc141b0b6222c924e1969cc



+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": {
        "dateModified": "2014-11-22T04:27:56.815690+02:00",
        "datePublished": "2014-11-22T04:27:55.536271+02:00",
        "format": "text/plain",
        "id": "31da6e5d23464cff9e5f016871865480",
        "title": "AwardCriteria-v2.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/31da6e5d23464cff9e5f016871865480?download=d2a328be22e34034a80b644e76dda25f"
    }
}

And we can see that it is overriding the original version:

$ http http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents
GET /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "dateModified": "2014-11-22T04:27:54.268654+02:00",
            "datePublished": "2014-11-22T04:27:54.268610+02:00",
            "format": "text/plain",
            "id": "7c98d9830fee4dcabc4e470afb9add7e",
            "title": "Notice.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/7c98d9830fee4dcabc4e470afb9add7e?download=8d7b8ef98462408c9cb824c4168f3a5b"
        },
        {
            "dateModified": "2014-11-22T04:27:56.815690+02:00",
            "datePublished": "2014-11-22T04:27:55.536271+02:00",
            "format": "text/plain",
            "id": "31da6e5d23464cff9e5f016871865480",
            "title": "AwardCriteria-v2.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/documents/31da6e5d23464cff9e5f016871865480?download=d2a328be22e34034a80b644e76dda25f"
        }
    ]
}

Enquiries

When tender is in enquiry status, interested parties can ask questions:

$ http -j POST http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions data:=@./question.json
POST /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "author": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21100",
                "region": "м. Вінниця",
                "streetAddress": "вул. Островського, 33"
            },
            "contactPoint": {
                "email": "soleksuk@gmail.com",
                "name": "Сергій Олексюк",
                "telephone": "+380 (432) 21-69-30"
            },
            "identifier": {
                "id": "13313462",
                "legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
                "scheme": "https://ns.openprocurement.org/ua/edrpou",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ДКП «Школяр»"
        },
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "title": "Калорійність по місяцях"
    }
}

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/2356d267b21444368c0bd155f80b6b08

{
    "data": {
        "author": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21100",
                "region": "м. Вінниця",
                "streetAddress": "вул. Островського, 33"
            },
            "contactPoint": {
                "email": "soleksuk@gmail.com",
                "name": "Сергій Олексюк",
                "telephone": "+380 (432) 21-69-30"
            },
            "identifier": {
                "id": "13313462",
                "legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
                "scheme": "https://ns.openprocurement.org/ua/edrpou",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ДКП «Школяр»"
        },
        "date": "2014-11-22T04:27:57.785461+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "2356d267b21444368c0bd155f80b6b08",
        "title": "Калорійність по місяцях"
    }
}

Bidder is answering them:

$ http -j PATCH http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions/2356d267b21444368c0bd155f80b6b08 data:=@./answer.json
PATCH /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions/2356d267b21444368c0bd155f80b6b08 HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "answer": "Таблицю додано в файлі \"Kalorijnist.xslx\""
    }
}

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": {
        "answer": "Таблицю додано в файлі \"Kalorijnist.xslx\"",
        "author": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21100",
                "region": "м. Вінниця",
                "streetAddress": "вул. Островського, 33"
            },
            "contactPoint": {
                "email": "soleksuk@gmail.com",
                "name": "Сергій Олексюк",
                "telephone": "+380 (432) 21-69-30"
            },
            "identifier": {
                "id": "13313462",
                "legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
                "scheme": "https://ns.openprocurement.org/ua/edrpou",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ДКП «Школяр»"
        },
        "date": "2014-11-22T04:27:57.785461+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "2356d267b21444368c0bd155f80b6b08",
        "title": "Калорійність по місяцях"
    }
}

And one can retrieve the questions list:

$ http -j http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions
GET /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions HTTP/1.1
Content-Type: application/json; charset=utf-8



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "answer": "Таблицю додано в файлі \"Kalorijnist.xslx\"",
            "author": {
                "address": {
                    "countryName": "Україна",
                    "locality": "м. Вінниця",
                    "postalCode": "21100",
                    "region": "м. Вінниця",
                    "streetAddress": "вул. Островського, 33"
                },
                "contactPoint": {
                    "email": "soleksuk@gmail.com",
                    "name": "Сергій Олексюк",
                    "telephone": "+380 (432) 21-69-30"
                },
                "identifier": {
                    "id": "13313462",
                    "legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
                    "scheme": "https://ns.openprocurement.org/ua/edrpou",
                    "uri": "http://sch10.edu.vn.ua/"
                },
                "name": "ДКП «Школяр»"
            },
            "date": "2014-11-22T04:27:57.785461+02:00",
            "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
            "id": "2356d267b21444368c0bd155f80b6b08",
            "title": "Калорійність по місяцях"
        }
    ]
}

And individual answer:

$ http -j http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions/2356d267b21444368c0bd155f80b6b08
GET /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/questions/2356d267b21444368c0bd155f80b6b08 HTTP/1.1
Content-Type: application/json; charset=utf-8



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": {
        "answer": "Таблицю додано в файлі \"Kalorijnist.xslx\"",
        "author": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21100",
                "region": "м. Вінниця",
                "streetAddress": "вул. Островського, 33"
            },
            "contactPoint": {
                "email": "soleksuk@gmail.com",
                "name": "Сергій Олексюк",
                "telephone": "+380 (432) 21-69-30"
            },
            "identifier": {
                "id": "13313462",
                "legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
                "scheme": "https://ns.openprocurement.org/ua/edrpou",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ДКП «Школяр»"
        },
        "date": "2014-11-22T04:27:57.785461+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "2356d267b21444368c0bd155f80b6b08",
        "title": "Калорійність по місяцях"
    }
}

Registering bid

When Tender.tenderingPeriod.startDate comes Tender switches to tendering status that allows registration of bids.

Bidder can register a bid:

$ http -j POST http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids data:=@./catering-bid.json
POST /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "tenderers": [
            {
                "address": {
                    "countryName": "Україна",
                    "locality": "м. Вінниця",
                    "postalCode": "21100",
                    "region": "м. Вінниця",
                    "streetAddress": "вул. Островського, 33"
                },
                "contactPoint": {
                    "email": "soleksuk@gmail.com",
                    "name": "Сергій Олексюк",
                    "telephone": "+380 (432) 21-69-30"
                },
                "identifier": {
                    "id": "13313462",
                    "legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
                    "scheme": "https://ns.openprocurement.org/ua/edrpou",
                    "uri": "http://sch10.edu.vn.ua/"
                },
                "name": "ДКП «Школяр»"
            }
        ],
        "value": {
            "amount": 475000
        }
    }
}

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85

{
    "data": {
        "date": "2014-11-22T04:28:00.219641+02:00",
        "id": "991bfd3d936b43c4bd129b3a23c4fa85",
        "tenderers": [
            {
                "address": {
                    "countryName": "Україна",
                    "locality": "м. Вінниця",
                    "postalCode": "21100",
                    "region": "м. Вінниця",
                    "streetAddress": "вул. Островського, 33"
                },
                "contactPoint": {
                    "email": "soleksuk@gmail.com",
                    "name": "Сергій Олексюк",
                    "telephone": "+380 (432) 21-69-30"
                },
                "identifier": {
                    "id": "13313462",
                    "legalName": "Державне комунальне підприємство громадського харчування «Школяр»",
                    "scheme": "https://ns.openprocurement.org/ua/edrpou",
                    "uri": "http://sch10.edu.vn.ua/"
                },
                "name": "ДКП «Школяр»"
            }
        ],
        "value": {
            "amount": 475000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

And upload proposal document:

$ http --form POST http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85/documents file@./Proposal.pdf
POST /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85/documents HTTP/1.1
Content-Type: multipart/form-data; boundary=b1467df85eb346a89e83742d65e0560d



+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85/documents/619d3552bb984221a06977b00caa6388

{
    "data": {
        "dateModified": "2014-11-22T04:28:01.016428+02:00",
        "datePublished": "2014-11-22T04:28:01.016385+02:00",
        "format": "text/plain",
        "id": "619d3552bb984221a06977b00caa6388",
        "title": "Proposal.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85/documents/619d3552bb984221a06977b00caa6388?download=56d715375f374153be706e74c1b983b6"
    }
}

It is possible to check documents uploaded:

$ http http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85/documents
GET /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85/documents HTTP/1.1



HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
    "data": [
        {
            "dateModified": "2014-11-22T04:28:01.016428+02:00",
            "datePublished": "2014-11-22T04:28:01.016385+02:00",
            "format": "text/plain",
            "id": "619d3552bb984221a06977b00caa6388",
            "title": "Proposal.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/991bfd3d936b43c4bd129b3a23c4fa85/documents/619d3552bb984221a06977b00caa6388?download=56d715375f374153be706e74c1b983b6"
        }
    ]
}

For best effect (biggest economy) Tender should have multiple bidders registered:

$ http -j POST http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids data:=@./catering2-bid.json
POST /api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "tenderers": [
            {
                "address": {
                    "countryName": "Україна",
                    "locality": "м. Вінниця",
                    "postalCode": "21018",
                    "region": "м. Вінниця",
                    "streetAddress": "вул. Юності, 30"
                },
                "contactPoint": {
                    "email": "alla.myhailova@i.ua",
                    "name": "Алла Михайлова",
                    "telephone": "+380 (432) 460-665"
                },
                "identifier": {
                    "id": "13306232",
                    "legalName": "Державне комунальне підприємство громадського харчування «Меридіан»",
                    "scheme": "https://ns.openprocurement.org/ua/edrpou",
                    "uri": "http://sch10.edu.vn.ua/"
                },
                "name": "ДКП «Меридіан»"
            }
        ],
        "value": {
            "amount": 480000
        }
    }
}

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0/tenders/e1c4e54be2314868bab3ecfcf6241cba/bids/7e17d18c192846efbba1b61ee72d96a8

{
    "data": {
        "date": "2014-11-22T04:28:01.993786+02:00",
        "id": "7e17d18c192846efbba1b61ee72d96a8",
        "tenderers": [
            {
                "address": {
                    "countryName": "Україна",
                    "locality": "м. Вінниця",
                    "postalCode": "21018",
                    "region": "м. Вінниця",
                    "streetAddress": "вул. Юності, 30"
                },
                "contactPoint": {
                    "email": "alla.myhailova@i.ua",
                    "name": "Алла Михайлова",
                    "telephone": "+380 (432) 460-665"
                },
                "identifier": {
                    "id": "13306232",
                    "legalName": "Державне комунальне підприємство громадського харчування «Меридіан»",
                    "scheme": "https://ns.openprocurement.org/ua/edrpou",
                    "uri": "http://sch10.edu.vn.ua/"
                },
                "name": "ДКП «Меридіан»"
            }
        ],
        "value": {
            "amount": 480000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

Confirming qualification

Qualification comission registers its decision via following call:

$ http -j POST http://api-sandbox.openprocurement.org/api/0/tenders/d2d03d6abc5e49708e73b97236b61945/awards data:={"awardStatus":"pending"}
POST /api/0/tenders/d2d03d6abc5e49708e73b97236b61945/awards HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "awardStatus": "pending"
    }
}

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8

{
    "data": {
        "awardDate": "2014-11-18T14:06:41.505869+00:00",
        "awardID": "4bf007cb7e424ec09c71ccc809393e10",
        "awardStatus": "pending"
    }
}