Skip to content

Instantly share code, notes, and snippets.

@awsum
Last active October 25, 2017 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awsum/5a35bc94bd0af3deb96b40c16767373a to your computer and use it in GitHub Desktop.
Save awsum/5a35bc94bd0af3deb96b40c16767373a to your computer and use it in GitHub Desktop.
swagger: "2.0"
info:
version: "1"
title: "User KYC"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/users:
post:
summary: "Create user"
parameters:
- in: body
name: user
schema:
type: object
properties:
type:
type: "string"
enum:
- individual
- joint
- business
address:
type: "string"
responses:
"200":
description: "ok"
/users/{user}:
parameters:
- in: path
name: user
type: string
required: true
description: "account ID"
patch:
summary: "Update KYC"
parameters:
- in: body
name: body
schema:
type: object
properties:
details:
type: object
properties:
personal_details:
$ref: "#/definitions/person"
employment_details:
$ref: "#/definitions/employment"
bank_details:
$ref: "#/definitions/bank_details"
corporation_details:
$ref: "#/definitions/corporation_details"
financial_details:
$ref: "#/definitions/financial_details"
contact_person:
$ref: "#/definitions/person"
correspondence_address:
$ref: "#/definitions/address"
registered_address:
$ref: "#/definitions/address"
address:
$ref: "#/definitions/address"
responses:
"200":
description: "ok"
/users/{user}/entities:
parameters:
- in: path
name: user
type: string
required: true
description: "account ID"
post:
summary: "Create KYC entity"
parameters:
- in: body
name: body
description: "KYC entity type"
schema:
type: object
properties:
type:
type: integer
enum:
- 10
- 13
- 14
description: see `entity_type` for details
responses:
"200":
description: "ok"
schema:
type: object
properties:
id:
type: integer
/users/{user}/entities/{entity}:
parameters:
- in: path
name: user
type: string
required: true
description: "account ID"
- in: path
name: entity
type: integer
required: true
description: "entity ID"
delete:
summary: "Delete KYC entity"
responses:
"200":
description: "ok"
"403":
description: "entity not existent or not owned by user"
patch:
summary: "Update KYC entity"
parameters:
- in: body
name: details
schema:
type: object
properties:
personal_details:
$ref: "#/definitions/person"
employment_details:
$ref: "#/definitions/employment"
responses:
"200":
description: "ok"
"403":
description: "entity not existent or not owned by user"
/users/{user}/documents:
parameters:
- in: path
name: user
type: string
required: true
description: "account ID"
post:
summary: "Creates intent for document upload"
parameters:
- in: body
name: intent
schema:
type: object
properties:
content_type:
type: "string"
document_type:
$ref: "#/definitions/document_type"
entity_id:
description: "required for non-root KYC entities"
type: integer
wallet_id:
description: "for recovery flow"
type: string
required:
- content_type
- document_type
responses:
"200":
description: "ok"
definitions:
entity_type:
type: integer
description: |
* 10 - joint user identity
* 13 - business user owner
* 14 - business user signatory
document_type:
type: integer
description: |
* 1 - Certification
* 2 - AddressProof
* 3 - BankProof
* 4 - Selfie
* 5 - IDProof
* 6 - RegistrationCertificate
* 7 - IncorporationCertificate
* 8 - MOA
* 9 - AOA
* 10 - POA
* 11 - PhoneProof
* 12 - Audit
* 13 - SignedForm
* 14 - RecoveryPhoto
* 15 -ProofOfIncome
individual:
type: "object"
properties:
personal_details:
$ref: "#/definitions/person"
employment_details:
$ref: "#/definitions/employment"
bank_details:
$ref: "#/definitions/bank_details"
address:
$ref: "#/definitions/address"
required:
- bank_details
- personal_details
- employment_details
- address
joint:
type: "object"
properties:
identities:
type: object
additionalProperties:
$ref: "#/definitions/identity"
required:
- identities
business:
type: "object"
properties:
corporation_details:
$ref: "#/definitions/corporation_details"
financial_details:
$ref: "#/definitions/financial_details"
correspondence_address:
$ref: "#/definitions/address"
registered_address:
$ref: "#/definitions/address"
owners:
type: object
additionalProperties:
$ref: "#/definitions/business_person"
signatories:
type: object
additionalProperties:
$ref: "#/definitions/business_person"
required:
- corporation_details
- financial_details
- correspondence_address
- registered_address
- owners
- signatories
business_person:
type: object
properties:
personal_details:
$ref: "#/definitions/person"
address:
$ref: "#/definitions/address"
required:
- personal_details
- address
person:
type: "object"
properties:
first_name:
type: "string"
last_name:
type: "string"
former_first_name:
type: "string"
former_last_name:
type: "string"
gender:
type: "string"
enum:
- male
- female
- not sure
mobile:
type: "string"
email:
type: "string"
place_of_birth:
type: "string"
date_of_birth:
type: "string"
id_document:
type: "string"
enum:
- Citized ID
- Residence ID
- Passport
id_number:
type: "string"
marital_status:
type: "string"
enum:
- Single
- Married
- Divorced
- Widowed
nationality:
type: "string"
required:
- first_name
- last_name
- gender
- mobile
- email
- place_of_birth
- date_of_birth
- id_document
- id_number
- nationality
corporation_details:
type: "object"
properties:
entity_name:
type: "string"
date_of_establishment:
type: "string"
business_nature:
type: "string"
business_type:
type: "string"
enum:
- General Trading
- Other
entity_type:
type: "string"
enum:
- Limited Liability
- Other
registration_number:
type: "string"
registration_expiry:
type: "string"
exchange_listed:
type: "string"
email:
type: "string"
landline:
type: "string"
mobile:
type: "string"
fax:
type: "string"
required:
- entity_name
- date_of_establishment
- business_nature
- business_type
- entity_type
- registration_number
- registration_expiry
- landline
- email
employment:
type: "object"
properties:
education:
type: "string"
enum:
- Secondary Education
- Bachelor
- Master
- Assistant professor
- Associate professor
- Professor
- Other
industry:
type: "string"
enum:
- Accounting/Finance
- Advertising/Public Relations
- Aerospace/Aviation
- Arts/Entertainment/Publishing
- Automotive
- Banking/Mortgage
- Business Development
- Business Opportunity
- Clerical/Administrative
- Construction/Facilities
- Consumer Goods
- Customer Service
- Education/Training
- Energy/Utilities
- Engineering
- Government/Military
- Green
- Healthcare
- Hospitality/Travel
- Human Resources
- Installation/MaintenanceMaintenance
- Insurance
- Internet
- Job Search Aids
- Law Enforcement/SecuritySecurity
- Legal
- Management/Executive
- Manufacturing/OperationsOperations
- Marketing
- Non-Profit/Volunteer
- Pharmaceutical/Biotech
- Professional Services
- QA/Quality Control
- Real Estate
- Restaurant/Food Service
- Retail
- Sales
- Science/Research
- Skilled Labour
- Technology
- Telecommunications
- Transportation/LogisticsLogistics
- Other
status:
type: "string"
enum:
- Employed Full-Time
- Employed Part-Time
- Self-employed
- Not employed but looking for work
- Not employed and not looking for work
- Homemaker
- Retired
- Student
- Prefer Not to Answer
required:
- education
- status
- industry
identity:
type: "object"
properties:
personal_details:
$ref: "#/definitions/person"
address:
$ref: "#/definitions/address"
employment_details:
$ref: "#/definitions/employment"
bank_details:
$ref: "#/definitions/bank_details"
required:
- personal_details
- employment_details
- address
financial_details:
type: object
properties:
group_name:
type: "string"
group_address:
type: "string"
source_of_funds:
type: "string"
source_of_capital:
type: "string"
external_audit:
type: "string"
required:
- source_of_funds
- source_of_capital
bank_details:
type: "object"
properties:
source_of_wealth:
type: "string"
iban:
type: "string"
bank_name:
type: "string"
bank_address:
$ref: "#/definitions/address"
bic:
type: "string"
source_of_income:
type: "string"
required:
- source_of_wealth
- source_of_income
- iban
- bank_name
- bank_address
- bic
address:
type: "object"
properties:
line_1:
type: "string"
line_2:
type: "string"
city:
type: "string"
state:
type: "string"
postal_code:
type: "string"
country:
type: "string"
required:
- line_1
- line_2
- city
- state
- country
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment