Tutorial

Exploring basic rules

Let’s try exploring the /tenders endpoint:

$ http https://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-12-01T17:39:19.104103+02:00",
        "path": "/api/0/tenders?offset=2014-12-01T17%3A39%3A19.104103%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-12-01T17%3A39%3A19.104103%2B02%3A00"
    }
}

Just invoking it reveals empty set.

Now let’s attempt creating some tender:

$ http POST https://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 https://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 https://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/779630aecd87417097dcfb48871b6990

{
    "access": {
        "token": "8f36838c54af4d79bf33cf00915926d1"
    },
    "data": {
        "dateModified": "2014-12-01T17:39:21.504836+02:00",
        "enquiryPeriod": {
            "startDate": "2014-12-01T17:39:21.504836+02:00"
        },
        "id": "779630aecd87417097dcfb48871b6990",
        "status": "active.enquiries",
        "tenderID": "UA-779630aecd87417097dcfb48871b6990"
    }
}

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 active.enquiries status.

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

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



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

{
    "data": {
        "dateModified": "2014-12-01T17:39:21.504836+02:00",
        "enquiryPeriod": {
            "startDate": "2014-12-01T17:39:21.504836+02:00"
        },
        "id": "779630aecd87417097dcfb48871b6990",
        "status": "active.enquiries",
        "tenderID": "UA-779630aecd87417097dcfb48871b6990"
    }
}

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

Let’s see what listing of tenders reveals us:

$ http https://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-12-01T17:39:23.440187+02:00",
            "id": "779630aecd87417097dcfb48871b6990"
        }
    ],
    "next_page": {
        "offset": "2014-12-01T17:39:24.322407+02:00",
        "path": "/api/0/tenders?offset=2014-12-01T17%3A39%3A24.322407%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-12-01T17%3A39%3A24.322407%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 https://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/327c00d16cff4c37be5bd4915cdff8a3

{
    "access": {
        "token": "4668a63ccfd443e8b848e856952e9a2b"
    },
    "data": {
        "dateModified": "2014-12-01T17:39:25.289180+02:00",
        "enquiryPeriod": {
            "startDate": "2014-12-01T17:39:25.289180+02:00"
        },
        "id": "327c00d16cff4c37be5bd4915cdff8a3",
        "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": "active.enquiries",
        "tenderID": "UA-327c00d16cff4c37be5bd4915cdff8a3"
    }
}

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 https://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-12-01T17:39:23.440187+02:00",
            "id": "779630aecd87417097dcfb48871b6990"
        },
        {
            "dateModified": "2014-12-01T17:39:25.289180+02:00",
            "id": "327c00d16cff4c37be5bd4915cdff8a3"
        }
    ],
    "next_page": {
        "offset": "2014-12-01T17:39:26.138720+02:00",
        "path": "/api/0/tenders?offset=2014-12-01T17%3A39%3A26.138720%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-12-01T17%3A39%3A26.138720%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 https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3 data:=@./school-tender-patch.json
PATCH /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3 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-12-01T17:39:26.929784+02:00",
        "enquiryPeriod": {
            "endDate": "2015-05-29T00:00:00+02:02",
            "startDate": "2014-12-01T17:39:25.289180+02:00"
        },
        "id": "327c00d16cff4c37be5bd4915cdff8a3",
        "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": "active.enquiries",
        "tenderID": "UA-327c00d16cff4c37be5bd4915cdff8a3",
        "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 https://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-12-01T17:39:23.440187+02:00",
            "id": "779630aecd87417097dcfb48871b6990"
        },
        {
            "dateModified": "2014-12-01T17:39:26.929784+02:00",
            "id": "327c00d16cff4c37be5bd4915cdff8a3"
        }
    ],
    "next_page": {
        "offset": "2014-12-01T17:39:27.728690+02:00",
        "path": "/api/0/tenders?offset=2014-12-01T17%3A39%3A27.728690%2B02%3A00",
        "uri": "http://api-sandbox.openprocurement.org/api/0/tenders?offset=2014-12-01T17%3A39%3A27.728690%2B02%3A00"
    }
}

Uploading documentation

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

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



