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 dateModified 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 dateModified datestamp.

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

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

{
    "data": {
        "enquiryPeriod": {
            "endDate": "2015-12-01"
        },
        "items": [
            {
                "description": "Послуги шкільних їдалень"
            }
        ],
        "minimalStep": {
            "amount": 35000,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        },
        "procuringEntity": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21027",
                "region": "м. Вінниця",
                "streetAddress": "вул. Стахурського. 22"
            },
            "contactPoint": {
                "name": "Куца Світлана Валентинівна",
                "telephone": "+380 (432) 46-53-02",
                "url": "http://sch10.edu.vn.ua/"
            },
            "identifier": {
                "id": "21725150",
                "legalName": "Заклад \"Загальноосвітня школа І-ІІІ ступенів № 10 Вінницької міської ради\"",
                "scheme": "UA-EDR"
            },
            "name": "ЗОСШ #10 м.Вінниці"
        },
        "tenderPeriod": {
            "endDate": "2015-12-10"
        },
        "value": {
            "amount": 500000,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

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

{
    "access": {
        "token": "953613dd25d6421588b2597504b747ed"
    },
    "data": {
        "dateModified": "2014-12-26T21:30:56.586789+02:00",
        "enquiryPeriod": {
            "endDate": "2015-12-01T00:00:00+02:00",
            "startDate": "2014-12-26T21:30:56.522694+02:00"
        },
        "id": "166b4a36611047a492d85c3693b86b4e",
        "items": [
            {
                "description": "Послуги шкільних їдалень"
            }
        ],
        "minimalStep": {
            "amount": 35000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        },
        "owner": "broker",
        "procuringEntity": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21027",
                "region": "м. Вінниця",
                "streetAddress": "вул. Стахурського. 22"
            },
            "contactPoint": {
                "name": "Куца Світлана Валентинівна",
                "telephone": "+380 (432) 46-53-02",
                "url": "http://sch10.edu.vn.ua/"
            },
            "identifier": {
                "id": "21725150",
                "legalName": "Заклад \"Загальноосвітня школа І-ІІІ ступенів № 10 Вінницької міської ради\"",
                "scheme": "UA-EDR"
            },
            "name": "ЗОСШ #10 м.Вінниці"
        },
        "status": "active.enquiries",
        "tenderID": "UA-2014-12-26-000050",
        "tenderPeriod": {
            "endDate": "2015-12-10T00:00:00+02:00",
            "startDate": "2015-12-01T00:00:00+02:00"
        },
        "value": {
            "amount": 500000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

And again we have 201 Created response code, Location header and body wth extra id, tenderID, and dateModified 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 --auth broker: -j PATCH https://api-sandbox.openprocurement.org/api/0/tenders/166b4a36611047a492d85c3693b86b4e?acc_token=953613dd25d6421588b2597504b747ed data:=@./school-tender-patch.json
PATCH /api/0/tenders/166b4a36611047a492d85c3693b86b4e?acc_token=953613dd25d6421588b2597504b747ed HTTP/1.1
Authorization: Basic YnJva2VyOg==
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": 9,
                "unit": {
                    "code": "MON",
                    "name": "month"
                }
            }
        ],
        "minimalStep": {
            "amount": 35000,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        },
        "tenderPeriod": {
            "endDate": "2015-06-07T10:00:00",
            "startDate": "2015-05-29T00: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-26T21:30:58.424362+02:00",
        "enquiryPeriod": {
            "endDate": "2015-05-29T00:00:00+02:00",
            "startDate": "2014-12-26T21:30:56.522694+02:00"
        },
        "id": "166b4a36611047a492d85c3693b86b4e",
        "items": [
            {
                "additionalClassifications": [
                    {
                        "description": "Послуги шкільних їдалень",
                        "id": "55.51.10.300",
                        "scheme": "ДКПП"
                    }
                ],
                "classification": {
                    "description": "Послуги з харчування у школах",
                    "id": "55523100-3",
                    "scheme": "CPV"
                },
                "description": "Послуги шкільних їдалень",
                "quantity": 9,
                "unit": {
                    "code": "MON",
                    "name": "month"
                }
            }
        ],
        "minimalStep": {
            "amount": 35000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        },
        "owner": "broker",
        "procuringEntity": {
            "address": {
                "countryName": "Україна",
                "locality": "м. Вінниця",
                "postalCode": "21027",
                "region": "м. Вінниця",
                "streetAddress": "вул. Стахурського. 22"
            },
            "contactPoint": {
                "name": "Куца Світлана Валентинівна",
                "telephone": "+380 (432) 46-53-02",
                "url": "http://sch10.edu.vn.ua/"
            },
            "identifier": {
                "id": "21725150",
                "legalName": "Заклад \"Загальноосвітня школа І-ІІІ ступенів № 10 Вінницької міської ради\"",
                "scheme": "UA-EDR"
            },
            "name": "ЗОСШ #10 м.Вінниці"
        },
        "status": "active.enquiries",
        "tenderID": "UA-2014-12-26-000050",
        "tenderPeriod": {
            "endDate": "2015-06-07T10:00:00+02:00",
            "startDate": "2015-05-29T00:00:00+02:00"
        },
        "value": {
            "amount": 500000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

We see the added properies merged with existing data of tender. Additionally the dateModified 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 --auth broker: -j POST https://api-sandbox.openprocurement.org/api/0/tenders/9b791af414c64892bb9b1f41e91a84af/questions data:=@./question.json
POST /api/0/tenders/9b791af414c64892bb9b1f41e91a84af/questions HTTP/1.1
Authorization: Basic YnJva2VyOg==
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": "UA-EDR",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ДКП «Школяр»"
        },
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "title": "Калорійність по місяцях"
    }
}

