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. Project Wallet

2.1.1. Successfully get wallet

Request
GET /public/wallet/project/3a702851-b6ac-455a-acd4-bcc2c69e2709 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: 421

{
  "uuid" : "cec4ce9e-e487-4e1e-92a5-97dd1a41250f",
  "activation_data" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
  "type" : "PROJECT",
  "currency" : "EUR",
  "created_at" : "2021-04-01T15:05:35.056Z",
  "coop" : "ampnet-test",
  "hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu",
  "activated_at" : "2021-04-01T15:05:35.056Z",
  "email" : null,
  "balance" : 100,
  "provider_id" : null
}

2.1.2. Missing project

Request
GET /public/wallet/project/feb9cfab-160e-47c2-9712-2684b91b229c 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: 167
Host: localhost:8080

{
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "email" : "[email protected]",
  "provider_id" : "provider_id_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" : "A41D3L",
  "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: 451

{
  "uuid" : "766d3ca2-8db6-4869-9165-130399ac2b34",
  "activation_data" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "type" : "USER",
  "currency" : "EUR",
  "created_at" : "2021-04-01T15:05:38.891Z",
  "coop" : "ampnet-test",
  "hash" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "activated_at" : "2021-04-01T15:05:38.891Z",
  "email" : "wallet_email",
  "balance" : 10000,
  "provider_id" : "provider_id_is_optional"
}

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
email and provider id data are optional.
Request
POST /wallet HTTP/1.1
Content-Type: application/json
Content-Length: 167
Host: localhost:8080

{
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "email" : "[email protected]",
  "provider_id" : "provider_id_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: 397

{
  "uuid" : "dc9f05ca-b071-4710-8505-2a8f8ab73d24",
  "activation_data" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "type" : "USER",
  "currency" : "EUR",
  "created_at" : "2021-04-01T15:05:38.628Z",
  "coop" : "ampnet-test",
  "hash" : null,
  "activated_at" : null,
  "email" : "[email protected]",
  "balance" : null,
  "provider_id" : "provider_id_is_optional"
}
Active user cannot create additional wallet
Request
POST /wallet HTTP/1.1
Content-Type: application/json
Content-Length: 167
Host: localhost:8080

{
  "public_key" : "ak_RYkcTuYcyxQ6fWZsL2G3Kj3K5WCRUEXsi76bPUNkEsoHc52Wp",
  "email" : "[email protected]",
  "provider_id" : "provider_id_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: 190

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

3.3. Organization Wallet

3.3.1. Get Organization wallet

Successfully get wallet
Request
GET /wallet/organization/7bf56b94-4238-4f4e-b97c-046dda529af3 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: 415

{
  "uuid" : "ae245465-3812-4db1-b9bb-7ea87cf08e67",
  "activation_data" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "type" : "ORG",
  "currency" : "EUR",
  "created_at" : "2021-04-01T15:05:38.665Z",
  "coop" : "ampnet-test",
  "hash" : "th_foKr5RbgAVq84nZaF6bNfPSnjmFQ39VhQeWPetgGDwv1BNAnV",
  "activated_at" : "2021-04-01T15:05:38.665Z",
  "email" : null,
  "balance" : 0,
  "provider_id" : null
}
Missing organization
Request
GET /wallet/organization/bb331080-c15e-46af-ab9a-a6fd0c7b6df7 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/c5bbed5f-14f9-432e-970d-25c38ac16954/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: 294

{
  "tx" : "tx_+RFNCwH4QrhARSL55I0DqhQePPV3J4ycxHpA9OkqnncvEJrYOThmo2h...signed-tx...",
  "tx_id" : 24,
  "coop" : "ampnet-test",
  "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/ad3f758d-6a29-4245-8cee-79a436ce4bf6/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: 291

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

4. Broadcast API

4.1. Broadcast signed transaction

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

{
  "tx_id" : 7,
  "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: 142

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

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: 100
Host: localhost:8080

{
  "amount" : 1000,
  "bank_account" : "AL35202111090000000001234567",
  "bank_code" : "BACXROBU"
}
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: 389

{
  "id" : 5,
  "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" : "2021-04-01T15:05:35.559Z",
  "document_response" : null,
  "coop" : "ampnet-test",
  "bank_code" : "BACXROBU"
}

5.1.2. Project

Request
POST /withdraw/project/272507c1-7c07-4788-a80c-ad34f3023109 HTTP/1.1
Content-Type: application/json
Content-Length: 100
Host: localhost:8080

{
  "amount" : 1000,
  "bank_account" : "AL35202111090000000001234567",
  "bank_code" : "BACXROBU"
}
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: 390

{
  "id" : 11,
  "owner" : "272507c1-7c07-4788-a80c-ad34f3023109",
  "amount" : 1000,
  "approved_tx_hash" : null,
  "approved_at" : null,
  "burned_tx_hash" : null,
  "burned_by" : null,
  "burned_at" : null,
  "bank_account" : "AL35202111090000000001234567",
  "created_at" : "2021-04-01T15:05:35.909Z",
  "document_response" : null,
  "coop" : "ampnet-test",
  "bank_code" : "BACXROBU"
}

5.2. Get pending

Withdraw is in a pending state until the platform manager burns funds and uploads the document to confirm the bank transaction.

5.2.1. User

Request
GET /withdraw/pending 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: 373

{
  "id" : 7,
  "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" : "2021-04-01T15:05:35.761Z",
  "document_response" : null,
  "coop" : "ampnet-test",
  "bank_code" : "DABAIE2D"
}

5.2.2. Project

Request
GET /withdraw/project/80dfbfd1-dffd-4fa2-bf45-72b6c43addba/pending 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: 374

{
  "id" : 10,
  "owner" : "80dfbfd1-dffd-4fa2-bf45-72b6c43addba",
  "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" : "2021-04-01T15:05:35.872Z",
  "document_response" : null,
  "coop" : "ampnet-test",
  "bank_code" : "DABAIE2D"
}

5.3. Delete

User can delete the withdraw until the platform manager burns funds.

Request
DELETE /withdraw/8 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/6/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: 237

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

5.5. Get withdraw by txHash

txHash is optional, if no value provided returns a list of all user withdraws. If no withdraw found for txHash returns an empty list.

5.5.1. User

Request
GET /withdraw?txHash=th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP 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: 660

{
  "withdraws" : [ {
    "id" : 3,
    "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "amount" : 1000,
    "approved_tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "approved_at" : "2021-04-01T15:05:35.352Z",
    "burned_tx_hash" : null,
    "burned_by" : null,
    "burned_at" : null,
    "bank_account" : "bank-account",
    "created_at" : "2021-04-01T15:05:35.352Z",
    "document_response" : {
      "id" : 1,
      "link" : "document-link",
      "name" : "doc",
      "type" : "type",
      "size" : 1,
      "created_at" : "2021-04-01T15:05:35.352Z"
    },
    "coop" : "ampnet-test",
    "bank_code" : "DABAIE2D"
  } ]
}

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: 367

{
  "id" : 15,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "EY6YG72B",
  "created_at" : "2021-04-01T15:05:37.591Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : null,
  "amount" : 30000,
  "tx_hash" : null,
  "document_response" : null,
  "coop" : "ampnet-test",
  "user_confirmation" : false
}

6.1.2. Project

Request
POST /deposit/project/dd8def07-bf7a-4bf7-ab5c-8186fc723dcc 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: 368

{
  "id" : 7,
  "owner" : "dd8def07-bf7a-4bf7-ab5c-8186fc723dcc",
  "reference" : "AUK4BI4B",
  "created_at" : "2021-04-01T15:05:37.14Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "PROJECT",
  "approved_at" : null,
  "amount" : 30000,
  "tx_hash" : null,
  "document_response" : null,
  "coop" : "ampnet-test",
  "user_confirmation" : false
}

6.2. Get pending deposit

6.2.1. User

Request
GET /deposit/pending 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: 527

{
  "id" : 11,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "S34SDGFT",
  "created_at" : "2021-04-01T15:05:37.44Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : "2021-04-01T15:05:37.44Z",
  "amount" : 0,
  "tx_hash" : null,
  "document_response" : {
    "id" : 11,
    "link" : "link",
    "name" : "name",
    "type" : "type",
    "size" : 1000,
    "created_at" : "2021-04-01T15:05:37.437Z"
  },
  "coop" : "ampnet-test",
  "user_confirmation" : false
}

6.2.2. Project

Request
GET /deposit/project/8994df16-d527-431b-9aef-fa28e06a7bee/pending 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: 528

{
  "id" : 2,
  "owner" : "8994df16-d527-431b-9aef-fa28e06a7bee",
  "reference" : "S34SDGFT",
  "created_at" : "2021-04-01T15:05:36.92Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "PROJECT",
  "approved_at" : "2021-04-01T15:05:36.92Z",
  "amount" : 0,
  "tx_hash" : null,
  "document_response" : {
    "id" : 4,
    "link" : "link",
    "name" : "name",
    "type" : "type",
    "size" : 1000,
    "created_at" : "2021-04-01T15:05:36.918Z"
  },
  "coop" : "ampnet-test",
  "user_confirmation" : false
}

6.3. Delete

Request
DELETE /deposit/5 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

6.4. Get deposit by txHash

txHash is optional, if no value provided returns a list of all user deposits. If no deposit found for txHash returns an empty list.

6.4.1. User

Request
GET /deposit?txHash=th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP 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: 651

{
  "deposits" : [ {
    "id" : 10,
    "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "reference" : "S34SDGFT",
    "created_at" : "2021-04-01T15:05:37.395Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "type" : "USER",
    "approved_at" : "2021-04-01T15:05:37.395Z",
    "amount" : 1000,
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "document_response" : {
      "id" : 10,
      "link" : "document-link",
      "name" : "doc",
      "type" : "type",
      "size" : 1,
      "created_at" : "2021-04-01T15:05:37.387Z"
    },
    "coop" : "ampnet-test",
    "user_confirmation" : false
  } ]
}

6.5. Confirm

User can confirm the deposit to indicate that he has completed the payment. This route is used for both user and project deposits.

Request
POST /deposit/12/confirm 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: 437

{
  "id" : 12,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "S34SDGFT",
  "created_at" : "2021-04-01T15:05:37.482Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : "2021-04-01T15:05:37.482Z",
  "amount" : 1000,
  "tx_hash" : "th_ktDw9ytaQ9aSi78qgCAw2JhdzS8F7vGgzYvWeMdRtP6hJnQqG",
  "document_response" : null,
  "coop" : "ampnet-test",
  "user_confirmation" : true
}

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: 1190

{
  "portfolio" : [ {
    "project" : {
      "uuid" : "57bdca13-ca9d-4390-81ed-5c241f80b94b",
      "name" : "project",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:34.934Z",
      "end_date" : "2021-05-01T15:05:34.934Z",
      "expected_funding" : 100000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image_url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "342c6b20-ab41-46e4-bcb0-eb928fa6e3f6"
    },
    "investment" : 1000000
  }, {
    "project" : {
      "uuid" : "d9ffe4a2-3028-44b8-8212-3081a608c86f",
      "name" : "project",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:34.934Z",
      "end_date" : "2021-05-01T15:05:34.934Z",
      "expected_funding" : 100000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image_url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "5c462251-873e-42a3-bdcb-fe9b256f2876"
    },
    "investment" : 5000000
  } ]
}

7.2. Get stats

Stats calculate only completed transactions in state: TransactionState.MINED. Value investments is sum of all investments(TransactionType.INVEST) minus canceled investments(TransactionType.CANCEL_INVESTMENT). Value earnings is sum of all received revenue share payouts(TransactionType.SHARE_PAYOUT).

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" : 1000,
  "earnings" : 20,
  "date_of_first_investment" : "2020-04-01T15:05:34.688Z"
}

7.3. Get investments in project

Request
GET /portfolio/project/dd6c671e-1772-49d1-b0d2-a1b45fc66bf7 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: 1254

{
  "project" : {
    "uuid" : "dd6c671e-1772-49d1-b0d2-a1b45fc66bf7",
    "name" : "project",
    "description" : "Description",
    "start_date" : "2021-03-31T15:05:34.875Z",
    "end_date" : "2021-05-01T15:05:34.875Z",
    "expected_funding" : 100000000,
    "currency" : "EUR",
    "min_per_user" : 100,
    "max_per_user" : 100000,
    "active" : true,
    "image_url" : "image_url",
    "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "organization_uuid" : "1659aeb3-e4c2-4239-95c7-ac44f4f340bc"
  },
  "transactions" : [ {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000000,
    "type" : "INVEST",
    "date" : "2021-04-01T15:05:34.868Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : null,
    "to" : null,
    "description" : null,
    "share" : null
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 500000,
    "type" : "INVEST",
    "date" : "2021-04-01T15:05:34.871Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : null,
    "to" : null,
    "description" : null,
    "share" : 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: 2305

{
  "transactions" : [ {
    "from_tx_hash" : "mint",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 1000,
    "type" : "DEPOSIT",
    "date" : "2020-04-01T15:05:34.635Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "Platform",
    "to" : "First Last",
    "description" : null,
    "share" : null
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000,
    "type" : "APPROVE_INVESTMENT",
    "date" : "2021-03-01T15:05:34.635Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "First Last",
    "to" : "Project name",
    "description" : "Project name",
    "share" : "0.0000010000"
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000,
    "type" : "INVEST",
    "date" : "2021-03-01T15:05:34.635Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "First Last",
    "to" : "Project name",
    "description" : "Project name",
    "share" : "0.0000010000"
  }, {
    "from_tx_hash" : "project-wallet-hash",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 1000,
    "type" : "CANCEL_INVESTMENT",
    "date" : "2021-03-31T15:05:34.635Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "Project name",
    "to" : "First Last",
    "description" : "Project name",
    "share" : "0.0000010000"
  }, {
    "from_tx_hash" : "project-wallet-hash",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 10,
    "type" : "SHARE_PAYOUT",
    "date" : "2021-03-31T15:05:34.635Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "Project name",
    "to" : "First Last",
    "description" : "Project name",
    "share" : null
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "burn",
    "amount" : 10,
    "type" : "WITHDRAW",
    "date" : "2021-04-01T15:05:34.635Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "First Last",
    "to" : "Platform",
    "description" : null,
    "share" : null
  } ]
}

7.5. Get all project transactions

Only organization members can see a list of project transactions.

Request
GET /portfolio/project/a55b272e-2a87-45d6-a85f-3db96f7a7cda/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: 1602

{
  "transactions" : [ {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000,
    "type" : "APPROVE_INVESTMENT",
    "date" : "2021-03-01T15:05:34.466Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "First Last",
    "to" : "Project name",
    "description" : "Project name",
    "share" : "0.0000010000"
  }, {
    "from_tx_hash" : "user-wallet-hash",
    "to_tx_hash" : "project-wallet-hash",
    "amount" : 1000,
    "type" : "INVEST",
    "date" : "2021-03-01T15:05:34.466Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "First Last",
    "to" : "Project name",
    "description" : "Project name",
    "share" : "0.0000010000"
  }, {
    "from_tx_hash" : "project-wallet-hash",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 1000,
    "type" : "CANCEL_INVESTMENT",
    "date" : "2021-03-31T15:05:34.466Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "Project name",
    "to" : "First Last",
    "description" : "Project name",
    "share" : "0.0000010000"
  }, {
    "from_tx_hash" : "project-wallet-hash",
    "to_tx_hash" : "user-wallet-hash",
    "amount" : 10,
    "type" : "SHARE_PAYOUT",
    "date" : "2021-03-31T15:05:34.466Z",
    "state" : "MINED",
    "tx_hash" : "th_2cNtX3hdmGPHq8sgHb6Lcu87iEc3E6feHTWczQAViQjmP7evbP",
    "from" : "Project name",
    "to" : "First Last",
    "description" : "Project name",
    "share" : null
  } ]
}

8. Investment API

All requests need header: Authorization: Bearer JWT.

8.1. Generate transaction to invest in project

Request
POST /invest/project/5a68f444-7c6c-4204-a11c-295022835221 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: 232

{
  "tx" : "data",
  "tx_id" : 20,
  "coop" : "ampnet-test",
  "info" : {
    "tx_type" : "INVEST",
    "title" : "Invest",
    "description" : "You are signing transaction to investment to project: project with amount 100.00"
  }
}

8.2. Generate transaction to cancel all investments in project

Request
POST /invest/project/9a646264-ccfe-467e-8385-f50f1653c6bf/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: 244

{
  "tx" : "data",
  "tx_id" : 19,
  "coop" : "ampnet-test",
  "info" : {
    "tx_type" : "CANCEL_INVEST",
    "title" : "Cancel Investments",
    "description" : "You are signing transaction to cancel all investments in project: project"
  }
}

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: 1203

{
  "users" : [ {
    "user" : {
      "uuid" : "d282800a-8ffc-4fa4-9dcb-4d67c9960305",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "wallet" : {
      "uuid" : "32675300-14e3-43b0-b661-7c9d5f2ef49d",
      "activation_data" : "activation-data-2",
      "type" : "USER",
      "currency" : "EUR",
      "created_at" : "2021-04-01T15:05:33.702Z",
      "coop" : "ampnet-test",
      "hash" : null,
      "activated_at" : null,
      "email" : null,
      "balance" : null,
      "provider_id" : null
    }
  }, {
    "user" : {
      "uuid" : "4437519b-b7f4-46e4-906b-b6b6d866ac1c",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "wallet" : {
      "uuid" : "a9a8143a-d723-4ed6-afbf-3888d06a9694",
      "activation_data" : "activation-data-1",
      "type" : "USER",
      "currency" : "EUR",
      "created_at" : "2021-04-01T15:05:33.699Z",
      "coop" : "ampnet-test",
      "hash" : null,
      "activated_at" : null,
      "email" : null,
      "balance" : null,
      "provider_id" : 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: 1163

{
  "organizations" : [ {
    "organization" : {
      "uuid" : "0f13a9f3-5d67-4fe8-b721-fb5182a65e4e",
      "name" : "Name",
      "created_at" : "1970-01-19T17:13:23.133Z",
      "approved" : true
    },
    "wallet" : {
      "uuid" : "7e281226-2185-4479-9877-c324cc8fff97",
      "activation_data" : "org-2",
      "type" : "ORG",
      "currency" : "EUR",
      "created_at" : "2021-04-01T15:05:33.442Z",
      "coop" : "ampnet-test",
      "hash" : null,
      "activated_at" : null,
      "email" : null,
      "balance" : null,
      "provider_id" : null
    }
  }, {
    "organization" : {
      "uuid" : "82b135be-6270-49c5-a756-23fbf5f359c1",
      "name" : "Name",
      "created_at" : "1970-01-19T17:13:23.133Z",
      "approved" : true
    },
    "wallet" : {
      "uuid" : "e74b2f7c-2ab4-4d2d-a206-a9848567d64a",
      "activation_data" : "org-1",
      "type" : "ORG",
      "currency" : "EUR",
      "created_at" : "2021-04-01T15:05:33.438Z",
      "coop" : "ampnet-test",
      "hash" : null,
      "activated_at" : null,
      "email" : null,
      "balance" : null,
      "provider_id" : 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: 1976

{
  "projects" : [ {
    "project" : {
      "uuid" : "9a69c202-3682-47a4-bfaf-1128234769ca",
      "name" : "project",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:33.633Z",
      "end_date" : "2021-05-01T15:05:33.633Z",
      "expected_funding" : 100000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image_url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "ce4e306b-6ba3-49b9-895a-503dad57b0cf"
    },
    "wallet" : {
      "uuid" : "03c4852d-3271-4288-aa94-d574be7828c8",
      "activation_data" : "project-2",
      "type" : "PROJECT",
      "currency" : "EUR",
      "created_at" : "2021-04-01T15:05:33.617Z",
      "coop" : "ampnet-test",
      "hash" : null,
      "activated_at" : null,
      "email" : null,
      "balance" : null,
      "provider_id" : null
    },
    "payout_in_process" : null
  }, {
    "project" : {
      "uuid" : "37c80b1d-9647-4bf7-8668-21b641ac6651",
      "name" : "project",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:33.633Z",
      "end_date" : "2021-05-01T15:05:33.633Z",
      "expected_funding" : 100000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image_url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "cc437386-981c-46ac-bc31-5e08bf14aabc"
    },
    "wallet" : {
      "uuid" : "7e5ee35d-a134-4301-8568-6fab535c563f",
      "activation_data" : "project-1",
      "type" : "PROJECT",
      "currency" : "EUR",
      "created_at" : "2021-04-01T15:05:33.614Z",
      "coop" : "ampnet-test",
      "hash" : null,
      "activated_at" : null,
      "email" : null,
      "balance" : null,
      "provider_id" : 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/47a7c992-3889-46b8-867d-04d7c112deec/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: 287

{
  "tx" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
  "tx_id" : 1,
  "coop" : "ampnet-test",
  "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" : "6b393ade-00f9-4569-9d30-d8eb12ab8e99",
  "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: 334

{
  "tx" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
  "tx_id" : 2,
  "coop" : "ampnet-test",
  "info" : {
    "tx_type" : "TRNSF_TOKEN_OWN",
    "title" : "Transfer token ownership",
    "description" : "You are signing transaction to transfer token issuer ownership to user: 6b393ade-00f9-4569-9d30-d8eb12ab8e99"
  }
}

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" : "9b1c2964-7efd-4d34-941a-97b3a2c4a09a",
  "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: 342

{
  "tx" : "th_R26wx2hTnhmgDKJhXC9GAH3evCRnTyyXg4fivLLEAyiAcVW2K",
  "tx_id" : 3,
  "coop" : "ampnet-test",
  "info" : {
    "tx_type" : "TRNSF_PLTFRM_OWN",
    "title" : "Transfer platform ownership",
    "description" : "You are signing transaction to transfer platform manager ownership to user: 9b1c2964-7efd-4d34-941a-97b3a2c4a09a"
  }
}

9.3. Withdraw

9.3.1. Get Withdraws

Must have Admin role - privilege: PrivilegeType.PRA_WITHDRAW. Withdraw type PROJECT will have both user and project response. For withdraw type USER, project response will be null.

Approved

type parameter can be USER or PROJECT. If type is empty all approved withdraws will be returned.

Request
GET /cooperative/withdraw/approved?type=USER&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: 833

{
  "withdraws" : [ {
    "withdraw" : {
      "id" : 26,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "amount" : 1000,
      "approved_tx_hash" : "approved-tx",
      "approved_at" : "2021-04-01T15:05:38.112Z",
      "burned_tx_hash" : null,
      "burned_by" : null,
      "burned_at" : null,
      "bank_account" : "bank-account",
      "created_at" : "2021-04-01T15:05:38.112Z",
      "document_response" : null,
      "coop" : "ampnet-test",
      "bank_code" : "DABAIE2D"
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : null,
    "wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu"
  } ],
  "page" : 0,
  "total_pages" : 2
}
Get withdraw by id
Request
GET /cooperative/withdraw/30 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: 887

{
  "withdraw" : {
    "id" : 30,
    "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "amount" : 1000,
    "approved_tx_hash" : "approved-tx",
    "approved_at" : "2021-04-01T15:05:38.231Z",
    "burned_tx_hash" : null,
    "burned_by" : null,
    "burned_at" : null,
    "bank_account" : "bank-account",
    "created_at" : "2021-04-01T15:05:38.231Z",
    "document_response" : {
      "id" : 18,
      "link" : "document-link",
      "name" : "doc",
      "type" : "type",
      "size" : 1,
      "created_at" : "2021-04-01T15:05:38.231Z"
    },
    "coop" : "ampnet-test",
    "bank_code" : "DABAIE2D"
  },
  "user" : {
    "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "email" : "[email protected]",
    "first_name" : "First",
    "last_name" : "Last",
    "enabled" : true
  },
  "project" : null,
  "wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu"
}
Burned Withdraws

type parameter can be USER or PROJECT. If type is empty all burned withdraws will be returned.

Request
GET /cooperative/withdraw/burned?type=USER&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: 912

{
  "withdraws" : [ {
    "withdraw" : {
      "id" : 15,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "amount" : 1000,
      "approved_tx_hash" : "approved-tx",
      "approved_at" : "2021-04-01T15:05:37.857Z",
      "burned_tx_hash" : "burned-tx",
      "burned_by" : "1c1116f5-0335-4e2d-a3d3-425f41ba805d",
      "burned_at" : "2021-04-01T15:05:37.857Z",
      "bank_account" : "AL35202111090000000001234567",
      "created_at" : "2021-04-01T15:05:37.857Z",
      "document_response" : null,
      "coop" : "ampnet-test",
      "bank_code" : "DABAIE2D"
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : null,
    "wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu"
  } ],
  "page" : 0,
  "total_pages" : 1
}

9.3.2. Pending Withdraws

Pending withdrawals are all approved (by user) withdrawals and burned withdrawals but without confirmation document. Optional query parameter type can be USER or PROJECT. If type is empty both types will be returned.

Request
GET /cooperative/withdraw/pending?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: 4283

{
  "withdraws" : [ {
    "withdraw" : {
      "id" : 41,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "amount" : 1000,
      "approved_tx_hash" : "approved-tx",
      "approved_at" : "2021-04-01T15:05:38.358Z",
      "burned_tx_hash" : null,
      "burned_by" : null,
      "burned_at" : null,
      "bank_account" : "bank-account",
      "created_at" : "2021-04-01T15:05:38.358Z",
      "document_response" : null,
      "coop" : "ampnet-test",
      "bank_code" : "DABAIE2D"
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : null,
    "wallet_hash" : ""
  }, {
    "withdraw" : {
      "id" : 43,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "amount" : 1000,
      "approved_tx_hash" : "approved-tx",
      "approved_at" : "2021-04-01T15:05:38.363Z",
      "burned_tx_hash" : "burned-tx",
      "burned_by" : "9cd3286b-3fd3-480b-9aa2-d01617b6a157",
      "burned_at" : "2021-04-01T15:05:38.363Z",
      "bank_account" : "AL35202111090000000001234567",
      "created_at" : "2021-04-01T15:05:38.363Z",
      "document_response" : null,
      "coop" : "ampnet-test",
      "bank_code" : "DABAIE2D"
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : null,
    "wallet_hash" : ""
  }, {
    "withdraw" : {
      "id" : 38,
      "owner" : "fd1685d4-28b5-4a38-8c30-9b67f481ef62",
      "amount" : 1000,
      "approved_tx_hash" : "approved-tx",
      "approved_at" : "2021-04-01T15:05:38.35Z",
      "burned_tx_hash" : null,
      "burned_by" : null,
      "burned_at" : null,
      "bank_account" : "bank-account",
      "created_at" : "2021-04-01T15:05:38.35Z",
      "document_response" : null,
      "coop" : "ampnet-test",
      "bank_code" : "DABAIE2D"
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : {
      "uuid" : "fd1685d4-28b5-4a38-8c30-9b67f481ef62",
      "name" : "Project name",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:38.377Z",
      "end_date" : "2021-05-01T15:05:38.377Z",
      "expected_funding" : 1000000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 1000000,
      "active" : true,
      "image_url" : "image-url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "bf30ceb9-84cf-4a55-a607-714a39920d35"
    },
    "wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu"
  }, {
    "withdraw" : {
      "id" : 40,
      "owner" : "fd1685d4-28b5-4a38-8c30-9b67f481ef62",
      "amount" : 1000,
      "approved_tx_hash" : "approved-tx",
      "approved_at" : "2021-04-01T15:05:38.356Z",
      "burned_tx_hash" : "burned-tx",
      "burned_by" : "097d491f-829f-428a-b647-41dec4785333",
      "burned_at" : "2021-04-01T15:05:38.356Z",
      "bank_account" : "AL35202111090000000001234567",
      "created_at" : "2021-04-01T15:05:38.356Z",
      "document_response" : null,
      "coop" : "ampnet-test",
      "bank_code" : "DABAIE2D"
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : {
      "uuid" : "fd1685d4-28b5-4a38-8c30-9b67f481ef62",
      "name" : "Project name",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:38.377Z",
      "end_date" : "2021-05-01T15:05:38.377Z",
      "expected_funding" : 1000000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 1000000,
      "active" : true,
      "image_url" : "image-url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "bf30ceb9-84cf-4a55-a607-714a39920d35"
    },
    "wallet_hash" : "th_K3LCJLUQ1m2EsYmcNafGnRyEdDDgfPDGfZhmZ1YgbvAG35PQu"
  } ],
  "page" : 0,
  "total_pages" : 1
}

9.3.3. Upload Document

Must have Admin role - privilege: PrivilegeType.PRA_WITHDRAW

Request
POST /cooperative/withdraw/24/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: 561

{
  "id" : 24,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "amount" : 1000,
  "approved_tx_hash" : "approved-tx",
  "approved_at" : "2021-04-01T15:05:38.055Z",
  "burned_tx_hash" : null,
  "burned_by" : null,
  "burned_at" : null,
  "bank_account" : "bank-account",
  "created_at" : "2021-04-01T15:05:38.055Z",
  "document_response" : {
    "id" : 17,
    "link" : "doc-link",
    "name" : "test.txt",
    "type" : "text/plain",
    "size" : 12,
    "created_at" : "2021-04-01T15:05:38.079Z"
  },
  "coop" : "ampnet-test",
  "bank_code" : "DABAIE2D"
}

9.3.4. Generate Burn Withdraw transaction

Must have Admin role - privilege: PrivilegeType.PWA_WITHDRAW

Request
POST /cooperative/withdraw/23/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: 217

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

9.3.5. Delete

Must have privilege: PrivilegeType.PWA_WITHDRAW. Burned withdrawals cannot be deleted.

Request
DELETE /cooperative/withdraw/32 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

9.4. Deposit

9.4.1. Get Deposits

Must have Admin role - privilege: PRA_DEPOSIT. Deposit type PROJECT will have both user and project response. For deposit type USER, project response will be null.

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: 604

{
  "deposit" : {
    "id" : 30,
    "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "reference" : "S34SDGFT",
    "created_at" : "2021-04-01T15:05:39.38Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "type" : "USER",
    "approved_at" : null,
    "amount" : 0,
    "tx_hash" : null,
    "document_response" : null,
    "coop" : "ampnet-test",
    "user_confirmation" : false
  },
  "user" : {
    "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "email" : "[email protected]",
    "first_name" : "First",
    "last_name" : "Last",
    "enabled" : true
  },
  "project" : null
}
Get by id

Deposit type PROJECT will have both user and project response. For deposit type USER, project response will be null.

Request
GET /cooperative/deposit/19 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: 605

{
  "deposit" : {
    "id" : 19,
    "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "reference" : "S34SDGFT",
    "created_at" : "2021-04-01T15:05:39.101Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "type" : "USER",
    "approved_at" : null,
    "amount" : 0,
    "tx_hash" : null,
    "document_response" : null,
    "coop" : "ampnet-test",
    "user_confirmation" : false
  },
  "user" : {
    "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "email" : "[email protected]",
    "first_name" : "First",
    "last_name" : "Last",
    "enabled" : true
  },
  "project" : null
}
Unapproved

Unapproved deposits are all deposits that are not minted - txHash is null. type parameter can be USER or PROJECT. If type is empty all unapproved deposits will be returned.

Request
GET /cooperative/deposit/unapproved?type=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: 1384

{
  "deposits" : [ {
    "deposit" : {
      "id" : 24,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "reference" : "S34SDGFT",
      "created_at" : "2021-04-01T15:05:39.238Z",
      "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "type" : "USER",
      "approved_at" : "2021-04-01T15:05:39.238Z",
      "amount" : 0,
      "tx_hash" : null,
      "document_response" : null,
      "coop" : "ampnet-test",
      "user_confirmation" : false
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : null
  }, {
    "deposit" : {
      "id" : 23,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "reference" : "S34SDGFT",
      "created_at" : "2021-04-01T15:05:39.229Z",
      "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "type" : "USER",
      "approved_at" : null,
      "amount" : 0,
      "tx_hash" : null,
      "document_response" : null,
      "coop" : "ampnet-test",
      "user_confirmation" : false
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : null
  } ],
  "page" : 0,
  "total_pages" : 1
}
Approved

Completed deposits are deposits that are approved and minted - txHash is not null. type parameter can be USER or PROJECT. If type is empty all approved deposits will be returned.

Request
GET /cooperative/deposit/approved?type=USER&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: 959

{
  "deposits" : [ {
    "deposit" : {
      "id" : 28,
      "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "reference" : "S34SDGFT",
      "created_at" : "2021-04-01T15:05:39.28Z",
      "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "type" : "USER",
      "approved_at" : "2021-04-01T15:05:39.28Z",
      "amount" : 1000,
      "tx_hash" : "th_ktDw9ytaQ9aSi78qgCAw2JhdzS8F7vGgzYvWeMdRtP6hJnQqG",
      "document_response" : {
        "id" : 33,
        "link" : "document-link",
        "name" : "doc",
        "type" : "type",
        "size" : 1,
        "created_at" : "2021-04-01T15:05:39.279Z"
      },
      "coop" : "ampnet-test",
      "user_confirmation" : false
    },
    "user" : {
      "uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "email" : "[email protected]",
      "first_name" : "First",
      "last_name" : "Last",
      "enabled" : true
    },
    "project" : null
  } ],
  "page" : 0,
  "total_pages" : 1
}

9.4.2. Approve

Must have Admin role - privilege: PWA_DEPOSIT. User can approve the deposit multiple times because deposit is unapproved until he completes deposit process - generating and signing minting transaction.

Request
POST /cooperative/deposit/39/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: 550

{
  "id" : 39,
  "owner" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "reference" : "S34SDGFT",
  "created_at" : "2021-04-01T15:05:39.514Z",
  "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
  "type" : "USER",
  "approved_at" : "2021-04-01T15:05:39.525Z",
  "amount" : 30000,
  "tx_hash" : null,
  "document_response" : {
    "id" : 38,
    "link" : "document-link",
    "name" : "test.txt",
    "type" : "text/plain",
    "size" : 18,
    "created_at" : "2021-04-01T15:05:39.523Z"
  },
  "coop" : "ampnet-test",
  "user_confirmation" : false
}

9.4.3. Delete

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

Request
DELETE /cooperative/deposit/32 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

9.4.4. Generate Mint transaction

Must have Admin role - privilege: PWA_DEPOSIT

Request
POST /cooperative/deposit/44/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: 259

{
  "tx" : "signed-transaction",
  "tx_id" : 25,
  "coop" : "ampnet-test",
  "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: 65

{
  "users_with_approved_deposit" : 2,
  "coop" : "ampnet-test"
}

10. Revenue

10.1. Generate transaction for revenue payout

Request
POST /revenue/payout/project/1c71a5e9-e28a-4ec5-969a-dd855cdbcced 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: 247

{
  "tx" : "data",
  "tx_id" : 21,
  "coop" : "ampnet-test",
  "info" : {
    "tx_type" : "REVENUE_PAYOUT",
    "title" : "Revenue Payout",
    "description" : "You are signing transaction to start revenue payout 100.00 for project: project"
  }
}

10.2. Get revenue payouts for project

Request
GET /revenue/payout/project/1791bf5a-7b69-4dc1-8b27-5485c8704270?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: 602

{
  "revenue_payouts" : [ {
    "project_uuid" : "1791bf5a-7b69-4dc1-8b27-5485c8704270",
    "amount" : 55,
    "created_at" : "2021-04-01T15:05:37.765Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "coop" : "ampnet-test",
    "tx_hash" : null,
    "completed_at" : null
  }, {
    "project_uuid" : "1791bf5a-7b69-4dc1-8b27-5485c8704270",
    "amount" : 100,
    "created_at" : "2021-04-01T15:05:37.762Z",
    "created_by" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
    "coop" : "ampnet-test",
    "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: 510

{
  "bank_accounts" : [ {
    "id" : 2,
    "iban" : "HR1723600001101234565",
    "bank_code" : "DABAIE2D",
    "alias" : "alias",
    "coop" : "ampnet-test",
    "bank_name" : "XYZ bank",
    "bank_address" : "XYZ address",
    "beneficiary_name" : "ampnet coop"
  }, {
    "id" : 3,
    "iban" : "AL47212110090000000235698741",
    "bank_code" : "AKIVALTR",
    "alias" : "albalias",
    "coop" : "ampnet-test",
    "bank_name" : "name",
    "bank_address" : "address",
    "beneficiary_name" : "ben"
  } ]
}

11.2. Create

alias, bank_name, bank_address and beneficiary_name data is optional.

Must have privilege - PWA_DEPOSIT

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

{
  "iban" : "HR1723600001101234565",
  "bank_code" : "DABAIE2D",
  "alias" : "alias",
  "bank_name" : "XYZ bank",
  "bank_address" : "XYZ address",
  "beneficiary_name" : "ampnet coop"
}
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: 225

{
  "id" : 5,
  "iban" : "HR1723600001101234565",
  "bank_code" : "DABAIE2D",
  "alias" : "alias",
  "coop" : "ampnet-test",
  "bank_name" : "XYZ bank",
  "bank_address" : "XYZ address",
  "beneficiary_name" : "ampnet coop"
}

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: 2667

{
  "coop" : "ampnet-test",
  "projects" : [ {
    "project" : {
      "uuid" : "650320f1-0bbf-40fb-b779-131bc522282a",
      "name" : "project",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:36.834Z",
      "end_date" : "2021-05-01T15:05:36.834Z",
      "expected_funding" : 100000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image_url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "f3ffe0a6-ab1e-4199-9f1a-4b121005f68f"
    },
    "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" : "869af69d-3870-471e-9c68-e22115c76e57",
      "name" : "project",
      "description" : "Description",
      "start_date" : "2021-03-31T15:05:36.834Z",
      "end_date" : "2021-05-01T15:05:36.834Z",
      "expected_funding" : 100000000,
      "currency" : "EUR",
      "min_per_user" : 100,
      "max_per_user" : 100000,
      "active" : true,
      "image_url" : "image_url",
      "create_by_uuid" : "89fb3b1c-9c0a-11e9-a2a3-2a2ae2dbcce4",
      "organization_uuid" : "919e4a74-a79e-4eb8-a626-d704fcb0216d"
    },
    "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
      } ]
    } ]
  } ]
}