2 Phase Commit

Mechanism of the 2-phase commit

The 2-phase commit provides a mechanism for CDB to publish only the tenders that clients are able to control and duplicates of which they have rights to cancel.

The reason for duplicated tenders can be cases when the requester did not receive a response from the server about tender creation and, therefore, repeated the request. Removing such tenders requires administrative intervention.

Creating tender with single-phase commit

Sending a single-phase request for a tender creation (POST /tenders) according to the “old” mechanism, that creates a tender already in the active.enquiries status:

Request

POST /api/2.5/tenders?opt_pretty=1 HTTP/1.0
Authorization: Bearer broker
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua

{
  "data": {
    "title": "футляри до державних нагород",
    "mainProcurementCategory": "goods",
    "procuringEntity": {
      "name": "Державне управління справами",
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "address": {
        "countryName": "Україна",
        "postalCode": "01220",
        "region": "м. Київ",
        "locality": "м. Київ",
        "streetAddress": "вул. Банкова, 11, корпус 1"
      },
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "+0440000000"
      },
      "kind": "general"
    },
    "value": {
      "amount": 500,
      "currency": "UAH"
    },
    "minimalStep": {
      "amount": 15,
      "currency": "UAH"
    },
    "items": [
      {
        "id": "ffffffffffffffffffffffffffffffff",
        "description": "футляри до державних нагород",
        "description_en": "Cases with state awards",
        "description_ru": "футляры к государственным наградам",
        "classification": {
          "scheme": "ДК021",
          "id": "44617100-9",
          "description": "Cartons"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "unit": {
          "name": "кілограм",
          "code": "KGM",
          "value": {
            "amount": 6
          }
        },
        "quantity": 5
      }
    ],
    "enquiryPeriod": {
      "endDate": "2023-10-17T00:00:00+02:00"
    },
    "tenderPeriod": {
      "endDate": "2023-10-24T00:00:00+02:00"
    },
    "procurementMethodType": "belowThreshold",
    "milestones": [
      {
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "title": "signingTheContract",
        "code": "prepayment",
        "type": "financing",
        "duration": {
          "days": 2,
          "type": "banking"
        },
        "sequenceNumber": 0,
        "percentage": 45.55
      },
      {
        "title": "deliveryOfGoods",
        "code": "postpayment",
        "type": "financing",
        "duration": {
          "days": 900,
          "type": "calendar"
        },
        "sequenceNumber": 0,
        "percentage": 54.45
      }
    ]
  },
  "config": {
    "hasAuction": true,
    "hasAwardingOrder": true,
    "hasValueRestriction": true,
    "valueCurrencyEquality": true,
    "hasPrequalification": false,
    "minBidsNumber": 1,
    "hasPreSelectionAgreement": false,
    "hasTenderComplaints": false,
    "hasAwardComplaints": false,
    "hasCancellationComplaints": false,
    "restricted": false
  }
}

Response

HTTP/1.0 201 Created
Content-Type: application/json
Location: http://lb-api-sandbox.prozorro.gov.ua/api/2.5/tenders/3f5ff57c43ca4ba6b3a1d0619b7a14c3