HTTP/1.1 201 Created
Content-Type: application/json; charset=UTF-8
Location: https://api-sandbox.openprocurement.org/api/0/tenders/9b791af414c64892bb9b1f41e91a84af/questions/3dfbb32cc2f44f75bfe5b44a3a0c287c

{
    "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": "UA-EDR",
                "uri": "http://sch10.edu.vn.ua/"
            },
            "name": "ДКП «Школяр»"
        },
        "date": "2014-12-26T23:43:08.277770+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "3dfbb32cc2f44f75bfe5b44a3a0c287c",
        "title": "Калорійність по місяцях"
    }
}

Bidder is answering them:

$ http --auth broker: -j PATCH https://api-sandbox.openprocurement.org/api/0/tenders/9b791af414c64892bb9b1f41e91a84af/questions/3dfbb32cc2f44f75bfe5b44a3a0c287c?acc_token=7face74d65fe4d37ba752aac8f409a0c data:=@./answer.json
PATCH /api/0/tenders/9b791af414c64892bb9b1f41e91a84af/questions/3dfbb32cc2f44f75bfe5b44a3a0c287c?acc_token=7face74d65fe4d37ba752aac8f409a0c HTTP/1.1
Authorization: Basic YnJva2VyOg==
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-26T23:43:08.277770+02:00",
        "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
        "id": "3dfbb32cc2f44f75bfe5b44a3a0c287c",
        "title": "Калорійність по місяцях"
    }
}

And one can retrieve the questions list:

$ http -j https://api-sandbox.openprocurement.org/api/0/tenders/17f405f826424ae4949e98ff915412c9/questions
GET /api/0/tenders/17f405f826424ae4949e98ff915412c9/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-26T23:27:51.300952+02:00",
            "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
            "id": "88fe3d515eda494983a3973e699ba30d",
            "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 active.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
        }
    }
}

Auction

After auction is scheduled anybody can visit it to watch. The auction can be reached at Tender.auctionUrl:

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



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

