1. Introduction

This document contains generated documentation for AMPnet wallet service. Wallet service contains all endpoints need to manage user, project and organization wallets for AMPnet crowdfunding project. Source code is available on Github.

User with unverified account cannot reach wallet service except public routes. To verify check user service docs. Unverified accounts will get HTTP code 409

2. Public API

Collection of public endpoints

2.1. Active projects with wallet

Get all active projects with wallet. List of all organizations is pageable. Define size of the list using param: size and page number with param: page. List can be sorted using param: sort (e.g. sort=createdAt,desc).

Request
GET /public/project/active?size=20&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 939

{
  "projects" : [ {
    "project" : {
      "uuid" : "f1f7e54c-4fcb-4e61-a2bf-27463b4da93b",
      "name" : "name",
      "description" : "description",
      "start_date" : "1970-01-01T00:00:00Z",
      "end_date" : "2020-10-25T10:38:45.873Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image-url"
    },
    "wallet" : {
      "uuid" : "a582b5f6-2a0a-4816-b965-29866820cc35",
      "activation_data" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
      "type" : "PROJECT",
      "currency" : "EUR",
      "created_at" : "2020-09-25T10:38:45.868Z",
      "hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
      "activated_at" : "2020-09-25T10:38:45.868Z",
      "alias" : null,
      "balance" : 1000000000
    },
    "payout_in_process" : false
  } ],
  "page" : 0,
  "total_pages" : 1
}

2.2. Project Wallet

2.2.1. Successfully get wallet

Request
GET /public/wallet/project/0329db8e-1e85-46f7-a6c9-3b3936e49068 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 371

{
  "uuid" : "6fca0b0f-08cf-4000-9958-e3349d5a3627",
  "activation_data" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
  "type" : "PROJECT",
  "currency" : "EUR",
  "created_at" : "2020-09-25T10:38:45.929Z",
  "hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
  "activated_at" : "2020-09-25T10:38:45.929Z",
  "alias" : null,
  "balance" : 100
}

2.2.2. Missing project

Request
GET /public/wallet/project/22acca09-d69f-4150-b4ba-01f31178acd3 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 404 Not Found
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

3. Wallet API

All requests need header: Authorization: Bearer JWT.

3.1. Unverified user account

Request
POST /wallet HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: localhost:8080

{
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "alias" : "wallet_alias_is_optional"
}
Response
HTTP/1.1 409 Conflict
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

3.2. User Wallet

3.2.1. Pair wallet

Generate code
Request
POST /wallet/pair HTTP/1.1
Content-Type: application/json
Content-Length: 75
Host: localhost:8080

