Example for Plan
Plan ownership change
Let’s view transfer example for plan.
Tender creation
At first let’s create a plan:
Request
POST /api/2.5/plans?opt_pretty=1 HTTP/1.0
Authorization: Bearer brokerx
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
{
"data": {
"rationale": {
"description": "Недостатньо змістовне обгрунтування"
},
"tender": {
"procurementMethod": "open",
"procurementMethodType": "belowThreshold",
"tenderPeriod": {
"startDate": "2023-10-17T01:00:00+03:00"
}
},
"items": [
{
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"deliveryAddress": {
"countryName": "Україна",
"postalCode": "79000",
"region": "м. Київ",
"locality": "м. Київ",
"streetAddress": "вул. Банкова 1"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.92",
"description": "Насіння гірчиці"
}
],
"unit": {
"code": "KGM",
"name": "кг"
},
"classification": {
"scheme": "ДК021",
"description": "Mustard seeds",
"id": "03111600-8"
},
"quantity": 1000,
"description": "Насіння гірчиці"
},
{
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"deliveryAddress": {
"countryName": "Україна",
"postalCode": "79000",
"region": "м. Київ",
"locality": "м. Київ",
"streetAddress": "вул. Банкова 1"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.95",
"description": "Насіння соняшнику"
}
],
"unit": {
"code": "KGM",
"name": "кг"
},
"classification": {
"scheme": "ДК021",
"description": "Sunflower seeds",
"id": "03111300-5"
},
"quantity": 2000,
"description": "Насіння соняшнику"
},
{
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"deliveryAddress": {
"countryName": "Україна",
"postalCode": "79000",
"region": "м. Київ",
"locality": "м. Київ",
"streetAddress": "вул. Банкова 1"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.84",
"description": "Насіння бавовнику"
}
],
"unit": {
"code": "KGM",
"name": "кг"
},
"classification": {
"scheme": "ДК021",
"description": "Cotton seeds",
"id": "03111400-6"
},
"quantity": 3000,
"description": "Насіння бавовнику"
}
],
"classification": {
"scheme": "ДК021",
"description": "Seeds",
"id": "03111000-2"
},
"additionalClassifications": [
{
"scheme": "КЕКВ",
"id": "2000",
"description": "Поточні видатки"
}
],
"procuringEntity": {
"identifier": {
"scheme": "UA-EDR",
"id": "111983",
"legalName": "ДП Державне Управління Справами"
},
"name": "ДУС",
"address": {
"countryName": "Україна",
"postalCode": "01220",
"region": "м. Київ",
"locality": "м. Київ",
"streetAddress": "вул. Банкова, 11, корпус 1"
},
"kind": "general",
"signerInfo": {
"name": "Test Testovich",
"telephone": "+380950000000",
"email": "example@email.com",
"iban": "111111111111111",
"authorizedBy": "Статут компанії",
"position": "Генеральний директор"
}
},
"buyers": [
{
"identifier": {
"scheme": "UA-EDR",
"id": "111983",
"legalName": "ДП Державне Управління Справами"
},
"name": "ДУС",
"address": {
"countryName": "Україна",
"postalCode": "01220",
"region": "м. Київ",
"locality": "м. Київ",
"streetAddress": "вул. Банкова, 11, корпус 1"
},
"kind": "general",
"signerInfo": {
"name": "Test Testovich",
"telephone": "+380950000000",
"email": "example@email.com",
"iban": "111111111111111",
"authorizedBy": "Статут компанії",
"position": "Генеральний директор"
}
}
],
"budget": {
"project": {
"name": "proj_name",
"id": "123"
},
"amount": 10000,
"amountNet": 12222,
"currency": "UAH",
"id": "12303111000-2",
"description": "budget_description",
"period": {
"startDate": "2023-01-01T00:00:00",
"endDate": "2023-12-31T00:00:00"
},
"breakdown": [
{
"title": "other",
"description": "Breakdown other description.",
"value": {
"amount": 1500,
"currency": "UAH"
}
}
]
},
"project": {
"title": "DREAMs come true",
"uri": "https://dream.gov.ua/ua/project/DREAM-UA-030524-EE48E08C/profile"
}
}
}
Response
HTTP/1.0 201 Created
Content-Type: application/json
Location: http://lb-api-sandbox.prozorro.gov.ua/api/2.5/plans/b8b612ed1b6d471fb2c7f2f17f4a1de2
{
"data": {
"status": "scheduled",
"procuringEntity": {
"id": "23a3993c00024903a223bb8731cf6b27",
"name": "ДУС",
"identifier": {
"scheme": "UA-EDR",
"id": "111983",
"legalName": "ДП Державне Управління Справами"
},
"address": {
"streetAddress": "вул. Банкова, 11, корпус 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "01220",
"countryName": "Україна"
},
"kind": "general",
"signerInfo": {
"name": "Test Testovich",
"email": "example@email.com",
"telephone": "+380950000000",
"iban": "111111111111111",
"position": "Генеральний директор",
"authorizedBy": "Статут компанії"
}
},
"tender": {
"procurementMethod": "open",
"procurementMethodType": "belowThreshold",
"tenderPeriod": {
"startDate": "2023-10-17T01:00:00+03:00"
}
},
"budget": {
"id": "12303111000-2",
"description": "budget_description",
"amount": 10000.0,
"currency": "UAH",
"amountNet": 12222.0,
"project": {
"id": "123",
"name": "proj_name"
},
"period": {
"startDate": "2023-01-01T00:00:00+02:00",
"endDate": "2023-12-31T00:00:00+02:00"
},
"breakdown": [
{
"id": "bc8d4b769c074f5090eb0dd4ddf8a560",
"title": "other",
"description": "Breakdown other description.",
"value": {
"amount": 1500.0,
"currency": "UAH"
}
}
]
},
"classification": {
"description": "Seeds",
"scheme": "ДК021",
"id": "03111000-2"
},
"additionalClassifications": [
{
"scheme": "КЕКВ",
"id": "2000",
"description": "Поточні видатки"
}
],
"items": [
{
"id": "9bf2b0efa4df4e83b8ef02ed100bf82d",
"classification": {
"description": "Mustard seeds",
"scheme": "ДК021",
"id": "03111600-8"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.92",
"description": "Насіння гірчиці"
}
],
"unit": {
"name": "кг",
"code": "KGM"
},
"quantity": 1000.0,
"deliveryAddress": {
"streetAddress": "вул. Банкова 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "79000",
"countryName": "Україна"
},
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"description": "Насіння гірчиці"
},
{
"id": "7a6fa944f5aa42eda95703b4bd8b9846",
"classification": {
"description": "Sunflower seeds",
"scheme": "ДК021",
"id": "03111300-5"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.95",
"description": "Насіння соняшнику"
}
],
"unit": {
"name": "кг",
"code": "KGM"
},
"quantity": 2000.0,
"deliveryAddress": {
"streetAddress": "вул. Банкова 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "79000",
"countryName": "Україна"
},
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"description": "Насіння соняшнику"
},
{
"id": "e980a7462b5c4f7ebaf27f12e7984f6a",
"classification": {
"description": "Cotton seeds",
"scheme": "ДК021",
"id": "03111400-6"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.84",
"description": "Насіння бавовнику"
}
],
"unit": {
"name": "кг",
"code": "KGM"
},
"quantity": 3000.0,
"deliveryAddress": {
"streetAddress": "вул. Банкова 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "79000",
"countryName": "Україна"
},
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"description": "Насіння бавовнику"
}
],
"buyers": [
{
"id": "9bedf063cb764e6184eb55c9f18056cb",
"name": "ДУС",
"identifier": {
"scheme": "UA-EDR",
"id": "111983",
"legalName": "ДП Державне Управління Справами"
},
"address": {
"streetAddress": "вул. Банкова, 11, корпус 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "01220",
"countryName": "Україна"
},
"kind": "general",
"signerInfo": {
"name": "Test Testovich",
"email": "example@email.com",
"telephone": "+380950000000",
"iban": "111111111111111",
"position": "Генеральний директор",
"authorizedBy": "Статут компанії"
}
}
],
"rationale": {
"description": "Недостатньо змістовне обгрунтування",
"date": "2023-10-10T01:00:00+03:00"
},
"project": {
"title": "DREAMs come true",
"uri": "https://dream.gov.ua/ua/project/DREAM-UA-030524-EE48E08C/profile"
},
"planID": "UA-P-2023-10-10-000001-a",
"owner": "brokerx",
"datePublished": "2023-10-10T01:00:00+03:00",
"dateCreated": "2023-10-10T01:00:00+03:00",
"dateModified": "2023-10-10T01:00:00+03:00",
"id": "b8b612ed1b6d471fb2c7f2f17f4a1de2"
},
"access": {
"token": "f45f0273c2ea4d52bde81c4f30b09376",
"transfer": "9192aab96d4b4959affa7d7644f539a6"
}
}
broker is current plan’s owner.
Note that response’s access section contains a transfer key which is used to change plan ownership.
After plan’s registration in CDB broker has to provide its customer with transfer key.
Transfer creation
Broker that is going to become new plan owner should create a Transfer.
Request
POST /api/2.5/transfers HTTP/1.0
Authorization: Bearer broker1
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
{
"data": {}
}
Response
HTTP/1.0 201 Created
Content-Type: application/json
{
"data": {
"date": "2023-10-10T01:00:00+03:00",
"id": "0635ab590dcf42f3a87afcad5c950480"
},
"access": {
"token": "387cfff9b93243ddaa148e5ea350ceb5",
"transfer": "cc5488fbcc4f4313bf04bd2aea88d16c"
}
}
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:
Request
GET /api/2.5/transfers/0635ab590dcf42f3a87afcad5c950480 HTTP/1.0
Authorization: Bearer broker1
Host: public-api-sandbox.prozorro.gov.ua
Response
HTTP/1.0 200 OK
Content-Type: application/json
{
"data": {
"date": "2023-10-10T01:00:00+03:00",
"id": "0635ab590dcf42f3a87afcad5c950480"
}
}
Changing plan’s owner
An ability to change plan’s ownership depends on plan’s status:
Allowed |
Not Allowed |
scheduled |
draft cancelled complete |
To change plan’s ownership new broker should send POST request to appropriate /plans/id/ with data section containing id of Transfer and transfer token received from customer:
Request
POST /api/2.5/plans/b8b612ed1b6d471fb2c7f2f17f4a1de2/ownership HTTP/1.0
Authorization: Bearer broker1
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
{
"data": {
"id": "0635ab590dcf42f3a87afcad5c950480",
"transfer": "9192aab96d4b4959affa7d7644f539a6"
}
}
Response
HTTP/1.0 200 OK
Content-Type: application/json
{
"data": {
"owner": "broker1",
"id": "b8b612ed1b6d471fb2c7f2f17f4a1de2"
}
}
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 plan path in usedFor property:
Request
GET /api/2.5/transfers/0635ab590dcf42f3a87afcad5c950480 HTTP/1.0
Authorization: Bearer broker1
Host: public-api-sandbox.prozorro.gov.ua
Response
HTTP/1.0 200 OK
Content-Type: application/json
{
"data": {
"date": "2023-10-10T01:00:00+03:00",
"usedFor": "/plans/b8b612ed1b6d471fb2c7f2f17f4a1de2",
"id": "0635ab590dcf42f3a87afcad5c950480"
}
}
‘Used’ Transfer can’t be applied to any other object.
Let’s try to change the plan using token received on Transfer creation:
Request
PATCH /api/2.5/plans/b8b612ed1b6d471fb2c7f2f17f4a1de2?acc_token=387cfff9b93243ddaa148e5ea350ceb5 HTTP/1.0
Authorization: Bearer broker1
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
{
"data": {
"budget": {
"project": {
"name": "proj_name",
"id": "123"
},
"amount": 10000,
"amountNet": 12222,
"currency": "UAH",
"id": "12303111000-2",
"description": "broker1 now can change the plan",
"period": {
"startDate": "2023-01-01T00:00:00",
"endDate": "2023-12-31T00:00:00"
},
"breakdown": [
{
"title": "other",
"description": "Breakdown other description.",
"value": {
"amount": 1500,
"currency": "UAH"
}
}
]
}
}
}
Response
HTTP/1.0 200 OK
Content-Type: application/json
{
"data": {
"status": "scheduled",
"procuringEntity": {
"id": "23a3993c00024903a223bb8731cf6b27",
"name": "ДУС",
"identifier": {
"scheme": "UA-EDR",
"id": "111983",
"legalName": "ДП Державне Управління Справами"
},
"address": {
"streetAddress": "вул. Банкова, 11, корпус 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "01220",
"countryName": "Україна"
},
"kind": "general",
"signerInfo": {
"name": "Test Testovich",
"email": "example@email.com",
"telephone": "+380950000000",
"iban": "111111111111111",
"position": "Генеральний директор",
"authorizedBy": "Статут компанії"
}
},
"tender": {
"procurementMethod": "open",
"procurementMethodType": "belowThreshold",
"tenderPeriod": {
"startDate": "2023-10-17T01:00:00+03:00"
}
},
"budget": {
"id": "12303111000-2",
"description": "broker1 now can change the plan",
"amount": 10000.0,
"currency": "UAH",
"amountNet": 12222.0,
"project": {
"id": "123",
"name": "proj_name"
},
"period": {
"startDate": "2023-01-01T00:00:00+02:00",
"endDate": "2023-12-31T00:00:00+02:00"
},
"breakdown": [
{
"id": "1d6a31660b38450483f11dd643327495",
"title": "other",
"description": "Breakdown other description.",
"value": {
"amount": 1500.0,
"currency": "UAH"
}
}
]
},
"classification": {
"description": "Seeds",
"scheme": "ДК021",
"id": "03111000-2"
},
"additionalClassifications": [
{
"scheme": "КЕКВ",
"id": "2000",
"description": "Поточні видатки"
}
],
"planID": "UA-P-2023-10-10-000001-a",
"items": [
{
"id": "9bf2b0efa4df4e83b8ef02ed100bf82d",
"classification": {
"description": "Mustard seeds",
"scheme": "ДК021",
"id": "03111600-8"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.92",
"description": "Насіння гірчиці"
}
],
"unit": {
"name": "кг",
"code": "KGM"
},
"quantity": 1000.0,
"deliveryAddress": {
"streetAddress": "вул. Банкова 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "79000",
"countryName": "Україна"
},
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"description": "Насіння гірчиці"
},
{
"id": "7a6fa944f5aa42eda95703b4bd8b9846",
"classification": {
"description": "Sunflower seeds",
"scheme": "ДК021",
"id": "03111300-5"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.95",
"description": "Насіння соняшнику"
}
],
"unit": {
"name": "кг",
"code": "KGM"
},
"quantity": 2000.0,
"deliveryAddress": {
"streetAddress": "вул. Банкова 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "79000",
"countryName": "Україна"
},
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"description": "Насіння соняшнику"
},
{
"id": "e980a7462b5c4f7ebaf27f12e7984f6a",
"classification": {
"description": "Cotton seeds",
"scheme": "ДК021",
"id": "03111400-6"
},
"additionalClassifications": [
{
"scheme": "ДКПП",
"id": "01.11.84",
"description": "Насіння бавовнику"
}
],
"unit": {
"name": "кг",
"code": "KGM"
},
"quantity": 3000.0,
"deliveryAddress": {
"streetAddress": "вул. Банкова 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "79000",
"countryName": "Україна"
},
"deliveryDate": {
"startDate": "2023-10-12T01:00:00+03:00",
"endDate": "2023-10-15T01:00:00+03:00"
},
"description": "Насіння бавовнику"
}
],
"buyers": [
{
"id": "9bedf063cb764e6184eb55c9f18056cb",
"name": "ДУС",
"identifier": {
"scheme": "UA-EDR",
"id": "111983",
"legalName": "ДП Державне Управління Справами"
},
"address": {
"streetAddress": "вул. Банкова, 11, корпус 1",
"locality": "м. Київ",
"region": "м. Київ",
"postalCode": "01220",
"countryName": "Україна"
},
"kind": "general",
"signerInfo": {
"name": "Test Testovich",
"email": "example@email.com",
"telephone": "+380950000000",
"iban": "111111111111111",
"position": "Генеральний директор",
"authorizedBy": "Статут компанії"
}
}
],
"rationale": {
"description": "Недостатньо змістовне обгрунтування",
"date": "2023-10-10T01:00:00+03:00"
},
"project": {
"title": "DREAMs come true",
"uri": "https://dream.gov.ua/ua/project/DREAM-UA-030524-EE48E08C/profile"
},
"owner": "broker1",
"dateCreated": "2023-10-10T01:00:00+03:00",
"dateModified": "2023-10-10T01:00:00+03:00",
"datePublished": "2023-10-10T01:00:00+03:00",
"id": "b8b612ed1b6d471fb2c7f2f17f4a1de2"
}
}
Pay attention that only broker with appropriate accreditation level can become new owner. Otherwise broker will be forbidden from this action.
Request
POST /api/2.5/plans/b8b612ed1b6d471fb2c7f2f17f4a1de2/ownership HTTP/1.0
Authorization: Bearer broker2
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
{
"data": {
"id": "7fb93395e4f4425e8a6e6000c9d07a7a",
"transfer": "9192aab96d4b4959affa7d7644f539a6"
}
}
Response
HTTP/1.0 403 Forbidden
Content-Type: application/json
{
"status": "error",
"errors": [
{
"location": "url",
"name": "accreditation",
"description": "Broker Accreditation level does not permit ownership change"
}
]
}
Also ownership change is allowed only if current owner has a special accreditation level that allows ownership change:
Request
POST /api/2.5/plans/b8b612ed1b6d471fb2c7f2f17f4a1de2/ownership HTTP/1.0
Authorization: Bearer brokerx
Content-Type: application/json
Host: lb-api-sandbox.prozorro.gov.ua
{
"data": {
"id": "35f84674d5e84f66b1f975dbce46bbdf",
"transfer": "9192aab96d4b4959affa7d7644f539a6"
}
}
Response
HTTP/1.0 403 Forbidden
Content-Type: application/json
{
"status": "error",
"errors": [
{
"location": "url",
"name": "accreditation",
"description": "Owner Accreditation level does not permit ownership change"
}
]
}