Assets
Create an asset
POST https://api.borlaug.network/ar/registries/:registryid/assets
Path Parameters
registryid
string
Registry in which assets are created
Headers
BWS-Idempotency-Key
string
Authorization
string
Content-Type
string
application/json
Request Body
owner_did
string
properties
array
See below
total_shares
string
Shares can be assigned to lessees
residual_value
number
Price after depreciation
status
string
DRAFT, ACTIVE, INACTIVE
serial_number
string
Serial number
purchase_value
number
Original value
acquired_date
string
Purchased date in ISO8601 format
number
string
Asset number
name
string
Asset name
{
    "result": "success",
    "id": "0",
    "timestamp": "2020-04-01T13:38:12.006542600",
    "block": "0x1aff8b9873e253356772f6e4c897ff8f03670dca07889493687532c0082b6112",
    "extrinsic": "0x97ab492c61f3a0d2ae2a6494d412665dff83ee7d0c51000629aff58d55b410b9"
}{
    "code": 422,
    "type": "UnprocessableEntity",
    "error": "Json deserialize error: missing field `owner_did` at line 3 column 1"
}{
	"owner_did": "0x1aff8b9873e253356772f6e4c897ff8f03670dca07889493687532c0082b6112",
	"name": "Olive Tree",
	"number": "TREE-023",
  "total_shares": 100,
  "status":"DRAFT",
	"serial_number":"5",
	"purchase_value":50,
	"aquired_date":"2021-02-22",
	"residual_value":20,
	"properties":[
		{
	      "name": "Location",
	      "private": false,
	      "type": "Text",
	      "value": "Spain"
	    },{
	      "name": "Farmer Name",
	      "private": true,
	      "type": "Text",
	      "value": "Juan Andres"
	    }
	]
}Get Assets
GET https://api.borlaug.network/ar/registries/:registryid/assets
Retrieve all assets in a given registry
Path Parameters
registryid
number
Registry from which assets are to be retrieved
Query Parameters
filter_asset_number
string
page
number
For pagination zero based
per_page
number
Items per page
Headers
BWS-Idempotency-Key
string
Authorization
string
BWS authorization token
{
    "assets": [
        {
            "registry_id": 0,
            "asset_id": 0,
            "asset_number": "TREE-023",
            "name": "Olive Tree",
            "residual_value": 20,
            "status": "Draft",
            "serial_number": "5",
            "purchase_value": 50,
            "total_shares": 100,
            "created": "2020-04-01T13:38:12.006542",
            "block": "0x1aff8b9873e253356772f6e4c897ff8f03670dca07889493687532c0082b6112",
            "extrinsic": "0x97ab492c61f3a0d2ae2a6494d412665dff83ee7d0c51000629aff58d55b410b9"
        }
    ]
}{
    "assets": [
        {
            "registry_id": 0,
            "asset_id": 0,
            "asset_number": "TREE-023",
            "name": "Olive Tree",
            "residual_value": 20,
            "status": "Draft",
            "serial_number": "5",
            "purchase_value": 50,
            "total_shares": 100,
            "created": "2020-04-01T13:38:12.006542",
            "block": "0x1aff8b9873e253356772f6e4c897ff8f03670dca07889493687532c0082b6112",
            "extrinsic": "0x97ab492c61f3a0d2ae2a6494d412665dff83ee7d0c51000629aff58d55b410b9"
        }
    ],
    "total": 1
}Update an asset
PATCH https://api.borlaug.network/ar/registries/:registryid/assets/:assetid
Updates any asset properties
Path Parameters
assetid
number
Asset to be updated
registryid
string
Registry where asset is located
Headers
BWS-Idempotency-Key
string
Content-Type
string
application/json
Authorization
string
{
    "result": "success",
    "message": "Asset Updated",
    "timestamp": "2020-04-01T14:36:12.005936100",
    "block": "0x7c4233c40c4b6a05ad7c0e3c08048006d480153f3b61f068d9e75313afb56afc",
    "extrinsic": "0xfbe605ff19f20daa1e7d9a246d1752597c27f13f3981c1ee00ce762e62eaa40d"
}{
	"owner_did": "0x1aff8b9873e253356772f6e4c897ff8f03670dca07889493687532c0082b6112",
	"name": "Olive Tree",
	"number": "TREE-023",
    "total_shares": 250000,
    "status":"DRAFT",
	"serial_number":"5",
	"purchase_value":50,
	"aquired_date":"2021-02-22T12:00:00",
	"residual_value":20
}Get an asset
GET https://api.borlaug.network/ar/registries/:registryid/assets/:assetid
Retrieve an asset
Path Parameters
assetid
number
On chain asset Id
registryid
number
Registry
Headers
BWS-Idempotency-Key
string
Authorization
string
{
    "asset_id": 0,
    "properties": [
        {
            "name": "Location",
            "fact": {
                "type": "Text",
                "value": "Spain"
            },
            "private": false
        },
        {
            "name": "Farmer Name",
            "fact": {
                "type": "Text",
                "value": "Juan Andres"
            },
            "private": true
        }
    ],
    "residual_value": 20,
    "status": "Draft",
    "serial_number": "5",
    "purchase_value": 50,
    "asset_number": "TREE-023",
    "name": "Olive Tree",
    "total_shares": 100,
    "block": "0x1aff8b9873e253356772f6e4c897ff8f03670dca07889493687532c0082b6112",
    "extrinsic": "0x97ab492c61f3a0d2ae2a6494d412665dff83ee7d0c51000629aff58d55b410b9"
}Get leases
GET https://api.borlaug.network/ar/registries/:registryid/assets/:assetid/leases
Find which leases the asset is on and what the current allocations are.
Path Parameters
registryid
number
assetid
number
Headers
Authorization
string
{
    "leases": []
}Get allocations
GET https://api.borlaug.network/ar/registries/:registryid/assets/:assetid/allocations
Path Parameters
assetid
number
registryid
number
Headers
Authorization
string
{
    "allocations": []
}Delete an asset
DELETE https://api.borlaug.network/ar/registries/:registryid/assets/:assetid
Assets can be deleted if ther'es no active lease.
Path Parameters
registryid
number
Registry where asset is located
assetid
number
Asset to be deleted
{
    "result": "success",
    "message": "Asset Deleted",
    "timestamp": "2020-04-01T15:38:42.515519200",
    "block": "0x9f2c35e7e9b50e1dc91ee7258d124bea605976cf069115bd2a3b157fd79e678a",
    "extrinsic": "0x606339c982b6a9a480f4932e784d70e7fa5d0eefd1d47d93583cc26351a93eab"
}{
	"owner_did": "0x1aff8b9873e253356772f6e4c897ff8f03670dca07889493687532c0082b6112"
}Last updated
Was this helpful?