Unable to create a funding source for a customer using an exchange resource

Hi @dwollasupport , @DwollaDiscuss , @spencer, @shreya I tried to create a funding source for a customer using an exchange resource

Endpoint: https://api.dwolla.com/customers/{id}/funding-sources

But i received the response below. Please help to check. Thank you in advanced!

[response] => Array
        (
            [code] => 400
            [reason] => Bad Request
            [body] => {"code":"BadRequest","message":"Exchange product invalid for this operation"}
        )

Additional Information:

Array
(
    [request] => Array
        (
            [url] => https://api-sandbox.dwolla.com/customers/79523a64-93d4-4ed9-8d88-8655cd29dc5a/funding-sources
            [method] => POST
            [headers] => Array
                (
                    [User-Agent] => Array
                        (
                            [0] => Guzzle/7
                        )

                    [Host] => Array
                        (
                            [0] => api-sandbox.dwolla.com
                        )

                    [X-Requested-With] => Array
                        (
                            [0] => XMLHttpRequest
                        )

                    [Content-Type] => Array
                        (
                            [0] => application/vnd.dwolla.v1.hal+json
                        )

                    [Cache-Control] => Array
                        (
                            [0] => no-cache
                        )

                    [Pragma] => Array
                        (
                            [0] => no-cache
                        )

                    [Authorization] => Array
                        (
                            [0] => Bearer 1c4ajTISbjmYKR2P1nkiU3RkUqrlf5WJ3F7kCYjBTGN2LoYUpR
                        )

                    [Accept] => Array
                        (
                            [0] => application/vnd.dwolla.v1.hal+json
                        )

                )

            [body] => {"_links":{"exchange":{"href":"https:\/\/api-sandbox.dwolla.com\/exchanges\/261c1ede-e5f6-4114-9a30-ef95f5136bc0"}},"bankAccountType":"checking","name":"Jane Doe\u2019s Checking"}
            [config] => Array
                (
                    [curl] => Array
                        (
                            [10065] => /****/../Resources/cacert.pem
                            [81] => 2
                            [64] => 1
                            [19913] => 1
                            [52] => 1
                            [42] => 
                        )

                )

        )

    [response] => Array
        (
            [code] => 400
            [reason] => Bad Request
            [body] => {"code":"BadRequest","message":"Exchange product invalid for this operation"}
        )

)

Hi @phong.vnnguyen , can you provide some more details on what your create an exchange request looks like?

Hi @spencer , I tried steps on guide. But It was failed at step “Create Funding Source for Customer”

--------------------------------+
FINICITY
±------------------------------+
Step: Create a Customer => Passed
Reponse: data

{
    "id": "6017528936",
    "username": "customer_ 6017528936",
    "createdDate": "1672726754"
}

Step: Generate Connect URL => Passed
Response Data:

{
    "link": "https://connect2.finicity.com?customerId=6017528936&institutionId=4222&language=en&origin=url&partnerId=2445581542094&redirectUri=https%3A%2F%2Fwww.finicity.com%2Fconnect%2F&signature=283554c415ee9660085e690c2bd6f3313f05b41ed024f666a466a7c393c6db93&timestamp=1672726692647&ttl=1672733892647&type=lite&webhookContentType=application%2Fjson"
}

Step: Fetch Customer Account(s) => Passed

