# CreateFundingRequest

Request managed returns funding setup for a company

`POST /api/v2/companies/{id}/funding/setup`

**API:** AvaTax API
**Tag:** Companies
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Companies/CreateFundingRequest/

## Description

This API is available by invitation only.
Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are
required to setup their funding configuration before Avalara can begin filing tax returns on their
behalf.
Funding configuration for each company is set up by submitting a funding setup request, which can
be sent either via email or via an embedded HTML widget.
When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members
before approval.
This API records that an ambedded HTML funding setup widget was activated.
This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider.

### Security Policies

* This API depends on the following active services:*Returns* (at least one of):  Mrs, MRSComplianceManager, AvaTaxCsp.
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, ProStoresOperator, Registrar, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `id` | integer | path | Yes | The unique identifier of the company |
| `businessUnit` | string | query | No | The company's business unit |
| `subscriptionType` | string | query | No | The company's subscription type |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `FundingInitiateModel`

| Property | Type | Required | Description |
|---|---|---|---|
| `requestEmail` | boolean | No | Set this value to true to request an email to the recipient Example: `true`. |
| `fundingEmailRecipient` | string | **Yes** | If you have requested an email for funding setup, this is the recipient who will receive an
email inviting them to setup funding configuration for Avalara Managed Returns.  The recipient can
then click on a link in the email and setup funding configuration for this company. Example: `user@example.org`. |
| `requestWidget` | boolean | No | Set this value to true to request an HTML-based funding widget that can be embedded within an
existing user interface.  A user can then interact with the HTML-based funding widget to set up
funding information for the company. |
| `currency` | string | No | Currency Example: `USD`. |
| `agreementType` | string | No | AgreementType Example: `ACHDebit`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `FundingStatusModel` |
| 400 | Bad Request | `ProblemDetails` |
| 401 | Unauthorized | `ProblemDetails` |
| 404 | Not Found | `ProblemDetails` |

### 200 Response: `FundingStatusModel`

Status of an Avalara Managed Returns funding configuration for a company

| Property | Type | Required | Description |
|---|---|---|---|
| `requestId` | integer | No | The unique ID number of this funding request |
| `subledgerProfileID` | integer | No | SubledgerProfileID |
| `companyID` | string | No | CompanyID |
| `domain` | string | No | Domain |
| `recipient` | string | No | Recipient |
| `sender` | string | No | Sender |
| `documentKey` | string | No | DocumentKey |
| `documentType` | string | No | DocumentType |
| `documentName` | string | No | DocumentName |
| `methodReturn` | FundingESignMethodReturn | No | MethodReturn |
| `status` | string | No | Status |
| `errorMessage` | string | No | ErrorMessage |
| `lastPolled` | string | No | LastPolled |
| `lastSigned` | string | No | LastSigned |
| `lastActivated` | string | No | LastActivated |
| `templateRequestId` | integer | No | TemplateRequestId |
| `currency` | string | No | Currency |
| `agreementType` | string | No | AgreementType |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{id}/funding/setup" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "requestEmail": true,
  "fundingEmailRecipient": "user@example.org",
  "currency": "USD",
  "agreementType": "ACHDebit"
}'
```