+-----------------------------------------+
| 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/327c00d16cff4c37be5bd4915cdff8a3/documents/86b33019f2174f37b5d715c924ae6cd4

{
    "data": {
        "dateModified": "2014-12-01T17:39:29.001262+02:00",
        "datePublished": "2014-12-01T17:39:29.001218+02:00",
        "format": "text/plain",
        "id": "86b33019f2174f37b5d715c924ae6cd4",
        "title": "Notice.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/86b33019f2174f37b5d715c924ae6cd4?download=d0267f352f384acca5081a04347fd64d"
    }
}

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

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



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

{
    "data": [
        {
            "dateModified": "2014-12-01T17:39:29.001262+02:00",
            "datePublished": "2014-12-01T17:39:29.001218+02:00",
            "format": "text/plain",
            "id": "86b33019f2174f37b5d715c924ae6cd4",
            "title": "Notice.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/86b33019f2174f37b5d715c924ae6cd4?download=d0267f352f384acca5081a04347fd64d"
        }
    ]
}

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

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



+-----------------------------------------+
| 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/327c00d16cff4c37be5bd4915cdff8a3/documents/4b65c046be264da4a430823d4376a757

{
    "data": {
        "dateModified": "2014-12-01T17:39:31.443132+02:00",
        "datePublished": "2014-12-01T17:39:31.443089+02:00",
        "format": "text/plain",
        "id": "4b65c046be264da4a430823d4376a757",
        "title": "AwardCriteria.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/4b65c046be264da4a430823d4376a757?download=d0ef7d53169041ed8093172c6ba6870c"
    }
}

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

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



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

{
    "data": [
        {
            "dateModified": "2014-12-01T17:39:29.001262+02:00",
            "datePublished": "2014-12-01T17:39:29.001218+02:00",
            "format": "text/plain",
            "id": "86b33019f2174f37b5d715c924ae6cd4",
            "title": "Notice.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/86b33019f2174f37b5d715c924ae6cd4?download=d0267f352f384acca5081a04347fd64d"
        },
        {
            "dateModified": "2014-12-01T17:39:31.443132+02:00",
            "datePublished": "2014-12-01T17:39:31.443089+02:00",
            "format": "text/plain",
            "id": "4b65c046be264da4a430823d4376a757",
            "title": "AwardCriteria.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/4b65c046be264da4a430823d4376a757?download=d0ef7d53169041ed8093172c6ba6870c"
        }
    ]
}

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

$ http --form PUT https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/4b65c046be264da4a430823d4376a757 file@./AwardCriteria-v2.pdf
PUT /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/4b65c046be264da4a430823d4376a757 HTTP/1.1
Content-Type: multipart/form-data; boundary=fdb76865e76a4140994502a017fd6e14



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

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

{
    "data": {
        "dateModified": "2014-12-01T17:39:33.717002+02:00",
        "datePublished": "2014-12-01T17:39:31.443089+02:00",
        "format": "text/plain",
        "id": "4b65c046be264da4a430823d4376a757",
        "title": "AwardCriteria-v2.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/4b65c046be264da4a430823d4376a757?download=e8300d4763ff4968aef4c71b4e15a297"
    }
}

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

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



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

{
    "data": [
        {
            "dateModified": "2014-12-01T17:39:29.001262+02:00",
            "datePublished": "2014-12-01T17:39:29.001218+02:00",
            "format": "text/plain",
            "id": "86b33019f2174f37b5d715c924ae6cd4",
            "title": "Notice.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/86b33019f2174f37b5d715c924ae6cd4?download=d0267f352f384acca5081a04347fd64d"
        },
        {
            "dateModified": "2014-12-01T17:39:33.717002+02:00",
            "datePublished": "2014-12-01T17:39:31.443089+02:00",
            "format": "text/plain",
            "id": "4b65c046be264da4a430823d4376a757",
            "title": "AwardCriteria-v2.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/documents/4b65c046be264da4a430823d4376a757?download=e8300d4763ff4968aef4c71b4e15a297"
        }
    ]
}

Enquiries

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

$ http -j POST https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/questions data:=@./question.json
POST /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/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/327c00d16cff4c37be5bd4915cdff8a3/questions/74fb1c83ec7549e0abd7284e05287b8b