{
    "accounts": [
        {
            "id": "6030196344",
            "number": "8000008888",
            "accountNumberDisplay": "8888",
            "name": "Auto Loan",
            "balance": -103.51,
            "type": "loan",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "displayPosition": 1,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Auto Loan",
            "marketSegment": "personal"
        },
        {
            "id": "6030196345",
            "number": "2000005555",
            "accountNumberDisplay": "5555",
            "name": "Home Mortgage",
            "balance": -103.51,
            "type": "mortgage",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "displayPosition": 7,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Home Mortgage",
            "marketSegment": "personal"
        },
        {
            "id": "6030196346",
            "number": "2000004444",
            "accountNumberDisplay": "4444",
            "name": "Roth IRA",
            "balance": 103.51,
            "type": "investment",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "detail": {},
            "displayPosition": 3,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Roth IRA",
            "marketSegment": "personal"
        },
        {
            "id": "6030196347",
            "number": "0000000000",
            "accountNumberDisplay": "0000",
            "name": "Brokerage",
            "balance": 103.51,
            "type": "investment",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "detail": {},
            "displayPosition": 8,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Brokerage",
            "marketSegment": "personal"
        },
        {
            "id": "6030196348",
            "number": "8000006666",
            "accountNumberDisplay": "6666",
            "name": "Line of Credit",
            "balance": -103.51,
            "type": "lineOfCredit",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "detail": {},
            "displayPosition": 4,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Line of Credit",
            "marketSegment": "personal"
        },
        {
            "id": "6030196349",
            "number": "4100007777",
            "accountNumberDisplay": "7777",
            "name": "Credit Card",
            "balance": 103.51,
            "type": "creditCard",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "displayPosition": 2,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Credit Card",
            "marketSegment": "personal"
        },
        {
            "id": "6030196350",
            "number": "1000002222",
            "accountNumberDisplay": "2222",
            "name": "Savings",
            "balance": 103.51,
            "type": "savings",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "detail": {
                "availableBalanceAmount": 103.51
            },
            "displayPosition": 6,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Savings",
            "marketSegment": "personal"
        },
        {
            "id": "6030196351",
            "number": "1000001111",
            "accountNumberDisplay": "1111",
            "name": "Checking",
            "balance": 103.51,
            "type": "checking",
            "status": "active",
            "customerId": "6017528936",
            "institutionId": "101732",
            "balanceDate": 1672717909,
            "createdDate": 1672717909,
            "currency": "USD",
            "institutionLoginId": 6014561415,
            "detail": {
                "availableBalanceAmount": 103.51
            },
            "displayPosition": 5,
            "financialinstitutionAccountStatus": "OPEN",
            "accountNickname": "Checking",
            "marketSegment": "personal"
        }
    ]
}

Step: Fetch Partner Consent - Create an Access Key => Passed

{
    "data": [
        {
            "receipt": {
                "profile": 3,
                "version": "1",
                "receiptId": "cr_4FYEfjdshe20mKoxYNO6RBSPWxKmk5",
                "receiptVersion": "1",
                "customerId": "6921846398372725471",
                "partnerId": 2445583094600,
                "products": [
                    {
                        "product": "moneyTransferDetails",
                        "accountId": "5730384519668800514",
                        "accessPeriod": {
                            "type": "timeframe",
                            "startTime": "2023-01-01T00:00:00Z",
                            "endTime": "2023-01-31T23:59:59Z"
                        }
                    }
                ],
                "timestamp": "2023-01-03T04:27:31Z"
            },
            "proof": {
                "signature": "JTdCJTIyY3VzdG9tZXJJZCUyMiUzQSUyMjY5MjE4NDYzOTgzNzI3MjU0NzElMjIlMkMlMjJwYXJ0bmVySWQlMjIlM0ElMjIyNDQ1NTgzMDk0NjAwJTIyJTJDJTIycHJvZHVjdHMlMjIlM0ElNUIlN0IlMjJhY2Nlc3NQZXJpb2QlMjIlM0ElN0IlMjJlbmRUaW1lJTIyJTNBJTIyMjAyMy0wMS0zMVQyMyUzQTU5JTNBNTlaJTIyJTJDJTIyc3RhcnRUaW1lJTIyJTNBJTIyMjAyMy0wMS0wMVQwMCUzQTAwJTNBMDBaJTIyJTJDJTIydHlwZSUyMiUzQSUyMnRpbWVmcmFtZSUyMiU3RCUyQyUyMmFjY291bnRJZCUyMiUzQSUyMjU3MzAzODQ1MTk2Njg4MDA1MTQlMjIlMkMlMjJwcm9kdWN0JTIyJTNBJTIybW9uZXlUcmFuc2ZlckRldGFpbHMlMjIlN0QlNUQlMkMlMjJwcm9maWxlJTIyJTNBMyUyQyUyMnByb3ZlbmFuY2UlMjIlM0FudWxsJTJDJTIycmVjZWlwdElkJTIyJTNBJTIyY3JfNEZZRWZqZHNoZTIwbUtveFlOTzZSQlNQV3hLbWs1JTIyJTJDJTIycmVjZWlwdFZlcnNpb24lMjIlM0ExJTJDJTIydGltZXN0YW1wJTIyJTNBJTIyMjAyMy0wMS0wM1QwNCUzQTI3JTNBMzFaJTIyJTJDJTIydmVyc2lvbiUyMiUzQSUyMjElMjIlN0Q=",
                "keyId": "867-530-900",
                "timestamp": "2023-01-03T04:27:31Z"
            }
        }
    ]
}

