Skip to main content
POST
/
exchanges
Create an exchange for an account
curl --request POST \
  --url https://api.dwolla.com/exchanges \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "_links": {
    "exchange-partner": {
      "href": "https://api.dwolla.com/exchange-partners/292317ec-e252-47d8-93c3-2d128e037aa4"
    }
  },
  "finicity": {
    "profile": 3,
    "version": "1",
    "receiptId": "cr_4N47ou7SlppuIxq0ZUtACh10vYcloY",
    "receiptVersion": "1",
    "customerId": "5454874858510164117",
    "partnerId": 2445583946651,
    "products": [
      {
        "product": "moneyTransferDetails",
        "accountId": "1015199035827334916",
        "accessPeriod": {
          "type": "timeframe",
          "startTime": "2022-07-06",
          "endTime": "2022-08-16T06:06:20Z"
        }
      }
    ],
    "timestamp": "2022-07-11T06:06:23Z"
  }
}
'
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_links: {
'exchange-partner': {
href: 'https://api.dwolla.com/exchange-partners/292317ec-e252-47d8-93c3-2d128e037aa4'
}
},
finicity: {
profile: 3,
version: '1',
receiptId: 'cr_4N47ou7SlppuIxq0ZUtACh10vYcloY',
receiptVersion: '1',
customerId: '5454874858510164117',
partnerId: 2445583946651,
products: [
{
product: 'moneyTransferDetails',
accountId: '1015199035827334916',
accessPeriod: {type: 'timeframe', startTime: '2022-07-06', endTime: '2022-08-16T06:06:20Z'}
}
],
timestamp: '2022-07-11T06:06:23Z'
}
})
};

fetch('https://api.dwolla.com/exchanges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.dwolla.com/exchanges"

payload = {
"_links": { "exchange-partner": { "href": "https://api.dwolla.com/exchange-partners/292317ec-e252-47d8-93c3-2d128e037aa4" } },
"finicity": {
"profile": 3,
"version": "1",
"receiptId": "cr_4N47ou7SlppuIxq0ZUtACh10vYcloY",
"receiptVersion": "1",
"customerId": "5454874858510164117",
"partnerId": 2445583946651,
"products": [
{
"product": "moneyTransferDetails",
"accountId": "1015199035827334916",
"accessPeriod": {
"type": "timeframe",
"startTime": "2022-07-06",
"endTime": "2022-08-16T06:06:20Z"
}
}
],
"timestamp": "2022-07-11T06:06:23Z"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dwolla.com/exchanges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'_links' => [
'exchange-partner' => [
'href' => 'https://api.dwolla.com/exchange-partners/292317ec-e252-47d8-93c3-2d128e037aa4'
]
],
'finicity' => [
'profile' => 3,
'version' => '1',
'receiptId' => 'cr_4N47ou7SlppuIxq0ZUtACh10vYcloY',
'receiptVersion' => '1',
'customerId' => '5454874858510164117',
'partnerId' => 2445583946651,
'products' => [
[
'product' => 'moneyTransferDetails',
'accountId' => '1015199035827334916',
'accessPeriod' => [
'type' => 'timeframe',
'startTime' => '2022-07-06',
'endTime' => '2022-08-16T06:06:20Z'
]
]
],
'timestamp' => '2022-07-11T06:06:23Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://api.dwolla.com/exchanges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"_links\": {\n \"exchange-partner\": {\n \"href\": \"https://api.dwolla.com/exchange-partners/292317ec-e252-47d8-93c3-2d128e037aa4\"\n }\n },\n \"finicity\": {\n \"profile\": 3,\n \"version\": \"1\",\n \"receiptId\": \"cr_4N47ou7SlppuIxq0ZUtACh10vYcloY\",\n \"receiptVersion\": \"1\",\n \"customerId\": \"5454874858510164117\",\n \"partnerId\": 2445583946651,\n \"products\": [\n {\n \"product\": \"moneyTransferDetails\",\n \"accountId\": \"1015199035827334916\",\n \"accessPeriod\": {\n \"type\": \"timeframe\",\n \"startTime\": \"2022-07-06\",\n \"endTime\": \"2022-08-16T06:06:20Z\"\n }\n }\n ],\n \"timestamp\": \"2022-07-11T06:06:23Z\"\n }\n}"

response = http.request(request)
puts response.read_body
{}
{
"code": "InvalidExchangeToken",
"message": "Exchange token is expired."
}
{
"code": "InvalidExchange",
"message": "The exchange is no longer active."
}
{
"code": "Forbidden",
"message": "The supplied credentials are not authorized for this resource."
}
{
"code": "NotFound",
"message": "The requested resource was not found."
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Parameters for creating an exchange

finicity
object
required

Response

Created

The response is of type object.