{
    "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-12-01T17:39:35.616161+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "74fb1c83ec7549e0abd7284e05287b8b",
        "title": "Калорійність по місяцях"
    }
}

Bidder is answering them:

$ http -j PATCH https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/questions/74fb1c83ec7549e0abd7284e05287b8b data:=@./answer.json
PATCH /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/questions/74fb1c83ec7549e0abd7284e05287b8b 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\"",
        "date": "2014-12-01T17:39:35.616161+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "74fb1c83ec7549e0abd7284e05287b8b",
        "title": "Калорійність по місяцях"
    }
}

And one can retrieve the questions list:

$ http -j https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/questions
GET /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/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\"",
            "date": "2014-12-01T17:39:35.616161+02:00",
            "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
            "id": "74fb1c83ec7549e0abd7284e05287b8b",
            "title": "Калорійність по місяцях"
        }
    ]
}

And individual answer:

$ http -j https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/questions/74fb1c83ec7549e0abd7284e05287b8b
GET /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/questions/74fb1c83ec7549e0abd7284e05287b8b 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\"",
        "date": "2014-12-01T17:39:35.616161+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "74fb1c83ec7549e0abd7284e05287b8b",
        "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 https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids data:=@./catering-bid.json
POST /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/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/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390

{
    "data": {
        "date": "2014-12-01T17:39:39.940339+02:00",
        "id": "9b2c1ec83e1646edb2ce6056d653d390",
        "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 https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390/documents file@./Proposal.pdf
POST /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390/documents HTTP/1.1
Content-Type: multipart/form-data; boundary=77f84476a6c44bceb5d66b90b906ed1e



+-----------------------------------------+
| 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/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390/documents/316aecfb5cd9407ebc2ae980d86812d8

{
    "data": {
        "dateModified": "2014-12-01T17:39:41.114476+02:00",
        "datePublished": "2014-12-01T17:39:41.114422+02:00",
        "format": "text/plain",
        "id": "316aecfb5cd9407ebc2ae980d86812d8",
        "title": "Proposal.pdf",
        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390/documents/316aecfb5cd9407ebc2ae980d86812d8?download=efad340688de454486f267f8575477dc"
    }
}

It is possible to check documents uploaded:

$ http https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390/documents
GET /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390/documents HTTP/1.1



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

{
    "data": [
        {
            "dateModified": "2014-12-01T17:39:41.114476+02:00",
            "datePublished": "2014-12-01T17:39:41.114422+02:00",
            "format": "text/plain",
            "id": "316aecfb5cd9407ebc2ae980d86812d8",
            "title": "Proposal.pdf",
            "url": "http://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids/9b2c1ec83e1646edb2ce6056d653d390/documents/316aecfb5cd9407ebc2ae980d86812d8?download=efad340688de454486f267f8575477dc"
        }
    ]
}

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

$ http -j POST https://api-sandbox.openprocurement.org/api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/bids data:=@./catering2-bid.json
POST /api/0/tenders/327c00d16cff4c37be5bd4915cdff8a3/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/327c00d16cff4c37be5bd4915cdff8a3/bids/007f0144404c47829ba5b0a5eb9b9f17

{
    "data": {
        "date": "2014-12-01T17:39:42.828066+02:00",
        "id": "007f0144404c47829ba5b0a5eb9b9f17",
        "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"
    }
}

Canceling tender

Tender creator can cancel tender anytime:

$ http -j PATCH https://api-sandbox.openprocurement.org/api/0/tenders/779630aecd87417097dcfb48871b6990 data:={"status":"cancelled"}
PATCH /api/0/tenders/779630aecd87417097dcfb48871b6990 HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "data": {
        "status": "cancelled"
    }
}

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

{
    "data": {
        "dateModified": "2014-12-01T17:39:23.440187+02:00",
        "enquiryPeriod": {
            "startDate": "2014-12-01T17:39:21.504836+02:00"
        },
        "id": "779630aecd87417097dcfb48871b6990",
        "status": "cancelled",
        "tenderID": "UA-779630aecd87417097dcfb48871b6990"
    }
}