Schema

Beneficiary Attributes

AttributeTypeDefinitionExample
idUUIDthe id of the beneficiarya9d0164d-22df-46c6-a836-1a3da5a470d8
entityEntitythe entity object - NOT editable after creationsee entity schema
creatorUserAccountthe user object that created the beneficiary - NOT editable after creationsee UserAccount schema
typeStringthe classification of the beneficiary, can either be 'personal' or 'business' - NOT editable after creationpersonal
emailEmailemail used for notification[email protected]
phoneStringphone number of beneficiary9177234464
phone_countryString2 letter ISO code of the country the phone number exists inUS
tax_numberTaxNumbertax number of the beneficiary for the country provided121904576
first_nameStringfirst name of the beneficiaryThomas
last_nameStringlast name of the beneficiaryJones
address1Stringaddress line 1 of beneficiary1305 E 6th St.
address2Stringaddress line 2 of beneficiaryUnit 10
cityStringcity the beneficiary resides inAustin
state_province_regionStringthe state (US), province, or region the beneficiary resides inTexas
postal_codeStringthe postal code of the beneficiary78702
countryString!2 letter ISO code of the country the beneficiary resides inUS
tax_numberStringthe tax number of the beneficiary, this is only required for some countries111564839
contact_first_nameStringfirst name of the contact of the beneficiary (business only)George
contact_last_nameStringlast name of the contact of the beneficiary (business only)Castanza
business_nameStringname of business receiving paymentRoutefusion
name_on_bank_accountStringlegal owner of the bank accountThomas Jones
swift_bicStringSWIFT/BIC code of the bank; this can be an account number, CLABE or IBANCITIUS33XXX
account_typeAccountTypetype of the beneficiaries account, can only be checking or savingchecking
account_numberStringthe IBAN, CLABE, or account number of the bank account2345366452
routing_codeStringrouting code of the local financial systemA bank routing code
currencyStringthe 3 character code of the currency - NOT editable after creationUSD
bank_nameStringthe name of the banking institutionCitibank
branch_nameStringthe name of the bank branchLOS ANGELES-BRENTWOOD
bank_address1Stringline 1 of the bank address11726 SAN VICENTE BLVD
bank_address2Stringline 2 of the bank addressUnit 10
bank_cityStringthe city the bank is locatedLos Angeles
bank_state_province_regionStringthe state, region, or province the bank resides inCalifornia
bank_postal_codePostalCodethe postal code of the bank90049
bank_countryISO3166_1!the 2 character country code the bank resides in - NOT editable after creationUS

GraphQL Schema

enum BeneficiaryType {
  personal
  business
}

enum BeneficiaryState {
  accepted
  pending
  verified
  failed
}

enum VariableSubType {
  account_number
  iban
  clabe
  routing_number
  bank_code
  bsb
  anm
  bn_qst
  br
  cif
  cn_rn
  cnpj_cpf
  ein
  frp_tin_sst
  gst
  gst_uen
  kpp
  npwp
  rfc
  tin
  trn
  vat
}

enum AccountType {
  checking
  saving
}

type Beneficiary {
  id: UUID!
  entity: Entity!
  creator: UserAccount
  type: BeneficiaryType!
  state: BeneficiaryState
  email: Email!
  phone: String
  phone_country: String
  tax_number: TaxNumber

  first_name: String
  last_name: String
  address1: String
  address2: String
  city: String
  state_province_region: String
  postal_code: PostalCode
  country: ISO3166_1

  contact_first_name: String
  contact_last_name: String
  business_name: String

  name_on_bank_account: String
  swift_bic: SwiftBic
  account_number: BankAccountNumber
  account_type: AccountType
  routing_code: BankRoutingCode
  currency: ISO4217!
  bank_name: String
  branch_name: String
  bank_address1: String
  bank_address2: String
  bank_city: String
  bank_state_province_region: String
  bank_postal_code: PostalCode
  bank_country: ISO3166_1!
  created_date: DateTime
}

type ValidBankCodes {
  code: String
  bank_name: String
  swift_bic: String
}

type BeneficiaryRequiredFieldsItem {
  variable: String
  regex: String
  variable_sub_type: VariableSubType
  example: String
  enum: [String]
  valid_bank_codes: [ValidBankCodes]
}

type BeneficiaryRequiredFields {
  personal: [BeneficiaryRequiredFieldsItem]
  business: [BeneficiaryRequiredFieldsItem]
}

type BeneficiaryPage {
  items: [Beneficiary]
  pagination: Pagination
}

type Pagination {
  page: Int
  page_size: Int
  pages_total: Int
  items_total: Int
}

type FilterInput {
  key: String
  values: [String]
  value: Boolean
}

type PaginationInput {
  page: Int = 1
  page_size: Int = 20
}

type Query {
  # get beneficiary
  beneficiary(
    beneficiary_id: UUID!
  ): Beneficiary 

  # get all organization beneficiaries
  organizationBeneficiaries(
    search_terms: String # optional
    listFilter: ListFilter
  ): [Beneficiary] 

  # get all users beneficiaries
  userBeneficiaries(
    user_id: UUID!
    search_terms: String # optional
    listFilter: ListFilter
  ): [Beneficiary] 

  # get all entity beneficiaries
  entityBeneficiaries(
    entity_id: UUID!
    search_terms: String # optional
    listFilter: ListFilter
  ): [Beneficiary] 

  # get all required fields for beneficiary creation
  beneficiaryRequiredFields(
    bank_country: ISO3166_1!
    currency: ISO4217!
    beneficiary_country: ISO3166_1
  ): BeneficiaryRequiredFields

  beneficiariesPage(
    search_terms: String
    pagination: PaginationInput!
    filters: [FilterInput]
  ): BeneficiaryPage
}

type Mutation {
  # create personal beneficiary (must have a verified entity)
  createPersonalBeneficiary(
    user_id: UUID!
    entity_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!
    tax_number: TaxNumber

    name_on_bank_account: String
    swift_bic: SwiftBic
    account_type: AccountType
    # this can be account number, clabe or iban
    account_number: BankAccountNumber
    # this can be routing number, sort code or bank code, bsb
    routing_code: BankRoutingCode
    currency: ISO4217!
    bank_name: String
    # only required for some countries
    branch_name: String
    bank_address1: String
    bank_address2: String
    bank_city: String
    bank_state_province_region: String
    bank_postal_code: PostalCode
    bank_country: ISO3166_1!
  ): UUID

  # create business beneficiary (must have a verified entity)
  createBusinessBeneficiary(
    user_id: UUID!
    # must be verified
    entity_id: UUID!

    email: Email!
    phone: String
    phone_country: 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

    name_on_bank_account: String
    swift_bic: SwiftBic
    # this can be account number, clabe or iban
    account_number: BankAccountNumber
    account_type: AccountType # this can be checking or saving
    # this can be routing number, sort code or bank code
    routing_code: BankRoutingCode
    currency: ISO4217!
    bank_name: String
    # only required for some countries
    branch_name: String
    bank_address1: String
    bank_address2: String
    bank_city: String
    bank_state_province_region: String
    bank_postal_code: PostalCode
    bank_country: ISO3166_1!
  ): UUID
}