Example for Tender

Tender ownership change

Let’s view transfer example for tender.

Tender creation

At first let’s create a tender:

POST /api/2.5/tenders?opt_pretty=1 HTTP/1.0
Authorization: Bearer broker
Content-Length: 2774
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
DATA:
{
  "data": {
    "milestones": [
      {
        "code": "prepayment",
        "sequenceNumber": 0,
        "title": "signingTheContract",
        "duration": {
          "type": "banking",
          "days": 2
        },
        "percentage": 45.55,
        "type": "financing",
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      {
        "code": "postpayment",
        "sequenceNumber": 0,
        "title": "deliveryOfGoods",
        "duration": {
          "type": "calendar",
          "days": 900
        },
        "percentage": 54.45,
        "type": "financing"
      }
    ],
    "mainProcurementCategory": "goods",
    "tenderPeriod": {
      "endDate": "2019-11-08T01:00:00+03:00"
    },
    "title": "футляри до державних нагород",
    "minimalStep": {
      "currency": "UAH",
      "amount": 35
    },
    "enquiryPeriod": {
      "endDate": "2019-11-01T01:00:00+03:00"
    },
    "procurementMethodType": "belowThreshold",
    "value": {
      "currency": "UAH",
      "amount": 500
    },
    "procuringEntity": {
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "0440000000"
      },
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "name": "Державне управління справами",
      "kind": "general",
      "address": {
        "countryName": "Україна",
        "postalCode": "01220",
        "region": "м. Київ",
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "locality": "м. Київ"
      }
    },
    "items": [
      {
        "description": "футляри до державних нагород",
        "classification": {
          "scheme": "ДК021",
          "id": "44617100-9",
          "description": "Cartons"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "deliveryAddress": {
          "countryName": "Україна",
          "postalCode": "79000",
          "region": "м. Київ",
          "streetAddress": "вул. Банкова 1",
          "locality": "м. Київ"
        },
        "deliveryDate": {
          "startDate": "2019-10-27T01:00:00+03:00",
          "endDate": "2019-10-30T01:00:00+03:00"
        },
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ]
  }
}

Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://lb-api-sandbox.prozorro.gov.ua/api/2.5/tenders/dd4f0a6132c645c69b311877d0646847
{
  "access": {
    "transfer": "e1d86a01927343519c8ab379be1a8a41",
    "token": "acc81295f9794d17ae8542497e39441b"
  },
  "data": {
    "procurementMethod": "open",
    "status": "active.enquiries",
    "milestones": [
      {
        "code": "prepayment",
        "sequenceNumber": 0,
        "title": "signingTheContract",
        "duration": {
          "type": "banking",
          "days": 2
        },
        "percentage": 45.55,
        "type": "financing",
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      {
        "code": "postpayment",
        "sequenceNumber": 0,
        "title": "deliveryOfGoods",
        "duration": {
          "type": "calendar",
          "days": 900
        },
        "percentage": 54.45,
        "type": "financing",
        "id": "9def55a6f8ab46229b7e039925ca4c85"
      }
    ],
    "mainProcurementCategory": "goods",
    "tenderPeriod": {
      "startDate": "2019-11-01T01:00:00+03:00",
      "endDate": "2019-11-08T01:00:00+03:00"
    },
    "title": "футляри до державних нагород",
    "minimalStep": {
      "currency": "UAH",
      "amount": 35.0,
      "valueAddedTaxIncluded": true
    },
    "items": [
      {
        "description": "футляри до державних нагород",
        "classification": {
          "scheme": "ДК021",
          "description": "Cartons",
          "id": "44617100-9"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "deliveryAddress": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "deliveryDate": {
          "startDate": "2019-10-27T01:00:00+03:00",
          "endDate": "2019-10-30T01:00:00+03:00"
        },
        "id": "8443e4c9b1a2491f863bb2d017cb816c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5.0
      }
    ],
    "procurementMethodType": "belowThreshold",
    "value": {
      "currency": "UAH",
      "amount": 500.0,
      "valueAddedTaxIncluded": true
    },
    "submissionMethod": "electronicAuction",
    "date": "2019-10-25T01:00:00+03:00",
    "next_check": "2019-11-01T00:00:00+02:00",
    "procuringEntity": {
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "0440000000"
      },
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "name": "Державне управління справами",
      "kind": "general",
      "address": {
        "postalCode": "01220",
        "countryName": "Україна",
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "region": "м. Київ",
        "locality": "м. Київ"
      }
    },
    "awardCriteria": "lowestCost",
    "enquiryPeriod": {
      "startDate": "2019-10-25T01:00:00+03:00",
      "endDate": "2019-11-01T01:00:00+03:00"
    },
    "owner": "broker",
    "dateModified": "2019-10-25T01:00:00+03:00",
    "id": "dd4f0a6132c645c69b311877d0646847",
    "tenderID": "UA-2019-10-25-000001"
  }
}

broker is current tender’s owner.

Note that response’s access section contains a transfer key which is used to change tender ownership.

After tender’s registration in CDB broker has to provide its customer with transfer key.

Transfer creation

Broker that is going to become new tender owner should create a Transfer.

POST /api/2.5/transfers HTTP/1.0
Authorization: Bearer broker1
Content-Length: 12
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
DATA:
{
  "data": {}
}

Response: 201 Created
Content-Type: application/json; charset=UTF-8
{
  "access": {
    "transfer": "36897dc151aa4ea0a7126cf60ee201ee",
    "token": "c3eb5cb106484a8ba13f0ad8408942d6"
  },
  "data": {
    "date": "2019-10-25T01:00:00+03:00",
    "id": "5973ef05794a4ce4be6e7cca1a549caf"
  }
}

Transfer object contains new access token and new transfer token for the object that will be transferred to new broker.

Transfer can be retrieved by id:

GET /api/2.5/transfers/5973ef05794a4ce4be6e7cca1a549caf HTTP/1.0
Authorization: Bearer broker1
Host: lb-api-sandbox.prozorro.gov.ua

Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
  "data": {
    "date": "2019-10-25T01:00:00+03:00",
    "id": "5973ef05794a4ce4be6e7cca1a549caf"
  }
}

Changing tender’s owner

An ability to change tender’s ownership depends on tender’s status:

Allowed Not Alowwed
belowThreshold

active.enquiries

active.tendering

active.auction

active.qualification

active.awarded

complete

cancelled

unsuccessful

aboveThresholdUA

active.tendering

active.auction

active.qualification

active.awarded

complete

cancelled

unsuccessful

aboveThresholdEU

active.tendering

active.pre-qualification

active.pre-qualification.stand-still

active.auction

active.qualification

active.awarded

complete

cancelled

unsuccessful

aboveThresholdUA.defense

active.tendering

active.auction

active.qualification

active.awarded

complete

cancelled

unsuccessful

competitiveDialogueUA

active.tendering

active.pre-qualification

active.pre-qualification.stand-still

active.stage2.pending

active.stage2.waiting

complete

unsuccessful

cancelled

competitiveDialogueUA.stage2

draft.stage2

active.tendering

active.auction

active.qualification

active.awarded

complete

unsuccessful

cancelled

competitiveDialogueEU

active.tendering

active.pre-qualification

active.pre-qualification.stand-still

active.stage2.pending

active.stage2.waiting

complete

unsuccessful

cancelled

competitiveDialogueEU.stage2

draft.stage2

active.tendering

active.pre-qualification

active.pre-qualification.stand-still

active.auction

active.qualification

active.awarded

complete

unsuccessful

cancelled

esco

active.tendering

active.pre-qualification

active.pre-qualification.stand-still

active.auction

active.qualification

active.awarded

complete

unsuccessful

cancelled

closeFrameworkAgreementUA

active.tendering

active.pre-qualification

active.pre-qualification.stand-still

active.auction

active.qualification

active.qualification.stand-still

active.awarded

complete

unsuccessful

cancelled

closeFrameworkAgreementSelectionUA

draftactive.enquiries

active.tendering

active.auction

active.qualification

active.awarded

draft.pending

draft.unsuccessful

complete

unsuccessful

cancelled

reporting
active

complete

cancelled

negotiation
active

complete

cancelled

negotiation.quick
active complete

To change tender’s ownership new broker should send POST request to appropriate /tenders/id/ with data section containing id of Transfer and transfer token received from customer:

POST /api/2.5/tenders/dd4f0a6132c645c69b311877d0646847/ownership HTTP/1.0
Authorization: Bearer broker1
Content-Length: 100
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
DATA:
{
  "data": {
    "transfer": "e1d86a01927343519c8ab379be1a8a41",
    "id": "5973ef05794a4ce4be6e7cca1a549caf"
  }
}

Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
  "data": {
    "procurementMethod": "open",
    "status": "active.enquiries",
    "milestones": [
      {
        "code": "prepayment",
        "sequenceNumber": 0,
        "title": "signingTheContract",
        "duration": {
          "type": "banking",
          "days": 2
        },
        "percentage": 45.55,
        "type": "financing",
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      {
        "code": "postpayment",
        "sequenceNumber": 0,
        "title": "deliveryOfGoods",
        "duration": {
          "type": "calendar",
          "days": 900
        },
        "percentage": 54.45,
        "type": "financing",
        "id": "9def55a6f8ab46229b7e039925ca4c85"
      }
    ],
    "mainProcurementCategory": "goods",
    "tenderPeriod": {
      "startDate": "2019-11-01T01:00:00+03:00",
      "endDate": "2019-11-08T01:00:00+03:00"
    },
    "title": "футляри до державних нагород",
    "minimalStep": {
      "currency": "UAH",
      "amount": 35.0,
      "valueAddedTaxIncluded": true
    },
    "items": [
      {
        "description": "футляри до державних нагород",
        "classification": {
          "scheme": "ДК021",
          "description": "Cartons",
          "id": "44617100-9"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "deliveryAddress": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "deliveryDate": {
          "startDate": "2019-10-27T01:00:00+03:00",
          "endDate": "2019-10-30T01:00:00+03:00"
        },
        "id": "8443e4c9b1a2491f863bb2d017cb816c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5.0
      }
    ],
    "procurementMethodType": "belowThreshold",
    "value": {
      "currency": "UAH",
      "amount": 500.0,
      "valueAddedTaxIncluded": true
    },
    "submissionMethod": "electronicAuction",
    "numberOfBids": 0,
    "date": "2019-10-25T01:00:00+03:00",
    "next_check": "2019-11-01T00:00:00+02:00",
    "procuringEntity": {
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "0440000000"
      },
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "name": "Державне управління справами",
      "kind": "general",
      "address": {
        "postalCode": "01220",
        "countryName": "Україна",
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "region": "м. Київ",
        "locality": "м. Київ"
      }
    },
    "awardCriteria": "lowestCost",
    "enquiryPeriod": {
      "startDate": "2019-10-25T01:00:00+03:00",
      "endDate": "2019-11-01T01:00:00+03:00"
    },
    "owner": "broker1",
    "dateModified": "2019-10-25T01:00:00+03:00",
    "id": "dd4f0a6132c645c69b311877d0646847",
    "tenderID": "UA-2019-10-25-000001"
  }
}

Updated owner value indicates that ownership is successfully changed.

Note that new broker has to provide its customer with new transfer key (generated in Transfer object).

After Transfer is applied it stores tender path in usedFor property:

GET /api/2.5/transfers/5973ef05794a4ce4be6e7cca1a549caf HTTP/1.0
Authorization: Bearer broker1
Host: lb-api-sandbox.prozorro.gov.ua

Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
  "data": {
    "date": "2019-10-25T01:00:00+03:00",
    "id": "5973ef05794a4ce4be6e7cca1a549caf",
    "usedFor": "/tenders/dd4f0a6132c645c69b311877d0646847"
  }
}

‘Used’ Transfer can’t be applied to any other object.

Let’s try to change the tender using token received on Transfer creation:

PATCH /api/2.5/tenders/dd4f0a6132c645c69b311877d0646847?acc_token=c3eb5cb106484a8ba13f0ad8408942d6 HTTP/1.0
Authorization: Bearer broker1
Content-Length: 62
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
DATA:
{
  "data": {
    "description": "broker1 now can change the tender"
  }
}

Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
  "data": {
    "procurementMethod": "open",
    "status": "active.enquiries",
    "milestones": [
      {
        "code": "prepayment",
        "sequenceNumber": 0,
        "title": "signingTheContract",
        "duration": {
          "type": "banking",
          "days": 2
        },
        "percentage": 45.55,
        "type": "financing",
        "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      },
      {
        "code": "postpayment",
        "sequenceNumber": 0,
        "title": "deliveryOfGoods",
        "duration": {
          "type": "calendar",
          "days": 900
        },
        "percentage": 54.45,
        "type": "financing",
        "id": "9def55a6f8ab46229b7e039925ca4c85"
      }
    ],
    "mainProcurementCategory": "goods",
    "tenderPeriod": {
      "startDate": "2019-11-01T01:00:00+03:00",
      "endDate": "2019-11-08T01:00:00+03:00"
    },
    "title": "футляри до державних нагород",
    "minimalStep": {
      "currency": "UAH",
      "amount": 35.0,
      "valueAddedTaxIncluded": true
    },
    "items": [
      {
        "description": "футляри до державних нагород",
        "classification": {
          "scheme": "ДК021",
          "description": "Cartons",
          "id": "44617100-9"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "deliveryAddress": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "deliveryDate": {
          "startDate": "2019-10-27T01:00:00+03:00",
          "endDate": "2019-10-30T01:00:00+03:00"
        },
        "id": "8443e4c9b1a2491f863bb2d017cb816c",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5.0
      }
    ],
    "procurementMethodType": "belowThreshold",
    "value": {
      "currency": "UAH",
      "amount": 500.0,
      "valueAddedTaxIncluded": true
    },
    "submissionMethod": "electronicAuction",
    "enquiryPeriod": {
      "startDate": "2019-10-25T01:00:00+03:00",
      "endDate": "2019-11-01T01:00:00+03:00"
    },
    "date": "2019-10-25T01:00:00+03:00",
    "next_check": "2019-11-01T00:00:00+02:00",
    "procuringEntity": {
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "0440000000"
      },
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "name": "Державне управління справами",
      "kind": "general",
      "address": {
        "postalCode": "01220",
        "countryName": "Україна",
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "region": "м. Київ",
        "locality": "м. Київ"
      }
    },
    "awardCriteria": "lowestCost",
    "tenderID": "UA-2019-10-25-000001",
    "owner": "broker1",
    "dateModified": "2019-10-25T01:00:00+03:00",
    "id": "dd4f0a6132c645c69b311877d0646847",
    "description": "broker1 now can change the tender"
  }
}

Pay attention that only broker with appropriate accreditation level can become new owner. Otherwise broker will be forbidden from this action.

POST /api/2.5/tenders/dd4f0a6132c645c69b311877d0646847/ownership HTTP/1.0
Authorization: Bearer broker2
Content-Length: 100
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
DATA:
{
  "data": {
    "transfer": "e1d86a01927343519c8ab379be1a8a41",
    "id": "dfdf21298b174f468aaa029308799b66"
  }
}

Response: 403 Forbidden
Content-Type: application/json; charset=UTF-8
{
  "status": "error",
  "errors": [
    {
      "description": "Broker Accreditation level does not permit ownership change",
      "location": "ownership",
      "name": "accreditation"
    }
  ]
}

Also ownership change is allowed only if current owner has a special accreditation level that allows ownership change:

POST /api/2.5/tenders/dd4f0a6132c645c69b311877d0646847/ownership HTTP/1.0
Authorization: Bearer broker
Content-Length: 100
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
DATA:
{
  "data": {
    "transfer": "e1d86a01927343519c8ab379be1a8a41",
    "id": "51cadfe8664944dfb2f65d861c79f660"
  }
}

Response: 403 Forbidden
Content-Type: application/json; charset=UTF-8
{
  "status": "error",
  "errors": [
    {
      "description": "Owner Accreditation level does not permit ownership change",
      "location": "ownership",
      "name": "accreditation"
    }
  ]
}