{
  "data": {
    "mainProcurementCategory": "goods",
    "title": "футляри до державних нагород",
    "status": "draft",
    "awardCriteria": "lowestCost",
    "value": {
      "amount": 500.0,
      "currency": "UAH",
      "valueAddedTaxIncluded": true
    },
    "minimalStep": {
      "amount": 15.0,
      "currency": "UAH",
      "valueAddedTaxIncluded": true
    },
    "tenderPeriod": {
      "startDate": "2023-10-17T00:00:00+02:00",
      "endDate": "2023-10-24T00:00:00+02:00"
    },
    "items": [
      {
        "id": "ffffffffffffffffffffffffffffffff",
        "description": "футляри до державних нагород",
        "description_en": "Cases with state awards",
        "description_ru": "футляры к государственным наградам",
        "unit": {
          "name": "кілограм",
          "value": {
            "amount": 6.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
          },
          "code": "KGM"
        },
        "quantity": 5.0,
        "classification": {
          "description": "Cartons",
          "scheme": "ДК021",
          "id": "44617100-9"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ]
      }
    ],
    "milestones": [
      {
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "title": "signingTheContract",
        "type": "financing",
        "code": "prepayment",
        "percentage": 45.55,
        "duration": {
          "days": 2,
          "type": "banking"
        },
        "sequenceNumber": 0
      },
      {
        "id": "a408d2d9993b4d5ca7e7b2774859ddfe",
        "title": "deliveryOfGoods",
        "type": "financing",
        "code": "postpayment",
        "percentage": 54.45,
        "duration": {
          "days": 900,
          "type": "calendar"
        },
        "sequenceNumber": 0
      }
    ],
    "procurementMethodType": "belowThreshold",
    "procuringEntity": {
      "name": "Державне управління справами",
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "address": {
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "locality": "м. Київ",
        "region": "м. Київ",
        "postalCode": "01220",
        "countryName": "Україна"
      },
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "+0440000000"
      },
      "kind": "general"
    },
    "enquiryPeriod": {
      "endDate": "2023-10-17T00:00:00+02:00",
      "startDate": "2023-10-10T01:00:00+03:00",
      "clarificationsUntil": "2023-10-19T00:00:00+03:00"
    },
    "tenderID": "UA-2023-10-10-000001-a",
    "owner": "broker",
    "procurementMethod": "open",
    "submissionMethod": "electronicAuction",
    "date": "2023-10-10T01:00:00+03:00",
    "dateCreated": "2023-10-10T01:00:00+03:00",
    "dateModified": "2023-10-10T01:00:00+03:00",
    "id": "3f5ff57c43ca4ba6b3a1d0619b7a14c3"
  },
  "config": {
    "hasAuction": true,
    "hasAwardingOrder": true,
    "hasValueRestriction": true,
    "valueCurrencyEquality": true,
    "hasPrequalification": false,
    "minBidsNumber": 1,
    "hasPreSelectionAgreement": false,
    "hasTenderComplaints": false,
    "hasAwardComplaints": false,
    "hasCancellationComplaints": false,
    "restricted": false
  },
  "access": {
    "token": "312a92a0096444fa9b9761b0af134205",
    "transfer": "2e13e17f324748f9b74cb91bb27dfc02"
  }
}

Creating tender with 2-phase commit

Tender becomes available after the successful completion of the following requests:

  1. Creation of the tender in the draft status.

  2. Transfer of the tender to active.enquiries status through a separate request (publication).

Creation of a tender

A request POST /tenders creates a tender in status draft. As a result, an acc_token is passed for the further tender management.

Request

POST /api/2.5/tenders?opt_pretty=1 HTTP/1.0
Authorization: Bearer broker
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua

{
  "data": {
    "title": "футляри до державних нагород",
    "mainProcurementCategory": "goods",
    "procuringEntity": {
      "name": "Державне управління справами",
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "address": {
        "countryName": "Україна",
        "postalCode": "01220",
        "region": "м. Київ",
        "locality": "м. Київ",
        "streetAddress": "вул. Банкова, 11, корпус 1"
      },
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "+0440000000"
      },
      "kind": "general"
    },
    "value": {
      "amount": 500,
      "currency": "UAH"
    },
    "minimalStep": {
      "amount": 15,
      "currency": "UAH"
    },
    "items": [
      {
        "id": "ffffffffffffffffffffffffffffffff",
        "description": "футляри до державних нагород",
        "description_en": "Cases with state awards",
        "description_ru": "футляры к государственным наградам",
        "classification": {
          "scheme": "ДК021",
          "id": "44617100-9",
          "description": "Cartons"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "unit": {
          "name": "кілограм",
          "code": "KGM",
          "value": {
            "amount": 6
          }
        },
        "quantity": 5
      }
    ],
    "enquiryPeriod": {
      "endDate": "2023-10-17T00:00:00+02:00"
    },
    "tenderPeriod": {
      "endDate": "2023-10-24T00:00:00+02:00"
    },
    "procurementMethodType": "belowThreshold",
    "milestones": [
      {
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "title": "signingTheContract",
        "code": "prepayment",
        "type": "financing",
        "duration": {
          "days": 2,
          "type": "banking"
        },
        "sequenceNumber": 0,
        "percentage": 45.55
      },
      {
        "title": "deliveryOfGoods",
        "code": "postpayment",
        "type": "financing",
        "duration": {
          "days": 900,
          "type": "calendar"
        },
        "sequenceNumber": 0,
        "percentage": 54.45
      }
    ],
    "status": "draft"
  },
  "config": {
    "hasAuction": true,
    "hasAwardingOrder": true,
    "hasValueRestriction": true,
    "valueCurrencyEquality": true,
    "hasPrequalification": false,
    "minBidsNumber": 1,
    "hasPreSelectionAgreement": false,
    "hasTenderComplaints": false,
    "hasAwardComplaints": false,
    "hasCancellationComplaints": false,
    "restricted": false
  }
}

Response

HTTP/1.0 201 Created
Content-Type: application/json
Location: http://lb-api-sandbox.prozorro.gov.ua/api/2.5/tenders/757dd278bae24bd89b207b4ed11a4496

{
  "data": {
    "mainProcurementCategory": "goods",
    "title": "футляри до державних нагород",
    "status": "draft",
    "awardCriteria": "lowestCost",
    "value": {
      "amount": 500.0,
      "currency": "UAH",
      "valueAddedTaxIncluded": true
    },
    "minimalStep": {
      "amount": 15.0,
      "currency": "UAH",
      "valueAddedTaxIncluded": true
    },
    "tenderPeriod": {
      "startDate": "2023-10-17T00:00:00+02:00",
      "endDate": "2023-10-24T00:00:00+02:00"
    },
    "items": [
      {
        "id": "ffffffffffffffffffffffffffffffff",
        "description": "футляри до державних нагород",
        "description_en": "Cases with state awards",
        "description_ru": "футляры к государственным наградам",
        "unit": {
          "name": "кілограм",
          "value": {
            "amount": 6.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
          },
          "code": "KGM"
        },
        "quantity": 5.0,
        "classification": {
          "description": "Cartons",
          "scheme": "ДК021",
          "id": "44617100-9"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ]
      }
    ],
    "milestones": [
      {
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "title": "signingTheContract",
        "type": "financing",
        "code": "prepayment",
        "percentage": 45.55,
        "duration": {
          "days": 2,
          "type": "banking"
        },
        "sequenceNumber": 0
      },
      {
        "id": "74c6d05cb02c444e908446d55a2de7f3",
        "title": "deliveryOfGoods",
        "type": "financing",
        "code": "postpayment",
        "percentage": 54.45,
        "duration": {
          "days": 900,
          "type": "calendar"
        },
        "sequenceNumber": 0
      }
    ],
    "procurementMethodType": "belowThreshold",
    "procuringEntity": {
      "name": "Державне управління справами",
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "address": {
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "locality": "м. Київ",
        "region": "м. Київ",
        "postalCode": "01220",
        "countryName": "Україна"
      },
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "+0440000000"
      },
      "kind": "general"
    },
    "enquiryPeriod": {
      "endDate": "2023-10-17T00:00:00+02:00",
      "startDate": "2023-10-10T01:00:00+03:00",
      "clarificationsUntil": "2023-10-19T00:00:00+03:00"
    },
    "tenderID": "UA-2023-10-10-000001-a",
    "owner": "broker",
    "procurementMethod": "open",
    "submissionMethod": "electronicAuction",
    "date": "2023-10-10T01:00:00+03:00",
    "dateCreated": "2023-10-10T01:00:00+03:00",
    "dateModified": "2023-10-10T01:00:00+03:00",
    "id": "757dd278bae24bd89b207b4ed11a4496"
  },
  "config": {
    "hasAuction": true,
    "hasAwardingOrder": true,
    "hasValueRestriction": true,
    "valueCurrencyEquality": true,
    "hasPrequalification": false,
    "minBidsNumber": 1,
    "hasPreSelectionAgreement": false,
    "hasTenderComplaints": false,
    "hasAwardComplaints": false,
    "hasCancellationComplaints": false,
    "restricted": false
  },
  "access": {
    "token": "41ea9ff1688a4270b3759cae1b82df73",
    "transfer": "458b550f618d45d4903635053e66458b"
  }
}

Tender with the draft status is “invisible” in the GET /tenders list. Chronograph does not “see” it, therefore, does not switch statuses.

Publication of a tender

The request PATCH /tenders/{id}?acc_token=… {“data”:{“status”:”active.enquiries”}} changes status of tender (according to the request), therefore, publishes it (“visualizes” it in the GET /tenders list).

Request

PATCH /api/2.5/tenders/757dd278bae24bd89b207b4ed11a4496?acc_token=41ea9ff1688a4270b3759cae1b82df73 HTTP/1.0
Authorization: Bearer broker
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua

{
  "data": {
    "status": "active.enquiries"
  }
}

Response

HTTP/1.0 200 OK
Content-Type: application/json

{
  "data": {
    "date": "2023-10-10T01:00:00+03:00",
    "dateModified": "2023-10-10T01:00:00+03:00",
    "dateCreated": "2023-10-10T01:00:00+03:00",
    "tenderID": "UA-2023-10-10-000001-a",
    "status": "active.enquiries",
    "owner": "broker",
    "title": "футляри до державних нагород",
    "mainProcurementCategory": "goods",
    "procurementMethod": "open",
    "submissionMethod": "electronicAuction",
    "awardCriteria": "lowestCost",
    "value": {
      "amount": 500.0,
      "currency": "UAH",
      "valueAddedTaxIncluded": true
    },
    "minimalStep": {
      "amount": 15.0,
      "currency": "UAH",
      "valueAddedTaxIncluded": true
    },
    "tenderPeriod": {
      "startDate": "2023-10-17T00:00:00+02:00",
      "endDate": "2023-10-24T00:00:00+02:00"
    },
    "items": [
      {
        "id": "ffffffffffffffffffffffffffffffff",
        "description": "футляри до державних нагород",
        "description_en": "Cases with state awards",
        "description_ru": "футляры к государственным наградам",
        "unit": {
          "name": "кілограм",
          "value": {
            "amount": 6.0,
            "currency": "UAH",
            "valueAddedTaxIncluded": true
          },
          "code": "KGM"
        },
        "quantity": 5.0,
        "classification": {
          "description": "Cartons",
          "scheme": "ДК021",
          "id": "44617100-9"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "relatedLot": "21c927c942a143dda8d92601c0bf59c6"
      }
    ],
    "lots": [
      {
        "title": "lot title",
        "description": "lot description",
        "status": "active",
        "id": "21c927c942a143dda8d92601c0bf59c6",
        "date": "2023-10-10T01:00:00+03:00",
        "value": {
          "amount": 500.0,
          "currency": "UAH",
          "valueAddedTaxIncluded": true
        },
        "minimalStep": {
          "amount": 15.0,
          "currency": "UAH",
          "valueAddedTaxIncluded": true
        }
      }
    ],
    "milestones": [
      {
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "title": "signingTheContract",
        "type": "financing",
        "code": "prepayment",
        "percentage": 45.55,
        "duration": {
          "days": 2,
          "type": "banking"
        },
        "sequenceNumber": 0
      },
      {
        "id": "74c6d05cb02c444e908446d55a2de7f3",
        "title": "deliveryOfGoods",
        "type": "financing",
        "code": "postpayment",
        "percentage": 54.45,
        "duration": {
          "days": 900,
          "type": "calendar"
        },
        "sequenceNumber": 0
      }
    ],
    "procurementMethodType": "belowThreshold",
    "procuringEntity": {
      "name": "Державне управління справами",
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "address": {
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "locality": "м. Київ",
        "region": "м. Київ",
        "postalCode": "01220",
        "countryName": "Україна"
      },
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "+0440000000"
      },
      "kind": "general"
    },
    "enquiryPeriod": {
      "startDate": "2023-10-10T01:00:00+03:00",
      "clarificationsUntil": "2023-10-19T00:00:00+03:00",
      "endDate": "2023-10-17T00:00:00+02:00"
    },
    "next_check": "2023-10-17T00:00:00+02:00",
    "id": "757dd278bae24bd89b207b4ed11a4496"
  },
  "config": {
    "hasAuction": true,
    "hasAwardingOrder": true,
    "hasValueRestriction": true,
    "valueCurrencyEquality": true,
    "hasPrequalification": false,
    "minBidsNumber": 1,
    "hasPreSelectionAgreement": false,
    "hasTenderComplaints": false,
    "hasAwardComplaints": false,
    "hasCancellationComplaints": false,
    "restricted": false
  }
}

All tenders created in the CDB but not yet published will not be displayed on the web platform and, therefore, will not lead to their announcement.

Repeating of the request for publication in case of problem with receiving a response from the server will not cause errors.

The new mechanism is available along with the “old” one. The “old” is likely to be turned off in one of the later releases.

Work with errors

In case of unsuccessful request and/or 5xx errors you should check modified object data (tender, bid, award, etc.), since 5xx error response does not necessarily guarantee that request has not been performed. You should repeat this request with some interval until successful result.

You can view more detailed error description here.

Here is an example of incorrectly formed request. This error indicates that the data is not found in the body of JSON.

Request

POST /api/2.5/tenders?opt_pretty=1 HTTP/1.0
Authorization: Bearer broker
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua

{}

Response

HTTP/1.0 422 Unprocessable Entity
Content-Type: application/json

{
  "status": "error",
  "errors": [
    {
      "location": "body",
      "name": "data",
      "description": "Data not available"
    }
  ]
}