Schema

GraphQL schema for entity

enum EntityType {
  personal
  business
}

enum BusinessType {
  b_corporation
  c_corporation
  close_corporation
  cooperative
  general_partnership
  limited_liability_company
  limited_partnership
  nonprofit_corporation
  s_corporation
  sole_proprietorship
}

type Entity {
  id: UUID
  type: EntityType
  entity_name: String
  business_name: String
  first_name: String
  last_name: String
  contact_first_name: String
  contact_last_name: String
  state: String
  email: Email
  phone: String
  phone_country: String
  address1: String
  address2: String
  city: String
  state_province_region: String
  postal_code: PostalCode
  country: ISO3166_1
  creator: UserAccount
  users: [UserAccount]
  created_date: DateTime
  tax_number: TaxNumber
  trade_name: TradeName
  naics_code: NAICS
  currency_needed: [String]
  destination_countries: [String]
  business_type: BusinessType
  business_industry: BusinessIndustry
  business_description: String
  trading_symbol: String
  owned_by: String
  owned_by_other_entity: Boolean
  owned_by_public_company: Boolean
  owned_by_public_company_symbol: String
  incorporation_date: DateTime
  document_expiration_date: DateTime
  representatives: [Representative]
  documents: [EntityDocument]
  website_url: String
}

type EntityRequiredFields {
  requires_representatives: Boolean
  fields: [EntityRequiredFieldsItem]
  documents: [[DocumentMetaInfo]]
}

type EntityRequiredFieldsItem {
  variable: String
  regex: String
  example: String
  enum: [String]
}

input EntityUpdateInput {
  email: Email
  phone: String
  phone_country: String
  contact_first_name: String
  contact_last_name: String
  business_name: String
  business_address1: String
  business_address2: String
  business_city: String
  business_state_province_region: String
  business_postal_code: PostalCode
  business_country: ISO3166_1
  tax_number: TaxNumber
  trade_name: TradeName
  naics_code: NAICS
  currency_needed: [String]
  destination_countries: [String]
  business_type: BusinessType
  business_industry: BusinessIndustry
  business_description: String
  trading_symbol: String
  owned_by: String
  owned_by_other_entity: Boolean
  owned_by_public_company: Boolean
  owned_by_public_company_symbol: String
  incorporation_date: DateTime
  document_expiration_date: DateTime
  average_monthly_transaction_count: String
  average_monthly_volume: String
  website_url: String
}

input RepresentativeInput {
  first_name: String
  last_name: String
  is_signer: Boolean
  date_of_birth: DateTime
  residential_address: String
  residential_address2: String
  residential_city: String
  residential_state_province_region: String
  residential_postal_code: PostalCode
  residential_country: ISO3166_1
  citizenship: ISO3166_1
  responsibility: String
  document_number: String
  document_issue_date: DateTime
  document_expiration_date: DateTime
  ownership_percentage: Int
  ssn: String
  passport_number: String
}

input UpdateRepresentativeInput {
  first_name: String
  last_name: String
  is_signer: Boolean
  date_of_birth: DateTime
  residential_address: String
  residential_address2: String
  residential_city: String
  residential_state_province_region: String
  residential_postal_code: PostalCode
  residential_country: ISO3166_1
  citizenship: ISO3166_1
  responsibility: String
  ownership_percentage: Int
  tax_number: TaxNumber
  email: Email
  phone: String
  job_title: String
  passport_number: String
}

type Representative {
  first_name: String
  last_name: String
  date_of_birth: DateTime
  is_signer: Boolean
  residential_address: String
  residential_address2: String
  residential_city: String
  residential_state_province_region: String
  residential_postal_code: PostalCode
  residential_country: ISO3166_1
  citizenship: ISO3166_1
  responsibility: String
  ownership_percentage: Int
  email: Email
  phone: String
  job_title: String
  passport_number: String
}

type RepresentativeRequiredFieldsItem {
  variable: String
  regex: String
  example: String
  enum: [String]
}

enum DocumentType {
  identity_verification
  proof_of_address
  liveness_check
  proof_of_ownership
  proof_of_registration
  bank_statement
}

type DocumentMetaInfo {
  enum: String
  type: DocumentType
}

type RepresentativeRequiredFields {
  fields: [RepresentativeRequiredFieldsItem]
  documents: [[DocumentMetaInfo]]
}

type RepresentativeRequiredFieldsItem {
  variable: String
  regex: String
  example: String
  enum: [String]
}

type RepresentativeRequiredFields {
  fields: [RepresentativeRequiredFieldsItem]
  documents: [[DocumentMetaInfo]]
}

type Query {
  # get entity (admin only)
  entity(entity_id: UUID!): Entity

  # get a users entities
  userEntities(
    user_id: UUID!
    search_terms: String # optional
    listFilter: ListFilter
  ): [Entity]

  # get a organization entities
  organizationEntities(
    search_terms: String # optional
    listFilter: ListFilter
  ): [Entity]

  verifiedOrganizationEntities(
    search_terms: String # optional
    listFilter: ListFilter
  ): [Entity]

  entityRequiredFields(
    country: ISO3166_1
    entity_type: EntityType
    business_type: BusinessType
  ): EntityRequiredFields
}

type Mutation {
  # create personal entity
  createPersonalEntity(
    user_id: UUID!
    email: Email!
    phone: String
    phone_country: String
    first_name: String!
    last_name: String!
    address1: String!
    address2: String
    city: String
    state_province_region: String
    postal_code: PostalCode
    country: ISO3166_1!
    birth_data: DateTime!
    tax_number: TaxNumber
    # must be true for an entity to be verified
    accept_terms_and_conditions: Boolean!
  ): UUID

  # create business entity
  createBusinessEntity(
    user_id: UUID
    email: Email!
    phone: String
    phone_country: String
    contact_first_name: String!
    contact_last_name: String!
    business_name: String!
    business_address1: String!
    business_address2: String
    business_city: String
    business_state_province_region: String
    business_postal_code: PostalCode
    business_country: ISO3166_1!
    tax_number: TaxNumber
    trade_name: TradeName
    naics_code: NAICS
    business_type: BusinessType
    business_description: String
    trading_symbol: String
    owned_by: String
    incorporation_date: DateTime
    representatives: [RepresentativeInput]
    # must be true for an entity to be verified
    accept_terms_and_conditions: Boolean!
    average_monthly_transaction_count: String
    average_monthly_volume: String
  ): UUID
}