--------------------------------+
**Dwolla **
±------------------------------+

Step: Create a Customer => Passed
Response data:

https://api-sandbox.dwolla.com/customers/63bedd33-f86b-4071-9e2b-9fc6c2e260ad

Step: Fetch Available Exchange Partners => Passed
Response data:

{
    "_links": {
        "self": {
            "href": "https://api-sandbox.dwolla.com/exchange-partners",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "exchange-partner"
        }
    },
    "_embedded": {
        "exchange-partners": [
            {
                "_links": {
                    "self": {
                        "href": "https://api-sandbox.dwolla.com/exchange-partners/9b55a4b3-34ae-4607-b2d1-622f1eed77f9",
                        "type": "application/vnd.dwolla.v1.hal+json",
                        "resource-type": "exchange-partner"
                    },
                    "funding-source": {
                        "href": "https://api-sandbox.dwolla.com/funding-sources",
                        "type": "application/vnd.dwolla.v1.hal+json",
                        "resource-type": "funding-source"
                    }
                },
                "id": "9b55a4b3-34ae-4607-b2d1-622f1eed77f9",
                "name": "Finicity",
                "status": "active",
                "created": "2022-05-17T18:33:43.272Z"
            },
            {
                "_links": {
                    "self": {
                        "href": "https://api-sandbox.dwolla.com/exchange-partners/bca8d065-49a5-475b-a6b4-509bc8504d22",
                        "type": "application/vnd.dwolla.v1.hal+json",
                        "resource-type": "exchange-partner"
                    },
                    "funding-source": {
                        "href": "https://api-sandbox.dwolla.com/funding-sources",
                        "type": "application/vnd.dwolla.v1.hal+json",
                        "resource-type": "funding-source"
                    }
                },
                "id": "bca8d065-49a5-475b-a6b4-509bc8504d22",
                "name": "MX",
                "status": "active",
                "created": "2022-08-31T14:16:48.173Z"
            }
        ]
    },
    "total": 2
}

Step: Create Exchange for Customer => Passed

Response data:

https://api-sandbox.dwolla.com/exchanges/d7455e1e-f16f-4070-8a03-ea76b63c7427

Step: Create Funding Source for Customer => Failed

Endpoint: https://api-sandbox.dwolla.com/customers/63bedd33-f86b-4071-9e2b-9fc6c2e260ad/funding-sources
Method: POST

{
  "_links": {
    "exchange": {
      "href": "https://api-sandbox.dwolla.com/exchanges/d7455e1e-f16f-4070-8a03-ea76b63c7427"
    }
  },
  "bankAccountType": "checking",
  "names": "Jane Doe test"
}

Showing message errors:

{
    "code": "BadRequest",
    "message": "Exchange product invalid for this operation"
}

Please help to check or I need to enable new future in Dwolla?? Thank you!

Note: I did search in Lib “dwolla/dwollaswagger” But not found above message. I think this issue can did deny by Api Gateway Amazon service.

Just closing the loop on the thread; the issue was resolved in a spread thread with the following solution:

All of your requests to Finicity look good; however, when generating partner consent, it looks like thirdPartyPartnerId is currently set to 2445583094600. This value should instead be Dwolla’s Finicity partner ID, which can be found on this line . In other words, can you attempt to recreate the partner consent using Dwolla’s ID, similar to the following snippet?

{
    "customerId": "6017528936",
    "partnerId": "{{partnerId}}",
    "thirdPartyPartnerId": "2445583946651",
    "products": [
        {
            "product": "moneyTransferDetails",
            "payorId": "{{partnerId}}",
            "accountId": "6030196351",
            "maxCalls": "10",
            "accessPeriod": {
                "type": "timeframe",
                "startTime": "2023-01-01T00:00:00Z",
                "endTime": "2023-01-31T23:59:59Z"
            }
        }
    ]
}