brex.onboarding
Module brex.onboarding
API
Definitions
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_brex.onboarding_1.5.0.png)
ballerinax/brex.onboarding Ballerina library
Overview
This is a generated connector for Brex Onboarding API v0.1 OpenAPI specification.
Onboarding APIs allows partners to refer their customers to Brex to streamline the process of creating new accounts for these customers. By submitting information for referrals, it removes the need for customers to enter in this information again.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create a Brex account account
- Obtain tokens by following this guide
Quickstart
To use the Brex Onboarding connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
First, import the ballerinax/onboarding
module into the Ballerina project.
import ballerinax/onboarding;
Step 2: Create a new connector instance
Create a onboarding:ClientConfig
with the <ACCESS_TOKEN>
obtained, and initialize the connector with it.
onboarding:ClientConfig clientConfig = { authConfig : { token: <ACCESS_TOKEN> } }; onboarding:Client baseClient = check new Client(clientConfig);
Step 3: Invoke connector operation
-
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to list referrals created using the connector.
public function main() { onboarding:ReferralPage|error response = baseClient->listReferralsGet(); if (response is onboarding:ReferralPage) { log:printInfo(response.toString()); } else { log:printError(response.message()); } }
-
Use
bal run
command to compile and run the Ballerina program.
Clients![](/images/permalink.svg)
brex.onboarding: Client![](/images/permalink.svg)
This is a generated connector for Brex Onboarding API v0.1 OpenAPI specification. Onboarding APIs allows partners to refer their customers to Brex to streamline the process of creating new accounts for these customers. By submitting information for referrals, it removes the need for customers to enter in this information again.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create a Brex account and obtain tokens by following this guide.
init (ConnectionConfig config, string serviceUrl)
- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://platform.staging.brexapps.com" - URL of the target service
listReferralsGet![](/images/permalink.svg)
function listReferralsGet(string? cursor) returns ReferralPage|error
List referrals
Parameters
- cursor string? (default ()) - The cursor
Return Type
- ReferralPage|error - listReferralsGet 200 response
createReferralRequestPost![](/images/permalink.svg)
function createReferralRequestPost(CreateReferralRequest payload) returns Referral|error
Creates a referral
Parameters
- payload CreateReferralRequest - Create referral request.
getReferralGet![](/images/permalink.svg)
Gets a referral by ID
Parameters
- id string - Referral ID.
createDocumentPost![](/images/permalink.svg)
function createDocumentPost(string id, CreateDocumentRequest payload) returns Document|error
Create a new document upload
Records![](/images/permalink.svg)
brex.onboarding: Account![](/images/permalink.svg)
If the application status is APPROVED, array of bank cash management accounts (note there is currently only one account per customer).
Fields
- id string - Brex cash management account Id.
- instructions Instruction? - Domestic and international ACH/Wire instructions.
- created_at string - Created date and time.
brex.onboarding: Address![](/images/permalink.svg)
Company business address (must be in the US; no PO box or virtual/forwarding addresses allowed).
Fields
- line1 string? - Address line 1, no PO Box.
- line2 string? - Address line 2 (e.g., apartment, suite, unit, or building).
- city string? - City, district, suburb, town, or village.
- state string? - For US-addressed the 2-letter State abbreviation. For international-addresses the County, Providence, or Region.
- country string? - Two-letter country code (ISO 3166-1 alpha-2).
- postal_code string? - ZIP or postal code.
- phone_number string? - Phone number.
brex.onboarding: Applicant![](/images/permalink.svg)
Required information about the referred prospect.
Fields
- last_name string - Last name of the applying customer.
- first_name string - First name of the applying customer.
- email string - Business Email of the applying customer.
brex.onboarding: Application![](/images/permalink.svg)
Application information.
Fields
- status ApplicationStatus - Application status of a product
brex.onboarding: BeneficialOwner![](/images/permalink.svg)
Federal law requires us to collect information for anyone who owns 25% or more of the company.
Fields
- legal_name string - Legal full name.
- company_relationship CompanyRelationship? - Relationship of this beneficial owner for this company.
- date_of_birth string? - Date of birth.
- identity_document IdentityDocument? - Document identifying the owner.
- address Address? - Company business address (must be in the US; no PO box or virtual/forwarding addresses allowed).
- prong Prong - Beneficial owner type
brex.onboarding: Business![](/images/permalink.svg)
Information about the business the application is for.
Fields
- legal_name string? - Company legal name.
- incorporation_type IncorporationType? - Incorporation type of the company referred
- employer_identification_number string? - Company Employer Identification Number(EIN).
- website_url string? - Business website (or link to Amazon store for sellers).
- activity_description string? - Brief description of the business activity.
- address Address? - Company business address (must be in the US; no PO box or virtual/forwarding addresses allowed).
- beneficial_owners BeneficialOwner[]? - List of beneficial owners of the company
- alternate_address Address? - Company business address (must be in the US; no PO box or virtual/forwarding addresses allowed).
brex.onboarding: Cash![](/images/permalink.svg)
Available if customer applied for Brex Cash.
Fields
- accounts Account[]? - An array of bank cash management accounts
- application Application - Application information.
brex.onboarding: ClientHttp1Settings![](/images/permalink.svg)
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
brex.onboarding: ConnectionConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth OAuth2ClientCredentialsGrantConfig - Configurations related to client authentication
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
brex.onboarding: CreateDocumentRequest![](/images/permalink.svg)
Request for creating new document upload url.
Fields
- 'type DocumentType - Type of document being submitted. Allowable types:
- ARTICLES_OF_INCORPORATION
- IRS_EIN_CONFIRMATION (IRS CP 575 or 147C form)
- IRS_EIN_APPLICATION (IRS SS4 form)
- CERTIFICATE_GOOD_STANDING
brex.onboarding: CreateReferralRequest![](/images/permalink.svg)
Submit a new referral to Brex for onboarding.
Fields
- referral_code string - Partner referral code to attribute this prospect to if they sign up.
- applicant Applicant - Required information about the referred prospect.
- business Business? - Information about the business the application is for.
- contact_preference ContactPreference? - When set to
EMAIL_OUTBOUND
, Brex will email the referred customer directly to prompt them to create their account rather than rely on the partner to direct the customer to claim the account. If not provided, the partner is responsible to contact the customer and the value defaults toNO_OUTBOUND
.
brex.onboarding: Document![](/images/permalink.svg)
Fields
- uri string - This is a presigned S3 link that should be used to attach the document. The maximum size accepted for this document is 50 MB
- id string - Unique identifier for the document.
brex.onboarding: DomesticInstruction![](/images/permalink.svg)
Domestic ACH/Wire instructions.
Fields
- account_type string - Account type.
- bank_account_number string - Account number.
- bank_routing_number string - Routing number.
- beneficiary_name string - Beneficiary name.
- beneficiary_address string - Beneficiary address.
- bank_name string - Bank name.
- bank_address string - Bank address.
brex.onboarding: IdentityDocument![](/images/permalink.svg)
Document identifying the owner.
Fields
- country string - Country where the identity document was issued.
- 'type IdentityDocumentType - Either US SSN or US/International Passport.
- number string - US SSN or Passport number.
brex.onboarding: Instruction![](/images/permalink.svg)
Domestic and international ACH/Wire instructions.
Fields
- domestic DomesticInstruction - Domestic ACH/Wire instructions.
- international InternationalInstruction - International Wire instructions.
brex.onboarding: InternationalInstruction![](/images/permalink.svg)
International Wire instructions.
Fields
- account_type string - Account type.
- swift_account_number string - Swift account number.
- swift_bank_number string - Swift bank number.
- beneficiary_name string - Beneficiary name.
- beneficiary_address string - Beneficiary address.
- bank_name string - Bank name.
- bank_address string - Bank address.
- special_instructions string - Special instructions.
brex.onboarding: OAuth2ClientCredentialsGrantConfig![](/images/permalink.svg)
OAuth2 Client Credentials Grant Configs
Fields
- Fields Included from *OAuth2ClientCredentialsGrantConfig
- tokenUrl string(default "https://accounts.brex.com/oauth2/v1/token") - Token URL
brex.onboarding: Product![](/images/permalink.svg)
Array of Brex products that the customer has applied for. This is a gated feature available to select clients only.
Fields
- cash Cash - Available if customer applied for Brex Cash.
brex.onboarding: ProxyConfig![](/images/permalink.svg)
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
brex.onboarding: Referral![](/images/permalink.svg)
Fields
- id string - Unique identifier for the referral.
- referral_signup_url string - Signup URL to redirect prospects to complete their onboarding flow. Note: Necessary disclosures must be shown when the prospect clicks on this link
- expires_at string - The time at which this referral link expires at.
- status ReferralStatus - Status of the referral.
UNCLAIMED
orEXPIRED
unless the customer completes sign up. Customers are attributed onceACTIVE
until the account isCLOSED
.
- products Product[] -
brex.onboarding: ReferralPage![](/images/permalink.svg)
Fields
- next_cursor string? -
- items Referral[] -
String types![](/images/permalink.svg)
brex.onboarding: ApplicationStatus![](/images/permalink.svg)
ApplicationStatus
Application status of a product
brex.onboarding: CompanyRelationship![](/images/permalink.svg)
CompanyRelationship
Relationship of this beneficial owner for this company.
brex.onboarding: ContactPreference![](/images/permalink.svg)
ContactPreference
When set to EMAIL_OUTBOUND
, Brex will email the referred customer directly to prompt them to create their account rather than rely on the partner to direct the customer to claim the account. If not provided, the partner is responsible to contact the customer and the value defaults to NO_OUTBOUND
.
brex.onboarding: DocumentType![](/images/permalink.svg)
DocumentType
Type of document being submitted. Allowable types:
- ARTICLES_OF_INCORPORATION
- IRS_EIN_CONFIRMATION (IRS CP 575 or 147C form)
- IRS_EIN_APPLICATION (IRS SS4 form)
- CERTIFICATE_GOOD_STANDING
brex.onboarding: IdentityDocumentType![](/images/permalink.svg)
IdentityDocumentType
Either US SSN or US/International Passport.
brex.onboarding: IncorporationType![](/images/permalink.svg)
IncorporationType
Incorporation type of the company referred
brex.onboarding: Prong![](/images/permalink.svg)
Prong
Beneficial owner type
brex.onboarding: ReferralStatus![](/images/permalink.svg)
ReferralStatus
Status of the referral. UNCLAIMED
or EXPIRED
unless the customer completes sign up. Customers are attributed once ACTIVE
until the account is CLOSED
.
Import
import ballerinax/brex.onboarding;
Metadata
Released date: over 1 year ago
Version: 1.5.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
Sales & CRM/Contact Management
Cost/Freemium
Contributors
Dependencies