{
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 96

{
  "code" : "K0DGXS",
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp"
}
Get address for code
Request
GET /wallet/pair/N4CD12 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 96

{
  "code" : "N4CD12",
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp"
}

3.2.2. Get wallet for active user

Request
GET /wallet HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 380

{
  "uuid" : "2dbf0f8e-4021-476e-b73c-e0b17468cfd4",
  "activation_data" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "type" : "USER",
  "currency" : "EUR",
  "created_at" : "2020-09-25T10:38:46.722Z",
  "hash" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "activated_at" : "2020-09-25T10:38:46.722Z",
  "alias" : "wallet_alias",
  "balance" : 10000
}

3.2.3. Active user does not have a wallet

Request
GET /wallet HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 404 Not Found
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

3.2.4. Create Wallet

Create wallet for active user
alias data is optional.
Request
POST /wallet HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: localhost:8080

{
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "alias" : "wallet_alias_is_optional"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 319

{
  "uuid" : "5f52bb00-4cf3-4f8a-92d6-a311ba083f5f",
  "activation_data" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "type" : "USER",
  "currency" : "EUR",
  "created_at" : "2020-09-25T10:38:46.593Z",
  "hash" : null,
  "activated_at" : null,
  "alias" : "wallet_alias_is_optional",
  "balance" : null
}
Active user cannot create additional wallet
Request
POST /wallet HTTP/1.1
Content-Type: application/json
Content-Length: 115
Host: localhost:8080

{
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "alias" : "wallet_alias_is_optional"
}
Response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 172

{
  "description" : "Active user cannot create additional wallet",
  "err_code" : "0502",
  "message" : "User: 89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4 already has a wallet."
}

3.3. Organization Wallet

3.3.1. Get Organization wallet

Successfully get wallet
Request
GET /wallet/organization/1fab1ed1-aa25-4c1d-a337-2c563ea6a686 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 365

{
  "uuid" : "f7393bb7-fcc0-460d-9975-d8e60bd013cd",
  "activation_data" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "type" : "ORG",
  "currency" : "EUR",
  "created_at" : "2020-09-25T10:38:46.611Z",
  "hash" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "activated_at" : "2020-09-25T10:38:46.611Z",
  "alias" : null,
  "balance" : 0
}
Missing organization
Request
GET /wallet/organization/815f3c4b-9d4e-4634-ae3e-9c7b22feea46 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 404 Not Found
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

3.3.2. Get transaction for creating organization wallet

Request
GET /wallet/organization/643afd5c-1614-4ddf-b5b2-6ddb922930f5/transaction HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 268

{
  "tx" : "tx_+RFNCwH4QrhARSL55I0DqhQePPV3J4ycxHpA9OkqnncvEJrYOThmo2h...signed-tx...",
  "tx_id" : 16,
  "info" : {
    "tx_type" : "CREATE_ORG",
    "title" : "Create Organization",
    "description" : "You are signing transaction to create organization: Name"
  }
}

3.3.3. Generate transaction to create project wallet

Generate create project wallet transaction
Request
GET /wallet/project/12e7ece5-b043-4912-8dc7-d77168f2f97c/transaction HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 262

{
  "tx" : "tx_+RFNCwH4QrhARSL55I0DqhQePPV3J4ycxHpA9OkqnncvEJrYOThmo2h...signed-tx...",
  "tx_id" : 15,
  "info" : {
    "tx_type" : "CREATE_PROJECT",
    "title" : "Create Project",
    "description" : "You are signing transaction to create project: name"
  }
}

4. Broadcast API

4.1. Broadcast signed transaction

Request
POST /tx_broadcast HTTP/1.1
Content-Type: application/json
Content-Length: 108
Host: localhost:8080

{
  "tx_id" : 19,
  "tx_sig" : "tx_+RFNCwH4QrhARSL55I0DqhQePPV3J4ycxHpA9OkqnncvEJrYOThmo2h...signed-tx..."
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 35

{
  "tx_hash" : "activation_data"
}

4.2. Broadcast non existing transaction

Request
POST /tx_broadcast HTTP/1.1
Content-Type: application/json
Content-Length: 107
Host: localhost:8080

{
  "tx_id" : 0,
  "tx_sig" : "tx_+RFNCwH4QrhARSL55I0DqhQePPV3J4ycxHpA9OkqnncvEJrYOThmo2h...signed-tx..."
}
Response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 124

{
  "description" : "Non existing transaction",
  "err_code" : "0901",
  "message" : "Non existing transaction with id: 0"
}

5. Withdraw API

All requests need header: Authorization: Bearer JWT.

5.1. Create

5.1.1. User

Request
POST /withdraw HTTP/1.1
Content-Type: application/json
Content-Length: 72
Host: localhost:8080

{
  "amount" : 1000,
  "bank_account" : "AL35202111090000000001234567"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 336

{
  "id" : 31,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "amount" : 1000,
  "approved_tx_hash" : null,
  "approved_at" : null,
  "burned_tx_hash" : null,
  "burned_by" : null,
  "burned_at" : null,
  "bank_account" : "AL35202111090000000001234567",
  "created_at" : "2020-09-25T10:38:45.599Z",
  "document_response" : null
}

5.1.2. Project

Request
POST /withdraw/project/dc9d5514-b300-4323-9af2-c07eade1c63f HTTP/1.1
Content-Type: application/json
Content-Length: 72
Host: localhost:8080

{
  "amount" : 1000,
  "bank_account" : "AL35202111090000000001234567"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 336

{
  "id" : 37,
  "owner" : "dc9d5514-b300-4323-9af2-c07eade1c63f",
  "amount" : 1000,
  "approved_tx_hash" : null,
  "approved_at" : null,
  "burned_tx_hash" : null,
  "burned_by" : null,
  "burned_at" : null,
  "bank_account" : "AL35202111090000000001234567",
  "created_at" : "2020-09-25T10:38:45.782Z",
  "document_response" : null
}

5.2. Get pending

5.2.1. User

Request
GET /withdraw HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 320

{
  "id" : 33,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "amount" : 1000,
  "approved_tx_hash" : null,
  "approved_at" : null,
  "burned_tx_hash" : null,
  "burned_by" : null,
  "burned_at" : null,
  "bank_account" : "bank-account",
  "created_at" : "2020-09-25T10:38:45.668Z",
  "document_response" : null
}

5.2.2. Project

Request
GET /withdraw/project/bc811c00-fac6-4f85-8c5c-95f8887e757f HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 320

{
  "id" : 36,
  "owner" : "bc811c00-fac6-4f85-8c5c-95f8887e757f",
  "amount" : 1000,
  "approved_tx_hash" : null,
  "approved_at" : null,
  "burned_tx_hash" : null,
  "burned_by" : null,
  "burned_at" : null,
  "bank_account" : "bank-account",
  "created_at" : "2020-09-25T10:38:45.752Z",
  "document_response" : null
}

5.3. Delete

Request
DELETE /withdraw/34 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

5.4. Generate Approve Withdraw transaction

Request
POST /withdraw/32/transaction/approve HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 212

{
  "tx" : "approve-burn-transaction",
  "tx_id" : 10,
  "info" : {
    "tx_type" : "BURN_APPROVAL",
    "title" : "Approval",
    "description" : "You are singing approval transaction to burn amount: 1000"
  }
}

6. Deposit API

All requests need header: Authorization: Bearer JWT.

6.1. Create Deposit

6.1.1. User

Request
POST /deposit HTTP/1.1
Content-Type: application/json
Content-Length: 22
Host: localhost:8080

{
  "amount" : 30000
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 385

{
  "id" : 39,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "M41WQA34",
  "approved" : false,
  "created_at" : "2020-09-25T10:38:46.308Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : null,
  "amount" : 30000,
  "document_response" : null,
  "tx_hash" : null,
  "declined_at" : null,
  "declined_comment" : null
}

6.1.2. Project

Request
POST /deposit/project/d1d6e81a-0465-4f8a-9934-85d91b9f8d81 HTTP/1.1
Content-Type: application/json
Content-Length: 22
Host: localhost:8080

{
  "amount" : 30000
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 388

{
  "id" : 35,
  "owner" : "d1d6e81a-0465-4f8a-9934-85d91b9f8d81",
  "reference" : "3XMKWAB1",
  "approved" : false,
  "created_at" : "2020-09-25T10:38:46.228Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "PROJECT",
  "approved_at" : null,
  "amount" : 30000,
  "document_response" : null,
  "tx_hash" : null,
  "declined_at" : null,
  "declined_comment" : null
}

6.2. Get my pending Deposit

Request
GET /deposit HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 385

{
  "id" : 36,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "S34SDGFT",
  "approved" : false,
  "created_at" : "2020-09-25T10:38:46.261Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : null,
  "amount" : 10000,
  "document_response" : null,
  "tx_hash" : null,
  "declined_at" : null,
  "declined_comment" : null
}

6.3. Delete

Request
DELETE /deposit/33 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

7. Portfolio API

All requests need header: Authorization: Bearer JWT.

7.1. Get transactions with project

Request
GET /portfolio HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 908

{
  "portfolio" : [ {
    "project" : {
      "uuid" : "dd508244-c833-4e65-889e-ebf517067086",
      "name" : "name",
      "description" : "description",
      "start_date" : "1970-01-01T00:00:00Z",
      "end_date" : "2020-10-25T10:38:46.509Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image-url"
    },
    "investment" : 1000000
  }, {
    "project" : {
      "uuid" : "d094afb6-873e-4713-b7b3-3fb3d0a451be",
      "name" : "name",
      "description" : "description",
      "start_date" : "1970-01-01T00:00:00Z",
      "end_date" : "2020-10-25T10:38:46.509Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image-url"
    },
    "investment" : 5000000
  } ]
}

7.2. Get stats

Request
GET /portfolio/stats HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 104

{
  "investments" : 2000,
  "earnings" : 20,
  "date_of_first_investment" : "2019-09-25T10:38:46.405Z"
}

7.3. Get investments in project

Request
GET /portfolio/project/ee439f0f-7c0f-4c1e-95df-6d338517b38b HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 930

{
  "project" : {
    "uuid" : "ee439f0f-7c0f-4c1e-95df-6d338517b38b",
    "name" : "name",
    "description" : "description",
    "start_date" : "1970-01-01T00:00:00Z",
    "end_date" : "2020-10-25T10:38:46.474Z",
    "expected_funding" : 10000000,
    "currency" : "EUR",
    "min_per_user" : 100,
    "max_per_user" : 100000,
    "active" : true,
    "image_url" : "image-url"
  },
  "transactions" : [ {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000000,
    "type" : "INVEST",
    "date" : "2020-09-25T10:38:46.47Z",
    "state" : "MINED",
    "from" : null,
    "to" : null,
    "description" : null
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 500000,
    "type" : "INVEST",
    "date" : "2020-09-25T10:38:46.471Z",
    "state" : "MINED",
    "from" : null,
    "to" : null,
    "description" : null
  } ]
}

7.4. Get all transactions by user

Request
GET /portfolio/transactions HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1698

{
  "transactions" : [ {
    "from_tx_hash" : "mint",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 1000,
    "type" : "DEPOSIT",
    "date" : "2019-09-25T10:38:46.34Z",
    "state" : "MINED",
    "from" : "Platform",
    "to" : "First Last",
    "description" : null
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000,
    "type" : "APPROVE_INVESTMENT",
    "date" : "2020-08-25T10:38:46.34Z",
    "state" : "MINED",
    "from" : "First Last",
    "to" : "project",
    "description" : "project | 0.001%"
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000,
    "type" : "INVEST",
    "date" : "2020-08-25T10:38:46.34Z",
    "state" : "MINED",
    "from" : "First Last",
    "to" : "project",
    "description" : "project | 0.001%"
  }, {
    "from_tx_hash" : "project-wallet-hash",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 1000,
    "type" : "CANCEL_INVESTMENT",
    "date" : "2020-09-24T10:38:46.34Z",
    "state" : "MINED",
    "from" : "project",
    "to" : "First Last",
    "description" : "project | 0.001%"
  }, {
    "from_tx_hash" : "project-wallet-hash",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 10,
    "type" : "SHARE_PAYOUT",
    "date" : "2020-09-24T10:38:46.34Z",
    "state" : "MINED",
    "from" : "project",
    "to" : "First Last",
    "description" : "project"
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "burn",
    "amount" : 10,
    "type" : "WITHDRAW",
    "date" : "2020-09-25T10:38:46.34Z",
    "state" : "MINED",
    "from" : "First Last",
    "to" : "Platform",
    "description" : null
  } ]
}

8. Investment API

All requests need header: Authorization: Bearer JWT.

8.1. Generate transaction to invest in project

Request
POST /invest/project/b531a2d4-f153-4d9d-8eda-9a573fc96c6f HTTP/1.1
Content-Type: application/json
Content-Length: 22
Host: localhost:8080

{
  "amount" : 10000
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 202

{
  "tx" : "data",
  "tx_id" : 7,
  "info" : {
    "tx_type" : "INVEST",
    "title" : "Invest",
    "description" : "You are signing transaction to investment to project: name with amount 100.00"
  }
}

8.2. Generate transaction to cancel all investments in project

Request
POST /invest/project/929ba9a0-7ff4-4be3-accc-ed8146752913/cancel HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 214

{
  "tx" : "data",
  "tx_id" : 6,
  "info" : {
    "tx_type" : "CANCEL_INVEST",
    "title" : "Cancel Investments",
    "description" : "You are signing transaction to cancel all investments in project: name"
  }
}

9. Cooperative API

Cooperative API is used to handel all operations from cooperative administration. Provided actions are: wallet activations, withdraws and deposits. For each action user must have admin privileges.

9.1. Wallet Activation

9.1.1. Get unactivated wallets

Must have Admin role - privilege: PrivilegeType.PRA_WALLET

User wallets
Request
GET /cooperative/wallet/user?size=20&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1086

{
  "users" : [ {
    "user" : {
      "uuid" : "4762fb33-024d-47c9-8880-4a0d7b9de87d",
      "email" : "email@mail.com",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "wallet" : {
      "uuid" : "cf1fb136-2648-44a5-bdbc-5bf0d2099088",
      "activation_data" : "activation-data-2",
      "type" : "USER",
      "currency" : "EUR",
      "created_at" : "2020-09-25T10:38:46.11Z",
      "hash" : null,
      "activated_at" : null,
      "alias" : null,
      "balance" : null
    }
  }, {
    "user" : {
      "uuid" : "775618ac-9587-401f-815b-cb93b70304d7",
      "email" : "email@mail.com",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "wallet" : {
      "uuid" : "c7de8453-e9f4-4368-a167-6347fbb9f3de",
      "activation_data" : "activation-data-1",
      "type" : "USER",
      "currency" : "EUR",
      "created_at" : "2020-09-25T10:38:46.109Z",
      "hash" : null,
      "activated_at" : null,
      "alias" : null,
      "balance" : null
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Organization wallets
Request
GET /cooperative/wallet/organization?size=20&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1047

{
  "organizations" : [ {
    "organization" : {
      "uuid" : "7b8cbbb6-f5ec-4a83-9f40-85a699719339",
      "name" : "Name",
      "created_at" : "1970-01-19T12:42:23.926Z",
      "approved" : true
    },
    "wallet" : {
      "uuid" : "4c0f911a-50b2-43a1-ba66-e76b29c73f5c",
      "activation_data" : "org-2",
      "type" : "ORG",
      "currency" : "EUR",
      "created_at" : "2020-09-25T10:38:46.041Z",
      "hash" : null,
      "activated_at" : null,
      "alias" : null,
      "balance" : null
    }
  }, {
    "organization" : {
      "uuid" : "86c603a2-02b5-4bd5-8660-b84c380505b3",
      "name" : "Name",
      "created_at" : "1970-01-19T12:42:23.926Z",
      "approved" : true
    },
    "wallet" : {
      "uuid" : "1e31eba0-3972-4534-bc31-0e44a8f3c27e",
      "activation_data" : "org-1",
      "type" : "ORG",
      "currency" : "EUR",
      "created_at" : "2020-09-25T10:38:46.039Z",
      "hash" : null,
      "activated_at" : null,
      "alias" : null,
      "balance" : null
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Project wallets
Request
GET /cooperative/wallet/project?size=20&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1578

{
  "projects" : [ {
    "project" : {
      "uuid" : "d3fed4ce-e137-4c01-81d0-7758933a7c8a",
      "name" : "name",
      "description" : "description",
      "start_date" : "1970-01-01T00:00:00Z",
      "end_date" : "2020-10-25T10:38:46.087Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image-url"
    },
    "wallet" : {
      "uuid" : "576b7930-8198-4b95-b526-630882c05dad",
      "activation_data" : "project-2",
      "type" : "PROJECT",
      "currency" : "EUR",
      "created_at" : "2020-09-25T10:38:46.083Z",
      "hash" : null,
      "activated_at" : null,
      "alias" : null,
      "balance" : null
    },
    "payout_in_process" : null
  }, {
    "project" : {
      "uuid" : "110ed974-7ac0-4982-86f8-4dcf97ef1dd1",
      "name" : "name",
      "description" : "description",
      "start_date" : "1970-01-01T00:00:00Z",
      "end_date" : "2020-10-25T10:38:46.087Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image-url"
    },
    "wallet" : {
      "uuid" : "4f23b4d3-3a56-40ea-ab38-64d8e30495eb",
      "activation_data" : "project-1",
      "type" : "PROJECT",
      "currency" : "EUR",
      "created_at" : "2020-09-25T10:38:46.081Z",
      "hash" : null,
      "activated_at" : null,
      "alias" : null,
      "balance" : null
    },
    "payout_in_process" : null
  } ],
  "page" : 0,
  "total_pages" : 1
}

9.1.2. Generate wallet activation transaction

Must have Admin role - privilege: PrivilegeType.PWA_WALLET

Request
POST /cooperative/wallet/ae850898-8fff-49af-ad03-aba582e5e1dd/transaction HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 262

{
  "tx" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
  "tx_id" : 12,
  "info" : {
    "tx_type" : "WALLET_ACTIVATE",
    "title" : "Wallet Activation",
    "description" : "You are signing transaction to activate wallet type: WALLET_ACTIVATE"
  }
}

9.2. Generate transfer wallet ownership

Must have privilege: PrivilegeType.PWA_WALLET_TRANSFER

9.2.1. Token issuer

Request
POST /cooperative/wallet/transfer/transaction HTTP/1.1
Content-Type: application/json
Content-Length: 85
Host: localhost:8080

{
  "user_uuid" : "de82c422-7d47-4009-a987-047de8ee3d46",
  "type" : "TOKEN_ISSUER"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 309

{
  "tx" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
  "tx_id" : 13,
  "info" : {
    "tx_type" : "TRNSF_TOKEN_OWN",
    "title" : "Transfer token ownership",
    "description" : "You are signing transaction to transfer token issuer ownership to user: de82c422-7d47-4009-a987-047de8ee3d46"
  }
}

9.2.2. Platform manager

Request
POST /cooperative/wallet/transfer/transaction HTTP/1.1
Content-Type: application/json
Content-Length: 89
Host: localhost:8080

{
  "user_uuid" : "2851170d-2bc5-4499-b717-6f2e6548cd8c",
  "type" : "PLATFORM_MANAGER"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 317

{
  "tx" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
  "tx_id" : 14,
  "info" : {
    "tx_type" : "TRNSF_PLTFRM_OWN",
    "title" : "Transfer platform ownership",
    "description" : "You are signing transaction to transfer platform manager ownership to user: 2851170d-2bc5-4499-b717-6f2e6548cd8c"
  }
}

9.3. Withdraw

9.3.1. Approved Withdraws

Must have Admin role - privilege: PrivilegeType.PRA_WITHDRAW

User
Request
GET /cooperative/withdraw/approved?size=1&page=0&sort=approvedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 648

{
  "withdraws" : [ {
    "id" : 24,
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "email@mail.com",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "amount" : 1000,
    "approved_tx_hash" : "approved-tx",
    "approved_at" : "2020-09-25T10:38:44.822Z",
    "burned_tx_hash" : null,
    "burned_by" : null,
    "burned_at" : null,
    "created_at" : "2020-09-25T10:38:44.822Z",
    "bank_account" : "bank-account",
    "user_wallet" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
    "document_response" : null
  } ],
  "page" : 0,
  "total_pages" : 2
}
Project
Request
GET /cooperative/withdraw/approved/project?size=1&page=0&sort=approvedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 883

{
  "withdraws" : [ {
    "id" : 28,
    "project" : {
      "uuid" : "f7330e95-7152-4070-86fc-0f3f9ce8bcd3",
      "name" : "Project name",
      "description" : "Description",
      "start_date" : "1970-01-19T12:42:23.924Z",
      "end_date" : "1970-01-19T13:27:02.324Z",
      "expected_funding" : 1000000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 1000000,
      "active" : true,
      "image_url" : "image-url"
    },
    "amount" : 1000,
    "approved_tx_hash" : "approved-tx",
    "approved_at" : "2020-09-25T10:38:44.855Z",
    "burned_tx_hash" : null,
    "burned_by" : null,
    "burned_at" : null,
    "created_at" : "2020-09-25T10:38:44.855Z",
    "bank_account" : "bank-account",
    "project_wallet" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
    "document_response" : null
  } ],
  "page" : 0,
  "total_pages" : 2
}

9.3.2. Burned Withdraws

Must have Admin role - privilege: PrivilegeType.PRA_WITHDRAW

User
Request
GET /cooperative/withdraw/burned?size=20&page=0&sort=burnedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 893

{
  "withdraws" : [ {
    "id" : 18,
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "email@mail.com",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "amount" : 1000,
    "approved_tx_hash" : "approved-tx",
    "approved_at" : "2020-09-25T10:38:44.672Z",
    "burned_tx_hash" : "burned-tx",
    "burned_by" : "656743a9-f254-4e99-832b-192b3b889a26",
    "burned_at" : "2020-09-25T10:38:44.672Z",
    "created_at" : "2020-09-25T10:38:44.672Z",
    "bank_account" : "AL35202111090000000001234567",
    "user_wallet" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
    "document_response" : {
      "id" : 8,
      "link" : "doc-link",
      "name" : "withdraw-doc",
      "type" : "type",
      "size" : 1,
      "created_at" : "2020-09-25T10:38:44.671Z"
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Project
Request
GET /cooperative/withdraw/burned/project?size=20&page=0&sort=burnedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1129

{
  "withdraws" : [ {
    "id" : 21,
    "project" : {
      "uuid" : "862c50a2-9d8a-4f76-b251-371555812e1e",
      "name" : "Project name",
      "description" : "Description",
      "start_date" : "1970-01-19T12:42:23.924Z",
      "end_date" : "1970-01-19T13:27:02.324Z",
      "expected_funding" : 1000000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 1000000,
      "active" : true,
      "image_url" : "image-url"
    },
    "amount" : 1000,
    "approved_tx_hash" : "approved-tx",
    "approved_at" : "2020-09-25T10:38:44.763Z",
    "burned_tx_hash" : "burned-tx",
    "burned_by" : "3c14add6-751c-4d6f-84d8-2c4389b36fb9",
    "burned_at" : "2020-09-25T10:38:44.763Z",
    "created_at" : "2020-09-25T10:38:44.763Z",
    "bank_account" : "AL35202111090000000001234567",
    "project_wallet" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
    "document_response" : {
      "id" : 10,
      "link" : "doc-link",
      "name" : "withdraw-doc",
      "type" : "type",
      "size" : 1,
      "created_at" : "2020-09-25T10:38:44.762Z"
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}

9.3.3. Upload Document

Must have Admin role - privilege: PrivilegeType.PRA_WITHDRAW

Request
POST /cooperative/withdraw/16/document HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=test.txt
Content-Type: text/plain

DocumentData
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 505

{
  "id" : 16,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "amount" : 1000,
  "approved_tx_hash" : "approved-tx",
  "approved_at" : "2020-09-25T10:38:44.574Z",
  "burned_tx_hash" : null,
  "burned_by" : null,
  "burned_at" : null,
  "bank_account" : "bank-account",
  "created_at" : "2020-09-25T10:38:44.574Z",
  "document_response" : {
    "id" : 7,
    "link" : "doc-link",
    "name" : "test.txt",
    "type" : "text/plain",
    "size" : 12,
    "created_at" : "2020-09-25T10:38:44.59Z"
  }
}

9.3.4. Generate Burn Withdraw transaction

Must have Admin role - privilege: PrivilegeType.PWA_WITHDRAW

Request
POST /cooperative/withdraw/15/transaction/burn HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 190

{
  "tx" : "approve-burn-transaction",
  "tx_id" : 8,
  "info" : {
    "tx_type" : "BURN",
    "title" : "Burn",
    "description" : "You are singing burn transaction for amount: 1000"
  }
}

9.4. Deposit

9.4.1. Get Deposits

Must have Admin role - privilege: PRA_DEPOSIT

Search by reference
Request
GET /cooperative/deposit/search?reference=S34SDGFT HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 609

{
  "deposit" : {
    "id" : 19,
    "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "reference" : "S34SDGFT",
    "approved" : false,
    "created_at" : "2020-09-25T10:38:45.096Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "type" : "USER",
    "approved_at" : null,
    "amount" : 10000,
    "document_response" : null,
    "tx_hash" : null,
    "declined_at" : null,
    "declined_comment" : null
  },
  "user" : {
    "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "email" : "email@mail.com",
    "first_name" : "First",
    "last_name" : "Last",
    "enabled" : true
  }
}
Unapproved
Users
Request
GET /cooperative/deposit/unapproved?size=20&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 713

{
  "deposits" : [ {
    "deposit" : {
      "id" : 13,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "reference" : "S34SDGFT",
      "approved" : false,
      "created_at" : "2020-09-25T10:38:44.966Z",
      "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "type" : "USER",
      "approved_at" : null,
      "amount" : 10000,
      "document_response" : null,
      "tx_hash" : null,
      "declined_at" : null,
      "declined_comment" : null
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "email@mail.com",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Projects
Request
GET /cooperative/deposit/unapproved/project?size=20&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 948

{
  "deposits" : [ {
    "deposit" : {
      "id" : 24,
      "owner" : "35835c9e-b83c-4876-8597-701b7bab9155",
      "reference" : "S34SDGFT",
      "approved" : false,
      "created_at" : "2020-09-25T10:38:45.199Z",
      "created_by" : "35835c9e-b83c-4876-8597-701b7bab9155",
      "type" : "PROJECT",
      "approved_at" : null,
      "amount" : 10000,
      "document_response" : null,
      "tx_hash" : null,
      "declined_at" : null,
      "declined_comment" : null
    },
    "project" : {
      "uuid" : "35835c9e-b83c-4876-8597-701b7bab9155",
      "name" : "Project name",
      "description" : "Description",
      "start_date" : "1970-01-19T12:42:23.925Z",
      "end_date" : "1970-01-19T13:27:02.325Z",
      "expected_funding" : 1000000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 1000000,
      "active" : true,
      "image_url" : "image-url"
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Approved
Users
Request
GET /cooperative/deposit/approved?size=20&page=0&sort=approvedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 910

{
  "deposits" : [ {
    "deposit" : {
      "id" : 16,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "reference" : "S34SDGFT",
      "approved" : true,
      "created_at" : "2020-09-25T10:38:45.006Z",
      "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "type" : "USER",
      "approved_at" : "2020-09-25T10:38:45.006Z",
      "amount" : 1000,
      "document_response" : {
        "id" : 14,
        "link" : "document-link",
        "name" : "doc",
        "type" : "type",
        "size" : 1,
        "created_at" : "2020-09-25T10:38:45.005Z"
      },
      "tx_hash" : null,
      "declined_at" : null,
      "declined_comment" : null
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "email@mail.com",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Projects
Request
GET /cooperative/deposit/approved/project?size=20&page=0&sort=approvedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1141

{
  "deposits" : [ {
    "deposit" : {
      "id" : 12,
      "owner" : "e74e5e3c-760f-44e6-a9e0-307c1be0bc6c",
      "reference" : "S34SDGFT",
      "approved" : true,
      "created_at" : "2020-09-25T10:38:44.9Z",
      "created_by" : "e74e5e3c-760f-44e6-a9e0-307c1be0bc6c",
      "type" : "PROJECT",
      "approved_at" : "2020-09-25T10:38:44.9Z",
      "amount" : 1000,
      "document_response" : {
        "id" : 12,
        "link" : "document-link",
        "name" : "doc",
        "type" : "type",
        "size" : 1,
        "created_at" : "2020-09-25T10:38:44.899Z"
      },
      "tx_hash" : null,
      "declined_at" : null,
      "declined_comment" : null
    },
    "project" : {
      "uuid" : "e74e5e3c-760f-44e6-a9e0-307c1be0bc6c",
      "name" : "Project name",
      "description" : "Description",
      "start_date" : "1970-01-19T12:42:23.924Z",
      "end_date" : "1970-01-19T13:27:02.324Z",
      "expected_funding" : 1000000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 1000000,
      "active" : true,
      "image_url" : "image-url"
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Unsigned
Users
Request
GET /cooperative/deposit/unsigned?size=20&page=0&sort=approvedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 960

{
  "deposits" : [ {
    "deposit" : {
      "id" : 22,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "reference" : "S34SDGFT",
      "approved" : true,
      "created_at" : "2020-09-25T10:38:45.148Z",
      "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "type" : "USER",
      "approved_at" : "2020-09-25T10:38:45.148Z",
      "amount" : 1000,
      "document_response" : {
        "id" : 18,
        "link" : "document-link",
        "name" : "doc",
        "type" : "type",
        "size" : 1,
        "created_at" : "2020-09-25T10:38:45.147Z"
      },
      "tx_hash" : "th_ktDw9ytaQ9aSi78qgCAw2JhdzS8F7vGgzYvWeMdRtP6hJnQqG",
      "declined_at" : null,
      "declined_comment" : null
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "email@mail.com",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}
Projects
Request
GET /cooperative/deposit/unsigned/project?size=20&page=0&sort=approvedAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1147

{
  "deposits" : [ {
    "deposit" : {
      "id" : 18,
      "owner" : "d87979d0-406e-4e9e-88cb-6088e32f1f8e",
      "reference" : "S34SDGFT",
      "approved" : true,
      "created_at" : "2020-09-25T10:38:45.034Z",
      "created_by" : "d87979d0-406e-4e9e-88cb-6088e32f1f8e",
      "type" : "PROJECT",
      "approved_at" : "2020-09-25T10:38:45.034Z",
      "amount" : 1000,
      "document_response" : {
        "id" : 16,
        "link" : "document-link",
        "name" : "doc",
        "type" : "type",
        "size" : 1,
        "created_at" : "2020-09-25T10:38:45.033Z"
      },
      "tx_hash" : "fdas",
      "declined_at" : null,
      "declined_comment" : null
    },
    "project" : {
      "uuid" : "d87979d0-406e-4e9e-88cb-6088e32f1f8e",
      "name" : "Project name",
      "description" : "Description",
      "start_date" : "1970-01-19T12:42:23.925Z",
      "end_date" : "1970-01-19T13:27:02.325Z",
      "expected_funding" : 1000000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 1000000,
      "active" : true,
      "image_url" : "image-url"
    }
  } ],
  "page" : 0,
  "total_pages" : 1
}

9.4.2. Approve Deposit

Must have Admin role - privilege: PWA_DEPOSIT

Request
POST /cooperative/deposit/23/approve?amount=30000 HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Host: localhost:8080

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=amount

30000
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=test.txt
Content-Type: text/plain

Some document data
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 567

{
  "id" : 23,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "S34SDGFT",
  "approved" : true,
  "created_at" : "2020-09-25T10:38:45.169Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : "2020-09-25T10:38:45.177Z",
  "amount" : 30000,
  "document_response" : {
    "id" : 19,
    "link" : "document-link",
    "name" : "test.txt",
    "type" : "text/plain",
    "size" : 18,
    "created_at" : "2020-09-25T10:38:45.176Z"
  },
  "tx_hash" : null,
  "declined_at" : null,
  "declined_comment" : null
}

9.4.3. Decline Deposit

Must have Admin role - privilege: PWA_DEPOSIT. Cannot decline minted deposit.

Request
POST /cooperative/deposit/32/decline HTTP/1.1
Content-Type: application/json
Content-Length: 28
Host: localhost:8080

{
  "comment" : "Decline!"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 413

{
  "id" : 32,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "S34SDGFT",
  "approved" : false,
  "created_at" : "2020-09-25T10:38:45.297Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : null,
  "amount" : 10000,
  "document_response" : null,
  "tx_hash" : null,
  "declined_at" : "2020-09-25T10:38:45.308Z",
  "declined_comment" : "Decline!"
}

9.4.4. Generate Mint transaction

Must have Admin role - privilege: PWA_DEPOSIT

Request
POST /cooperative/deposit/26/transaction HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 232

{
  "tx" : "signed-transaction",
  "tx_id" : 9,
  "info" : {
    "tx_type" : "MINT",
    "title" : "Mint",
    "description" : "You are singing mint transaction for wallet: th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu"
  }
}

9.5. Count users with approved deposit

Count all users with at least one approved deposit

Request
GET /cooperative/deposit/count HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 39

{
  "users_with_approved_deposit" : 2
}

10. Revenue

10.1. Generate transaction for revenue payout

Request
POST /revenue/payout/project/25f89953-6160-424c-9bc1-5f272940f08e HTTP/1.1
Content-Type: application/json
Content-Length: 22
Host: localhost:8080

{
  "amount" : 10000
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 218

{
  "tx" : "data",
  "tx_id" : 17,
  "info" : {
    "tx_type" : "REVENUE_PAYOUT",
    "title" : "Revenue Payout",
    "description" : "You are signing transaction to start revenue payout 100.00 for project: name"
  }
}

10.2. Get revenue payouts for project

Request
GET /revenue/payout/project/5aebd0fe-2cc3-4380-8def-243acadca319?size=20&page=0&sort=createdAt%2Cdesc HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 546

{
  "revenue_payouts" : [ {
    "project_uuid" : "5aebd0fe-2cc3-4380-8def-243acadca319",
    "amount" : 55,
    "created_at" : "2020-09-25T10:38:46.883Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "tx_hash" : null,
    "completed_at" : null
  }, {
    "project_uuid" : "5aebd0fe-2cc3-4380-8def-243acadca319",
    "amount" : 100,
    "created_at" : "2020-09-25T10:38:46.882Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "tx_hash" : null,
    "completed_at" : null
  } ],
  "page" : 0,
  "total_pages" : 1
}

11. Bank Account

11.1. Get all

Request
GET /bank-account HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 258

{
  "bank_accounts" : [ {
    "id" : 2,
    "iban" : "HR1723600001101234565",
    "bank_code" : "DABAIE2D",
    "alias" : "alias"
  }, {
    "id" : 3,
    "iban" : "AL47212110090000000235698741",
    "bank_code" : "AKIVALTR",
    "alias" : "albalias"
  } ]
}

11.2. Create

Must have privilege - PWA_DEPOSIT

Request
POST /bank-account HTTP/1.1
Content-Type: application/json
Content-Length: 87
Host: localhost:8080

{
  "iban" : "HR1723600001101234565",
  "bank_code" : "DABAIE2D",
  "alias" : "alias"
}
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 99

{
  "id" : 4,
  "iban" : "HR1723600001101234565",
  "bank_code" : "DABAIE2D",
  "alias" : "alias"
}

11.3. Delete

Must have privilege - PWA_DEPOSIT

Request
DELETE /bank-account/1 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

12. Sell Offer

Request
GET /sell/offer HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 2359

{
  "projects" : [ {
    "project" : {
      "uuid" : "b5a3fc6e-22ce-4fe2-a6e2-f2c1996a76bc",
      "name" : "name",
      "description" : "description",
      "start_date" : "1970-01-01T00:00:00Z",
      "end_date" : "2020-10-25T10:38:45.341Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image-url"
    },
    "sell_offers" : [ {
      "project_wallet_hash" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
      "seller_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
      "shares" : 2,
      "price" : 2,
      "counter_offers" : [ {
        "buyer_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
        "price" : 1
      } ]
    }, {
      "project_wallet_hash" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
      "seller_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
      "shares" : 22,
      "price" : 22,
      "counter_offers" : [ {
        "buyer_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
        "price" : 1
      } ]
    } ]
  }, {
    "project" : {
      "uuid" : "4400d3bc-6ca7-48fb-bee1-60d84a782465",
      "name" : "name",
      "description" : "description",
      "start_date" : "1970-01-01T00:00:00Z",
      "end_date" : "2020-10-25T10:38:45.341Z",
      "expected_funding" : 10000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image-url"
    },
    "sell_offers" : [ {
      "project_wallet_hash" : "th_HKYbpdgc8yhGvMaEmpk2KK9AXE3yz8kf5imyv52XVwcnqZKei",
      "seller_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
      "shares" : 1,
      "price" : 1,
      "counter_offers" : [ {
        "buyer_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
        "price" : 1
      } ]
    }, {
      "project_wallet_hash" : "th_HKYbpdgc8yhGvMaEmpk2KK9AXE3yz8kf5imyv52XVwcnqZKei",
      "seller_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
      "shares" : 11,
      "price" : 11,
      "counter_offers" : [ {
        "buyer_wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
        "price" : 1
      } ]
    } ]
  } ]
}