## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://developers.dwolla.com/llms.txt)

Use this file to discover all available pages before exploring further.

---

### API Request

**POST**

`https://api-sandbox.dwolla.com/on-demand-authorizations`

**cURL**

```bash
POST https://api-sandbox.dwolla.com/on-demand-authorizations
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY

{
  "_links": {
    "self": {
      "href": "https://api-sandbox.dwolla.com/on-demand-authorizations/30e7c028-0bdf-e511-80de-0aa34a9b2388"
    }
  },
  "bodyText": "I agree that future payments to Company ABC inc. will be processed by the Dwolla payment system from the selected account above. In order to cancel this authorization, I will change my payment settings within my Company ABC inc. account.",
  "buttonText": "Agree & Continue"
}
```

```javascript
// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
dwolla.post("on-demand-authorizations").then((res) => res.body.buttonText); // => "Agree & Continue"
```

```python
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
on_demand_authorization = app_token.post('on-demand-authorizations')
on_demand_authorization.body['buttonText'] # => 'Agree & Continue'
```

```php
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$onDemandApi = new DwollaSwagger\OndemandauthorizationsApi($apiClient);

$onDemandAuth = $onDemandApi->createAuthorization();
$onDemandAuth->_links["self"]->href; # => "https://api-sandbox.dwolla.com/on-demand-authorizations/30e7c028-0bdf-e511-80de-0aa34a9b2388"
?>
```

```ruby
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
on_demand_authorization = app_token.post "on-demand-authorizations"
on_demand_authorization.buttonText # => "Agree & Continue"
```

### Responses

**200**

```json
{
  "_links": {
    "self": {
      "href": "https://api.dwolla.com/on-demand-authorizations/30e7c028-0bdf-e511-80de-0aa34a9b2388"
    }
  },
  "bodyText": "I agree that future payments to Company ABC inc. will be processed by the Dwolla payment system from the selected account above. In order to cancel this authorization, I will change my payment settings within my Company ABC inc. account.",
  "buttonText": "Agree & Continue"
}
```

**403**

```json
{
  "code": "Forbidden",
  "message": "The supplied credentials are not authorized for this resource."
}
```

### Authorizations

**Authorization**  
- **Type**: string  
- **Location**: header  
- **Required**: Yes  
- **Description**: The access token received from the authorization server in the OAuth 2.0 flow.

### Headers

**Accept**  
- **Type**: enum<string>  
- **Default**: application/vnd.dwolla.v1.hal+json  
- **Required**: Yes  
- **Description**: The media type of the response. Must be application/vnd.dwolla.v1.hal+json  
- **Available options**: `application/vnd.dwolla.v1.hal+json`

### Response Structure

**Response Content**
- **200**
- **Type**: application/vnd.dwolla.v1.hal+json  
- **Description**: Ok

#### Response Format

- `_links`
  - `object`
  - **Attributes**  
- `bodyText`
  - `string`
  - **Example**: "I agree that future payments to Company ABC inc. will be processed by the Dwolla payment system from the selected account above..."
- `buttonText`
  - `string`
  - **Example**: "Agree & Continue"
