diff --git a/.changeset/update-receiver-api.md b/.changeset/update-receiver-api.md new file mode 100644 index 0000000..b1699da --- /dev/null +++ b/.changeset/update-receiver-api.md @@ -0,0 +1,13 @@ +--- +"@blindpay/node": minor +--- + +Update receiver and virtual account types according to API reference + +- Add new enum types: `AccountPurpose`, `BusinessType`, `BusinessIndustry`, `EstimatedAnnualRevenue`, `SourceOfWealth` +- Update `Owner` type with `ownership_percentage` and `title` fields +- Make only `country` and `email` required in create input types, all other fields optional/nullable +- Add new optional fields to individual receiver types: `account_purpose`, `selfie_file`, `source_of_wealth` +- Add new optional fields to business receiver type: `account_purpose`, `business_description`, `business_industry`, `business_type`, `estimated_annual_revenue`, `publicly_traded`, `source_of_wealth` +- Add `hsbc` to `BankingPartner` type +- Add optional `signed_agreement_id` to `CreateVirtualAccountInput` diff --git a/package.json b/package.json index d080437..1fc35a4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@blindpay/node", - "version": "3.1.1", - "description": "Official Node.js SDK for Blindpay API - Global payments infrastructure", + "version": "3.2.0", + "description": "Official Node.js SDK for Blindpay API - Stablecoin API for global payments", "keywords": [ "blindpay", "payments", diff --git a/src/resources/receivers/index.ts b/src/resources/receivers/index.ts index f9451c1..af1df5f 100644 --- a/src/resources/receivers/index.ts +++ b/src/resources/receivers/index.ts @@ -21,6 +21,90 @@ export type PurposeOfTransactions = | "receive_salary" | "other"; +export type AccountPurpose = + | "charitable_donations" + | "ecommerce_retail_payments" + | "investment_purposes" + | "business_expenses" + | "payments_to_friends_or_family_abroad" + | "personal_or_living_expenses" + | "protect_wealth" + | "purchase_goods_and_services" + | "receive_payments_for_goods_and_services" + | "tax_optimization" + | "third_party_money_transmission" + | "other" + | "payroll" + | "treasury_management"; + +export type BusinessType = + | "corporation" + | "llc" + | "partnership" + | "sole_proprietorship" + | "trust" + | "non_profit"; + +export type BusinessIndustry = + | "541511" + | "541512" + | "541519" + | "518210" + | "511210" + | "541611" + | "541618" + | "541330" + | "541990" + | "522110" + | "523110" + | "523920" + | "423430" + | "423690" + | "423110" + | "423830" + | "423840" + | "423510" + | "424210" + | "424690" + | "424990" + | "454110" + | "334111" + | "334118" + | "325412" + | "339112" + | "336111" + | "336390" + | "551112" + | "561499" + | "488510" + | "484121" + | "493110" + | "424410" + | "424480" + | "315990" + | "313110" + | "213112" + | "517110" + | "541214"; + +export type EstimatedAnnualRevenue = + | "0_99999" + | "100000_999999" + | "1000000_9999999" + | "10000000_49999999" + | "50000000_249999999" + | "2500000000_plus"; + +export type SourceOfWealth = + | "business_dividends_or_profits" + | "investments" + | "asset_sales" + | "client_investor_contributions" + | "gambling" + | "charitable_contributions" + | "inheritance" + | "affiliate_or_royalty_income"; + export type SourceOfFundsDocType = | "business_income" | "gambling_proceeds" @@ -60,7 +144,9 @@ export type Owner = { id_doc_front_file: string; id_doc_back_file: string | null; proof_of_address_doc_type: ProofOfAddressDocType; - proof_of_address_doc_file: string; + proof_of_address_doc_file: string | null; + ownership_percentage: number | null; + title: string | null; }; export type IndividualWithStandardKYC = { @@ -203,26 +289,33 @@ export type BusinessWithStandardKYB = { }; export type CreateIndividualWithStandardKYCInput = { - external_id?: string; - address_line_1: string; - address_line_2?: string; - city: string; country: Country; - date_of_birth: string; email: string; - first_name: string; - phone_number: string | null; - id_doc_country: Country; - id_doc_front_file: string; - id_doc_type: IdentificationDocument; - id_doc_back_file: string | null; - last_name: string; - postal_code: string; - proof_of_address_doc_file: string; - proof_of_address_doc_type: ProofOfAddressDocType; - state_province_region: string; - tax_id: string; - tos_id: string; + account_purpose?: AccountPurpose | null; + address_line_1?: string | null; + address_line_2?: string | null; + city?: string | null; + date_of_birth?: string | null; + external_id?: string | null; + first_name?: string | null; + id_doc_back_file?: string | null; + id_doc_country?: Country | null; + id_doc_front_file?: string | null; + id_doc_type?: IdentificationDocument | null; + image_url?: string | null; + ip_address?: string | null; + last_name?: string | null; + phone_number?: string | null; + postal_code?: string | null; + proof_of_address_doc_file?: string | null; + proof_of_address_doc_type?: ProofOfAddressDocType | null; + selfie_file?: string | null; + source_of_funds_doc_file?: string | null; + source_of_funds_doc_type?: SourceOfFundsDocType | null; + source_of_wealth?: SourceOfWealth | null; + state_province_region?: string | null; + tax_id?: string | null; + tos_id?: string | null; }; export type CreateIndividualWithStandardKYCResponse = { @@ -230,31 +323,35 @@ export type CreateIndividualWithStandardKYCResponse = { }; export type CreateIndividualWithEnhancedKYCInput = { - external_id?: string; - address_line_1: string; - address_line_2?: string; - city: string; country: Country; - date_of_birth: string; email: string; - first_name: string; - id_doc_country: Country; - id_doc_front_file: string; - id_doc_type: IdentificationDocument; - id_doc_back_file: string | null; - individual_holding_doc_front_file: string; - last_name: string; - postal_code: string; - phone_number: string | null; - proof_of_address_doc_file: string; - proof_of_address_doc_type: ProofOfAddressDocType; - purpose_of_transactions: PurposeOfTransactions; - source_of_funds_doc_file: string; - source_of_funds_doc_type: SourceOfFundsDocType; - purpose_of_transactions_explanation: string | null; - state_province_region: string; - tax_id: string; - tos_id: string; + account_purpose?: AccountPurpose | null; + address_line_1?: string | null; + address_line_2?: string | null; + city?: string | null; + date_of_birth?: string | null; + external_id?: string | null; + first_name?: string | null; + id_doc_back_file?: string | null; + id_doc_country?: Country | null; + id_doc_front_file?: string | null; + id_doc_type?: IdentificationDocument | null; + image_url?: string | null; + ip_address?: string | null; + last_name?: string | null; + phone_number?: string | null; + postal_code?: string | null; + proof_of_address_doc_file?: string | null; + proof_of_address_doc_type?: ProofOfAddressDocType | null; + purpose_of_transactions?: PurposeOfTransactions | null; + purpose_of_transactions_explanation?: string | null; + selfie_file?: string | null; + source_of_funds_doc_file?: string | null; + source_of_funds_doc_type?: SourceOfFundsDocType | null; + source_of_wealth?: SourceOfWealth | null; + state_province_region?: string | null; + tax_id?: string | null; + tos_id?: string | null; }; export type CreateIndividualWithEnhancedKYCResponse = { @@ -262,25 +359,37 @@ export type CreateIndividualWithEnhancedKYCResponse = { }; export type CreateBusinessWithStandardKYBInput = { - external_id?: string; - address_line_1: string; - address_line_2?: string; - alternate_name: string; - city: string; country: Country; email: string; - formation_date: string; - incorporation_doc_file: string; - legal_name: string; - owners: Array>; - postal_code: string; - proof_of_address_doc_file: string; - proof_of_address_doc_type: ProofOfAddressDocType; - proof_of_ownership_doc_file: string; - state_province_region: string; - tax_id: string; - tos_id: string; - website: string | null; + account_purpose?: AccountPurpose | null; + address_line_1?: string | null; + address_line_2?: string | null; + alternate_name?: string | null; + business_description?: string | null; + business_industry?: BusinessIndustry | null; + business_type?: BusinessType | null; + city?: string | null; + estimated_annual_revenue?: EstimatedAnnualRevenue | null; + external_id?: string | null; + formation_date?: string | null; + image_url?: string | null; + incorporation_doc_file?: string | null; + ip_address?: string | null; + legal_name?: string | null; + owners?: Array> | null; + phone_number?: string | null; + postal_code?: string | null; + proof_of_address_doc_file?: string | null; + proof_of_address_doc_type?: ProofOfAddressDocType | null; + proof_of_ownership_doc_file?: string | null; + publicly_traded?: boolean | null; + source_of_funds_doc_file?: string | null; + source_of_funds_doc_type?: SourceOfFundsDocType | null; + source_of_wealth?: SourceOfWealth | null; + state_province_region?: string | null; + tax_id?: string | null; + tos_id?: string | null; + website?: string | null; }; export type CreateBusinessWithStandardKYBResponse = { @@ -300,59 +409,47 @@ export type GetReceiverResponse = export type UpdateReceiverInput = { receiver_id: string; - email?: string; - tax_id?: string; + account_purpose?: AccountPurpose | null; address_line_1?: string; address_line_2?: string; + alternate_name?: string; + business_description?: string; + business_industry?: BusinessIndustry | null; + business_type?: BusinessType | null; city?: string; - state_province_region?: string; country?: Country; - postal_code?: string; - ip_address?: string; - image_url?: string; - phone_number?: string; - proof_of_address_doc_type?: ProofOfAddressDocType; - proof_of_address_doc_file?: string; - first_name?: string; - last_name?: string; date_of_birth?: string; + email?: string; + estimated_annual_revenue?: EstimatedAnnualRevenue | null; + external_id?: string; + first_name?: string; + formation_date?: string; + id_doc_back_file?: string; id_doc_country?: Country; - id_doc_type?: IdentificationDocument; id_doc_front_file?: string; - id_doc_back_file?: string; - legal_name?: string; - alternate_name?: string; - formation_date?: string; - website?: string; - owners?: Array< - Pick< - Owner, - | "first_name" - | "last_name" - | "role" - | "date_of_birth" - | "tax_id" - | "address_line_1" - | "address_line_2" - | "city" - | "state_province_region" - | "country" - | "postal_code" - | "id_doc_country" - | "id_doc_type" - | "id_doc_front_file" - | "id_doc_back_file" - > - >; + id_doc_type?: IdentificationDocument; + image_url?: string; incorporation_doc_file?: string; + ip_address?: string; + last_name?: string; + legal_name?: string; + owners?: Array>; + phone_number?: string; + postal_code?: string; + proof_of_address_doc_file?: string; + proof_of_address_doc_type?: ProofOfAddressDocType; proof_of_ownership_doc_file?: string; - source_of_funds_doc_type?: SourceOfFundsDocType; - source_of_funds_doc_file?: string; - individual_holding_doc_front_file?: string; + publicly_traded?: boolean | null; purpose_of_transactions?: PurposeOfTransactions; purpose_of_transactions_explanation?: string; - external_id?: string; + selfie_file?: string; + source_of_funds_doc_file?: string; + source_of_funds_doc_type?: SourceOfFundsDocType; + source_of_wealth?: SourceOfWealth | null; + state_province_region?: string; + tax_id?: string; tos_id?: string; + website?: string; }; export type DeleteReceiverInput = string; diff --git a/src/resources/receivers/receivers.test.ts b/src/resources/receivers/receivers.test.ts index 91ef9fb..ad75740 100644 --- a/src/resources/receivers/receivers.test.ts +++ b/src/resources/receivers/receivers.test.ts @@ -151,6 +151,8 @@ describe("Receivers", () => { id_doc_back_file: "https://example.com/image.png", proof_of_address_doc_type: "UTILITY_BILL", proof_of_address_doc_file: "https://example.com/image.png", + ownership_percentage: 25, + title: "CEO", id: "ub_000000000000", }, ], @@ -193,12 +195,12 @@ describe("Receivers", () => { const { data, error } = await blindpay.receivers.createIndividualWithStandardKYC({ email: "bernardo.simonassi@gmail.com", + country: "BR", tax_id: "12345678900", address_line_1: "Av. Paulista, 1000", address_line_2: "Apto 101", city: "São Paulo", state_province_region: "SP", - country: "BR", postal_code: "01310-100", phone_number: "+5511987654321", first_name: "Bernardo", @@ -228,12 +230,12 @@ describe("Receivers", () => { const { data, error } = await blindpay.receivers.createIndividualWithEnhancedKYC({ email: "bernardo.simonassi@gmail.com", + country: "BR", tax_id: "12345678900", address_line_1: "Av. Paulista, 1000", address_line_2: "Apto 101", city: "São Paulo", state_province_region: "SP", - country: "BR", postal_code: "01310-100", first_name: "Bernardo", last_name: "Simonassi", @@ -245,12 +247,12 @@ describe("Receivers", () => { id_doc_back_file: "https://example.com/image.png", proof_of_address_doc_type: "UTILITY_BILL", proof_of_address_doc_file: "https://example.com/image.png", - individual_holding_doc_front_file: "https://example.com/image.png", purpose_of_transactions: "personal_or_living_expenses", source_of_funds_doc_type: "savings", purpose_of_transactions_explanation: "I am receiving salary payments from my employer", source_of_funds_doc_file: "https://example.com/image.png", + selfie_file: "https://example.com/image.png", tos_id: "to_3ZZhllJkvo5Z", }); @@ -269,12 +271,12 @@ describe("Receivers", () => { const { data, error } = await blindpay.receivers.createBusinessWithStandardKYB({ email: "contato@empresa.com.br", + country: "BR", tax_id: "20096178000195", address_line_1: "Av. Brigadeiro Faria Lima, 400", address_line_2: "Sala 1201", city: "São Paulo", state_province_region: "SP", - country: "BR", postal_code: "04538-132", legal_name: "Empresa Exemplo Ltda", alternate_name: "Exemplo", @@ -285,6 +287,13 @@ describe("Receivers", () => { proof_of_ownership_doc_file: "https://example.com/image.png", tos_id: "to_nppX66ntvtHs", website: "https://site.com/", + business_type: "llc", + business_description: "Software development company", + business_industry: "541511", + estimated_annual_revenue: "1000000_9999999", + source_of_wealth: "affiliate_or_royalty_income", + publicly_traded: false, + account_purpose: "treasury_management", owners: [ { role: "beneficial_owner", @@ -304,6 +313,8 @@ describe("Receivers", () => { id_doc_back_file: "https://example.com/image.png", proof_of_address_doc_type: "UTILITY_BILL", proof_of_address_doc_file: "https://example.com/image.png", + ownership_percentage: 25, + title: "CEO", }, ], }); @@ -426,13 +437,16 @@ describe("Receivers", () => { id_doc_type: "PASSPORT", id_doc_front_file: "https://example.com/image.png", id_doc_back_file: "https://example.com/image.png", + proof_of_address_doc_type: "UTILITY_BILL", + proof_of_address_doc_file: "https://example.com/image.png", + ownership_percentage: 25, + title: "CEO", }, ], incorporation_doc_file: "https://example.com/image.png", proof_of_ownership_doc_file: "https://example.com/image.png", source_of_funds_doc_type: "savings", source_of_funds_doc_file: "https://example.com/image.png", - individual_holding_doc_front_file: "https://example.com/image.png", purpose_of_transactions: "personal_or_living_expenses", purpose_of_transactions_explanation: "I am receiving salary payments from my employer", diff --git a/src/resources/virtual-accounts/index.ts b/src/resources/virtual-accounts/index.ts index 5a9b4f0..12267b8 100644 --- a/src/resources/virtual-accounts/index.ts +++ b/src/resources/virtual-accounts/index.ts @@ -1,7 +1,7 @@ import type { BlindpayApiResponse, Network, StablecoinToken } from "../../../types"; import type { InternalApiClient } from "../../internal/api-client"; -export type BankingPartner = "jpmorgan" | "citi"; +export type BankingPartner = "jpmorgan" | "citi" | "hsbc"; export type VirtualAccount = { id: string; @@ -47,6 +47,7 @@ export type CreateVirtualAccountInput = { banking_partner: BankingPartner; token: StablecoinToken; blockchain_wallet_id: string; + signed_agreement_id?: string | null; }; export type CreateVirtualAccountResponse = VirtualAccount; diff --git a/src/resources/virtual-accounts/virtual-accounts.test.ts b/src/resources/virtual-accounts/virtual-accounts.test.ts index f1239e2..5b26b54 100644 --- a/src/resources/virtual-accounts/virtual-accounts.test.ts +++ b/src/resources/virtual-accounts/virtual-accounts.test.ts @@ -201,6 +201,7 @@ describe("Virtual accounts", () => { banking_partner: "jpmorgan", blockchain_wallet_id: "bw_000000000000", token: "USDC", + signed_agreement_id: "123e4567-e89b-12d3-a456-426614174000", }); expect(error).toBeNull();