Lease

API for lease contract management

Creates a new lease contract

POST https://api.borlaug.network/ar/leases

This endpoint allows you to get free cakes.

Headers

Name
Type
Description

Authentication

string

Authentication token to track down who is emptying our stocks.

Request Body

Name
Type
Description

term

object

Term of the lease

assets

array

Asset id and number of shares being assigned

lessee

string

DID of lessee

contract_number

string

Add one or more lessees

{
    "result": "success",
    "id": "0",
    "timestamp": "2020-04-01T15:40:00.006794700",
    "block": "0xe03cc23c26b7f710adb17119341809e8f4a10b51debf1310de895ab87b2ca1ed",
    "extrinsic": "0x064bd29d21a2dd4dfc3fb5d9c8fca41150304177fdd95415f885cc574cdfd62b"
}
{
  contract_number: "ABC",
  "lessor": "0x9f2c35e7e9b50e1dc91ee7258d124bea605976cf069115bd2a3b157fd79e678a",
  lessee: "0x8cf2f6310cc95c7780cc2390ae579fd93320bea3ecae91b237e61812caa3a929",
  assets: [
    {
      "registry_id": 10,
      "asset_id": 1,
      "allocated_shares": 50
    },
    {
      "registry_id": 10,
      "asset_id": 2,
      "allocated_shares": 20
    }    
  ],
  term: {
    "from_iso": "2019-10-05T14:48:00.000",
    "to_iso": "2020-10-05T14:48:00.000"  
  }  
}

Get all leases by creator

GET https://api.borlaug.network/ar/leases

Path Parameters

Name
Type
Description

string

Headers

Name
Type
Description

Authentication

string

{
    "leases": [
        {
            "lease_id": 0,
            "contract_number": "ABC",
            "lessee_did": "0x8cf2f6310cc95c7780cc2390ae579fd93320bea3ecae91b237e61812caa3a929",
            "from_iso": "2019-10-05T14:48:00",
            "to_iso": "2020-10-05T14:48:00",
            "allocations": null,
            "created_by": "5EZ7gNcZidoanKK45JK4YVQNDpEScbcCNbV4BU7fJWJdAFsu",
            "created": "2020-03-27T13:09:18.515269",
            "block": "0x5eec47ab807ddf913f27a118d813a21a6b6dd6bc6c30669cd9e53983d00dc2dd",
            "extrinsic": "0xc32f9565a6c754ec0a407adf04b7d08a91215f87f27b6a32ebf38ab246a9cbd5"
        }
    ]
}

Get a Lease

GET https://api.borlaug.network/ar/leases/:leaseid

Path Parameters

Name
Type
Description

string

Headers

Name
Type
Description

Authentication

string

{
    "lease_id": 0,
    "contract_number": "ABC",
    "lessee_did": "0x8cf2f6310cc95c7780cc2390ae579fd93320bea3ecae91b237e61812caa3a929",
    "from_iso": "2019-10-05T14:48:00",
    "to_iso": "2020-10-05T14:48:00",
    "allocations": [
        {
            "registry_id": 1,
            "asset_id": 1,
            "allocated_shares": 50
        },
        {
            "registry_id": 0,
            "asset_id": 1,
            "allocated_shares": 50
        }
    ],
    "created_by": "5EZ7gNcZidoanKK45JK4YVQNDpEScbcCNbV4BU7fJWJdAFsu",
    "created": "2020-03-27T13:09:18.515269",
    "block": "0x5eec47ab807ddf913f27a118d813a21a6b6dd6bc6c30669cd9e53983d00dc2dd",
    "extrinsic": "0xc32f9565a6c754ec0a407adf04b7d08a91215f87f27b6a32ebf38ab246a9cbd5"
}

Void contract

DELETE https://api.borlaug.network/ar/leases/:leaseid

Makes a contract void

Path Parameters

Name
Type
Description

leaseid

number

Lease contract id

Headers

Name
Type
Description

Authentication

string

Request Body

Name
Type
Description

lessor

string

Did of lessor (caller)

{
    "lessor":"0x3863ca92d8afd54a45547a7c3e840d3dbb626f0d1919001dff328fc868fe4d6e"
}

Last updated

Was this helpful?