Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: "2.0"
- info:
- description: "This is a BlockEx's Bond Tool RESTful API server"
- version: "1.0.0"
- title: "BlockEX API Documents"
- host: "BlockEXhost"
- basePath: "/"
- tags:
- - name: "issuer"
- description: "Issuer API endpoints"
- - name: "investors"
- description: "Investor list and detail API endpoints"
- - name: "account"
- description: "Investor Account related API endpoints"
- - name: "Bond"
- description: "Evething about Bond"
- - name: "document"
- description: "Evething about bonds document"
- schemes:
- - "http"
- securityDefinitions:
- JWT:
- type: apiKey
- name: Authorization
- in: header
- description: |
- For accessing the API a valid JWT token must be passed in all the queries in
- the 'Authorization' header.
- The following syntax must be used in the 'Authorization' header :
- JWT xxxxxx.yyyyyyy.zzzzzz
- consumes:
- - application/json
- produces:
- - application/json
- security:
- - JWT: []
- paths:
- /issuers:
- get:
- tags:
- - "issuer"
- summary: Get issuer list
- description: Returns a list containing all issuers.
- responses:
- 200:
- description: A list of issuers
- schema:
- type: array
- items:
- $ref: '#/definitions/IssuerDetail'
- 404:
- description: No issuers found.
- /issuers/{volt_id}:
- get:
- tags:
- - "issuer"
- summary: Get issuer detail
- description: Returns issuer detail.
- parameters:
- - name: volt_id
- in: path
- required: true
- description: Volt ID
- type: integer
- responses:
- 200:
- description: Issuer detail
- schema:
- $ref: '#/definitions/IssuerDetail'
- 404:
- description: Issuer not found
- /investors:
- get:
- tags:
- - "investors"
- summary: Gets investors list
- description: Returns a list containing all investors.
- parameters:
- - name: bond_id
- in: query
- required: false
- description: Get investors for specific Bond.
- type: string
- responses:
- 200:
- description: A list of investors
- schema:
- type: array
- items:
- properties:
- id:
- type: string
- example: '4bd295a0-3a60-4326-969b-9b39900d4750'
- email:
- type: string
- example: 'example@gmail.com'
- user_name:
- type: string
- example: 'username'
- name:
- type: string
- example: 'Jeff'
- status:
- type: integer
- example: 1
- created_date:
- type: string
- example: '2018-04-06T12:02:25.883459+00:00'
- updated_date:
- type: string
- example: '2018-04-06T12:02:25.883459+00:00'
- /investors/{pk}:
- get:
- tags:
- - "investors"
- summary: Gets investors detail data
- description: Returns a object containing an investor detail data
- parameters:
- - name: pk
- in: path
- required: true
- description: Investor ID
- type: string
- responses:
- 200:
- description: An investor data
- schema:
- type: object
- properties:
- id:
- type: string
- example: '4bd295a0-3a60-4326-969b-9b39900d4750'
- email:
- type: string
- example: 'example@gmail.com'
- user_name:
- type: string
- example: 'username'
- name:
- type: string
- example: 'Jeff'
- status:
- type: integer
- example: 1
- created_date:
- type: string
- example: '2018-04-06T12:02:25.883459+00:00'
- updated_date:
- type: string
- example: '2018-04-06T12:02:25.883459+00:00'
- 404:
- description: Investor not found
- /investor/view-balance/{pk}:
- get:
- tags:
- - "account"
- summary: Gets account balance
- description: Returns a object containing account data and it's balance
- parameters:
- - name: pk
- in: path
- required: true
- description: Account ID
- type: string
- responses:
- 200:
- description: Account balance
- schema:
- type: object
- properties:
- balance:
- type: number
- example: 1343.2
- id:
- type: string
- example: '720c7df7-2dcd-449f-bdef-0e761eba7474'
- balance_updated_date:
- type: string
- example: '2018-04-27T15:17:12.877226+00:00'
- name:
- type: string
- example: 'Account 1'
- currency:
- type: string
- example: 'USD'
- created_date:
- type: string
- example: '2018-04-27T15:17:12.877226+00:00'
- updated_date:
- type: string
- example: '2018-04-27T15:17:12.877226+00:00'
- 404:
- description: Account not found
- /investor/update-balance/{pk}:
- post:
- tags:
- - "account"
- summary: Create a transaction
- description: Returns a object containing created transaction data
- parameters:
- - name: pk
- in: path
- required: true
- description: Bond ID
- type: string
- - name: body
- in: body
- required: true
- schema:
- type: object
- properties:
- type:
- type: string
- example: 'Deposit'
- amount:
- type: number
- example: 1000.5
- currency:
- type: string
- example: 'USD'
- responses:
- 201:
- description: Transaction created
- schema:
- type: object
- properties:
- amount:
- type: number
- example: 1000.5
- id:
- type: string
- example: 'f93ee1f9-bcae-446c-ba03-4ef34775ac55'
- created_date:
- type: string
- example: '2018-04-27T16:48:55.156069+00:00'
- reference:
- type: string
- currency:
- type: string
- example: 'USD'
- status:
- type: string
- example: 'Pending'
- type:
- type: string
- example: 'Deposit'
- bond_id:
- type: string
- example: 'a93ee1f9-bcae-446c-ba03-4ef34775ac22'
- 404:
- description: Account not found
- 400:
- description: Missing transaction data
- /investor/transactions/{pk}:
- get:
- tags:
- - "account"
- summary: Get a list of an account's transactions
- description: Returns a list containing all transactions of an account
- parameters:
- - name: pk
- in: path
- required: true
- description: Account ID
- type: string
- responses:
- 200:
- description: List transactions
- schema:
- type: array
- items:
- properties:
- amount:
- type: number
- example: 1000.5
- id:
- type: string
- example: '9ea37d13-54d0-453e-92fb-50865ede9595'
- created_date:
- type: string
- example: '2018-04-27T16:54:07.658790+00:00'
- reference:
- type: string
- currency:
- type: string
- example: 'USD'
- status:
- type: string
- example: 'Pending'
- type:
- type: string
- example: 'Deposit'
- bond_id:
- type: string
- example: 'f93ee1f9-bcae-446c-ba03-4ef34775ac55'
- 404:
- description: Account not found
- /investor/purchase/{pk}:
- post:
- tags:
- - "account"
- summary: Purchase an amount of bond
- description: Investor will choose a bond, and one of his account. After the purchase successful, that account's balance will be update, so be the bond\'s unit purchased
- parameters:
- - name: pk
- in: path
- required: true
- description: Bond ID
- type: string
- - name: body
- in: body
- required: true
- schema:
- type: object
- properties:
- account_id:
- type: string
- example: '4bd295a0-3a60-4326-969b-9b39900d4750'
- purchase_amount:
- type: integer
- example: 1000
- responses:
- 200:
- description: Purchase successful
- schema:
- type: object
- properties:
- msg:
- type: string
- example: 'Purchase success'
- transaction_id:
- type: string
- example: '4bd295a0-3a60-4326-969b-9b39900d4750'
- 404:
- description: Account not found
- 400:
- description: Missing fields or wrong bond ID, or exceed account balance/purchasable units
- /investor/dirty-price/{pk}:
- post:
- tags:
- - "account"
- summary: Calculate dirty price when purchase bond
- description: Calculate dirty price when purchase bond
- parameters:
- - name: pk
- in: path
- required: true
- description: Bond ID
- type: string
- - name: body
- in: body
- required: true
- schema:
- type: object
- properties:
- purchase_amount:
- type: integer
- example: 1000
- responses:
- 200:
- description: Calculate dirty price successful
- schema:
- type: object
- properties:
- dirty_price:
- type: number
- example: 1003.34
- 404:
- description: Bond not found
- 400:
- description: Missing fields or wrong bond ID, or negative number
- /investor/admin-approve/{pk}:
- put:
- tags:
- - "account"
- summary: Admin approve the investor deposit or withdrawal transaction
- description: When an investor deposit money to his account, the transactions must be approve by admin before it affect account balance. But when he withdraw money from his account, the balance will update instantly, to prevent other actions with the money have been withdrawed. But this transaction still need to be approved by admin.
- parameters:
- - name: pk
- in: path
- required: true
- description: Transaction ID
- type: string
- responses:
- 200:
- description: Admin approved this transaction. Account balance will be change.
- schema:
- type: object
- properties:
- msg:
- type: string
- example: Transaction has been completed
- 404:
- description: Transaction not found
- 400:
- description: Transaction type is not deposit
- /investor/admin-reject/{pk}:
- put:
- tags:
- - "account"
- summary: Admin reject the investor deposit or withdrawal transaction
- description: If admin reject a deposit transaction, the account's balance will not be change. But if admin reject a withdrawal transaction, the amount money will be return back to investor account.
- parameters:
- - name: pk
- in: path
- required: true
- description: Transaction ID
- type: string
- responses:
- 204:
- description: Admin reject the deposit transaction. Account's balance will not be change
- schema:
- type: object
- properties:
- msg:
- type: string
- example: Transaction has been rejected
- 200:
- description: Admin reject the withdrawal transaction. Account balance will be change (add transaction amount)
- schema:
- type: object
- properties:
- msg:
- type: string
- example: Transaction has been rejected.
- 404:
- description: Transaction not found
- 400:
- description: Transaction type is not deposit
- /investor/purchase-history:
- get:
- tags:
- - "account"
- summary: Gets purchase history
- description: Returns a list containing purchase history of bond ID.
- parameters:
- - name: bond_id
- in: query
- required: true
- description: Bond ID
- type: string
- responses:
- 200:
- description: A list of purchase-history
- schema:
- type: array
- items:
- properties:
- balance:
- type: number
- example: 1343.2
- id:
- type: string
- example: '720c7df7-2dcd-449f-bdef-0e761eba7474'
- balance_updated_date:
- type: string
- example: '2018-04-27T15:17:12.877226+00:00'
- name:
- type: string
- example: 'Account 1'
- currency:
- type: string
- example: 'USD'
- created_date:
- type: string
- example: '2018-04-27T15:17:12.877226+00:00'
- updated_date:
- type: string
- example: '2018-04-27T15:17:12.877226+00:00'
- /document/{pk}:
- post:
- tags:
- - "document"
- summary: "Upload document"
- description: Upload a pdf document and return a path of document was stored.
- parameters:
- - name: pk
- in: path
- required: true
- description: Bond ID
- type: string
- responses:
- 200:
- description: Path of document stored.
- schema:
- type: object
- properties:
- status_code:
- type: integer
- description: Response status code
- data:
- type: object
- properties:
- name:
- type: string
- /bonds:
- get:
- tags:
- - "Bond"
- summary: "Get list bonds"
- description: ""
- operationId: "getBonds"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- responses:
- 200:
- description: "Get list bonds success"
- schema:
- $ref: "#/definitions/BondList"
- post:
- tags:
- - "Bond"
- summary: "Create a bond"
- description: ""
- operationId: "createBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "body"
- name: "body"
- required: true
- schema:
- $ref: "#/definitions/BondDetail"
- responses:
- 201:
- description: "Bond created"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Parameters invalid"
- /bonds/purchased:
- get:
- tags:
- - "Bond"
- summary: "Get list bonds purchased by investor"
- description: ""
- operationId: "getBondsByInvestor"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- responses:
- 200:
- description: "Get list bonds success"
- schema:
- $ref: "#/definitions/BondList"
- /bonds/{bond_id}:
- get:
- tags:
- - "Bond"
- summary: "Get Bond detail"
- description: ""
- operationId: "getBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "bond_id"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- responses:
- 200:
- description: "Get Bond detail success"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Parameters invalid"
- put:
- tags:
- - "Bond"
- summary: "Update Bond"
- operationId: "updateBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "bond_id"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- - in: "body"
- name: "body"
- required: true
- schema:
- $ref: "#/definitions/BondDetail"
- responses:
- 200:
- description: "Update Bond success"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Parameters invalid"
- delete:
- tags:
- - "Bond"
- summary: "Delete a Bond"
- operationId: "deleteBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "pk"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- responses:
- 200:
- description: "Delete bond success"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Parameters invalid"
- /bonds/{bond_id}/launch:
- put:
- tags:
- - "Bond"
- summary: "Launch Bond"
- operationId: "launchBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "bond_id"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- responses:
- 200:
- description: "Bond launched"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Parameters invalid"
- /bonds/{bond_id}/admin-reject:
- put:
- tags:
- - "Bond"
- summary: "Admin reject Bond"
- operationId: "adminRejectBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "bond_id"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- responses:
- 200:
- description: "Bond rejected by Admin"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Parameters invalid"
- /bonds/{bond_id}/admin-approve:
- put:
- tags:
- - "Bond"
- summary: "Admin approve Bond"
- operationId: "adminApproveBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "bond_id"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- responses:
- 200:
- description: "Bond approved by Admin"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Parameters invalid"
- /bonds/{bond_id}/legal-reject:
- put:
- tags:
- - "Bond"
- summary: "Legal reject Bond"
- description: "When legal reject a bond, its status change to Draft. And legal can not revert this action after it done."
- operationId: "legalRejectBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "bond_id"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- responses:
- 200:
- description: "Bond rejected by Legal"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Bond not found"
- 400:
- description: "Bond's status is not valid"
- /bonds/{bond_id}/legal-approve:
- put:
- tags:
- - "Bond"
- summary: "Legal approve Bond"
- operationId: "legalApproveBond"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "path"
- name: "bond_id"
- description: "String GUID of a Bond"
- required: true
- type: "string"
- format: "uuid"
- responses:
- 200:
- description: "Bond approved by Legal"
- schema:
- $ref: "#/definitions/BondDetail"
- 404:
- description: "Bond not found"
- 400:
- description: "Bond's status is not valid"
- definitions:
- IssuerDetail:
- type: object
- properties:
- address:
- type: object
- properties:
- address_line_one:
- type: string
- example: "123 ABC Road"
- address_line_two:
- type: string
- example: "More address"
- area:
- type: string
- example: "UK"
- city:
- type: string
- example: "London"
- country:
- type: string
- example: "UK"
- postcode:
- type: string
- example: "EC1A 1BB"
- issuer_id:
- type: string
- example: "99163426-79c4-4cff-ae72-98f9fa623b08"
- issuer_name:
- type: string
- example: "Company ABC"
- issuer_website:
- type: string
- example: "https://www.companyabc.com"
- BondTerms:
- type: object
- properties:
- agent:
- type: string
- example: "Blockex"
- annual_coupon_payment:
- type: string
- example: '0'
- bond_create_date:
- type: string
- example: '2018-05-08T17:24:07.760588+00:00'
- bond_status:
- type: string
- example: 'matured'
- borrowing_status:
- type: string
- example: 'Senior'
- business:
- type: string
- example: 'London'
- calculation_basis:
- type: string
- example: 'ACT/365'
- coupon_frequency:
- type: string
- example: "annual"
- coupon_payment:
- type: string
- example: '0'
- coupon_rate:
- type: string
- example: 0.05
- currency:
- type: string
- example: 'GBP'
- description:
- type: string
- example: "Description"
- id:
- type: string
- example: 'be70e9d8-5f40-45ab-9a53-5b6cb5efd4f6'
- interest_basis:
- type: string
- example: 'Fixed'
- issue_date:
- type: string
- example: '2018-05-15'
- issue_size:
- type: integer
- example: 10000
- last_updated_date:
- type: string
- example: '2018-05-08T17:24:07.760588+00:00'
- maturity_date:
- type: string
- example: '2028-05-15'
- name:
- type: string
- example: 'Bond name'
- price:
- type: integer
- example: 100
- redemption_amount:
- type: string
- example: 'Principal'
- redemption_date:
- type: string
- example: '2018-06-15'
- redemption_period:
- type: string
- example: 1
- trustee:
- type: string
- example: 'Blockex'
- type:
- type: string
- example: 'Bullet'
- units_purchased:
- type: integer
- example: 45
- BondDetail:
- type: object
- properties:
- issuer:
- type: object
- $ref: "#/definitions/IssuerDetail"
- terms:
- type: object
- $ref: "#/definitions/BondTerms"
- BondList:
- type: array
- items:
- type: object
- properties:
- bond_create_date:
- type: string
- example: '2018-05-08T17:24:07.760588+00:00'
- bond_status:
- type: string
- example: 'matured'
- calculation_basis:
- type: string
- example: 'ACT/365'
- coupon_frequency:
- type: string
- example: "annual"
- coupon_rate:
- type: string
- example: 0.05
- currency:
- type: string
- example: 'GBP'
- id:
- type: string
- example: 'be70e9d8-5f40-45ab-9a53-5b6cb5efd4f6'
- issue_date:
- type: string
- example: '2018-05-15'
- issue_size:
- type: integer
- example: 10000
- redemption_date:
- type: string
- example: '2018-06-15'
- redemption_period:
- type: string
- example: 1
- issuer_id:
- type: string
- example: 'be70e9d8-5f40-45ab-9a53-5b6cb5efd4f6'
- issuser_name:
- type: string
- example: 'Alex'
- issuer_description:
- type: string
- example: "Description"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement