## Onboarding API examples **Create a referral.** ```json POST https://api.brex.com/v1/referrals REQUEST { "referral_code": "partner_refcode", "applicant": { "first_name": "John", "last_name": "Doe", "email": "john.doe@doeinc.com" }, "business": { "legal_name": "Doe Inc", "Incorporation_type": "C-CORP", "website": "doeinc.com" } } RESPONSE { "id": "referral_123", "referral_signup_url": "https://www.brex.com/signup/?pref_token=onb-mock-no-business", "expires_at": "2021-01-11T15:52:34.234Z", "status": "UNCLAIMED", "products": [ { "cash": { "application": { "status": "NO_ACCOUNT" } } } ] } ``` The returned referral signup link can be provided to the user and will prefill the application form. See example signup link [here](https://www.brex.com/signup/?pref_token=onb-mock-no-business). **Get an update about the application status of a referral.** ```json GET https://api.brex.com/v1/referrals/referral_123 RESPONSE { "id": "referral_123", "referral_signup_url": "https://www.brex.com/signup/?pref_token=onb-mock-no-business", "expires_at": "2021-01-11T15:52:34.234Z", "status": "ACTIVE", "products": [ { "cash": { "application": { "status": "ACTIVE" } } } ] } ``` **Attach supporting documentation to a referral.** Step 1: Generate an upload link. ```json PUT https://api.brex.com/v1/referrals/referral_123/document_upload REQUEST { "type": "ARTICLES_OF_INCORPORATION" } RESPONSE { "uri": "https://s3.amazonaws.com/destination-link", "id": "document_123" } ``` Step 2: Upload the file to the URL provided. ```json PUT https://s3.amazonaws.com/destination-link REQUEST * binary file content ```