{
    "data": {
        "auctionPeriod": {
            "startDate": "2014-12-04T00:00:00+02:02"
        },
        "auctionUrl": "http://auction-sandbox.openprocurement.org/tenders/e9ecf1e8f5da47c68d47f8d2c1499946",
        "bids": [
            {
                "value": {
                    "amount": 475000.0,
                    "currency": "UAH",
                    "valueAddedTaxIncluded": true
                }
            },
            {
                "value": {
                    "amount": 480000.0,
                    "currency": "UAH",
                    "valueAddedTaxIncluded": true
                }
            }
        ],
        "complaints": [
            {
                "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-03T22:59:57.858006+02:00",
                "description": "Умови виставлені замовником не містять достатньо інформації, щоб заявка мала сенс.",
                "documents": [
                    {
                        "dateModified": "2014-12-03T23:00:02.929901+02:00",
                        "datePublished": "2014-12-03T23:00:02.929858+02:00",
                        "format": "text/plain",
                        "id": "af38e9210b0d43aab68491fcf726b8e9",
                        "title": "ComplaintResolution.pdf",
                        "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/complaints/8c7e05c5bd1a4fca927298677d6e5399/documents/af38e9210b0d43aab68491fcf726b8e9?download=578e4f998b9e444d9c78fd9fd13b3fe3"
                    }
                ],
                "id": "8c7e05c5bd1a4fca927298677d6e5399",
                "status": "declined",
                "title": "Недостатньо інформації"
            }
        ],
        "dateModified": "2014-12-03T23:00:27.392833+02:00",
        "documents": [
            {
                "dateModified": "2014-12-03T23:00:06.170772+02:00",
                "datePublished": "2014-12-03T23:00:06.170728+02:00",
                "format": "text/plain",
                "id": "357a3f75f58e4519a548e2bff502a066",
                "title": "Notice.pdf",
                "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/documents/357a3f75f58e4519a548e2bff502a066?download=b35eb8140f62471d8cdb4f0658fb30c2"
            },
            {
                "dateModified": "2014-12-03T23:00:09.292528+02:00",
                "datePublished": "2014-12-03T23:00:09.292481+02:00",
                "format": "text/plain",
                "id": "ac4306402dba448996c5fe7151cd01ca",
                "title": "AwardCriteria.pdf",
                "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/documents/ac4306402dba448996c5fe7151cd01ca?download=7471f23ba2c346b2a539aa96a9bcca04"
            },
            {
                "dateModified": "2014-12-03T23:00:12.252334+02:00",
                "datePublished": "2014-12-03T23:00:09.292481+02:00",
                "format": "text/plain",
                "id": "ac4306402dba448996c5fe7151cd01ca",
                "title": "AwardCriteria-v2.pdf",
                "url": "http://api-sandbox.openprocurement.org/api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/documents/ac4306402dba448996c5fe7151cd01ca?download=6181d1e5014d438f8b71e55c0ae8dd7b"
            }
        ],
        "enquiryPeriod": {
            "endDate": "2015-05-29T00:00:00+02:02",
            "startDate": "2014-12-03T22:59:53.557296+02:00"
        },
        "id": "e9ecf1e8f5da47c68d47f8d2c1499946",
        "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 м.Вінниці"
        },
        "questions": [
            {
                "answer": "Таблицю додано в файлі \"Kalorijnist.xslx\"",
                "date": "2014-12-03T23:00:14.683574+02:00",
                "description": "Просимо додати таблицю потрібної калорійності харчування по місяцях",
                "id": "e0c46b4e52bd4b05bbc9f41a657da1f0",
                "title": "Калорійність по місяцях"
            }
        ],
        "status": "active.auction",
        "tenderID": "UA-e9ecf1e8f5da47c68d47f8d2c1499946",
        "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
        }
    }
}

And bidders can find out their participation URLs via their bids:

$ http -j https://api-sandbox.openprocurement.org/api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/bids/8565ea796fcd40ddaf35ff67f98cb33a
GET /api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/bids/8565ea796fcd40ddaf35ff67f98cb33a HTTP/1.1
Content-Type: application/json; charset=utf-8



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

{
    "data": {
        "participationUrl": "http://auction-sandbox.openprocurement.org/tenders/e9ecf1e8f5da47c68d47f8d2c1499946?bidder_id=8565ea796fcd40ddaf35ff67f98cb33a",
        "value": {
            "amount": 475000.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
        }
    }
}

See the Bid.participationUrl in the response. The similar, but different, url can be retrieved for the other participants:

$ http -j https://api-sandbox.openprocurement.org/api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/bids/5f040175aed54468b424aefd4780a2b7
GET /api/0/tenders/e9ecf1e8f5da47c68d47f8d2c1499946/bids/5f040175aed54468b424aefd4780a2b7 HTTP/1.1
Content-Type: application/json; charset=utf-8



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

{
    "data": {
        "participationUrl": "http://auction-sandbox.openprocurement.org/tenders/e9ecf1e8f5da47c68d47f8d2c1499946?bidder_id=5f040175aed54468b424aefd4780a2b7",
        "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"
    }
}