> This page is for North America.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://trustly.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://trustly.ferndocs.com/_mcp/server.

# Post Account Feedback

POST https://sandbox.trustly.one/api/v1/feedback
Content-Type: application/json

Utilize this endpoint to record feedback regarding the result of an ACH payment using the account information verified by Trustly during a Verification Transaction. This feedback data helps optimize account verification scores over time. It is **required** when using Trustly Connect.

> **Note for Trustly Pay**
> For apps using Trustly Pay, feedback should be provided on individual transactions rather than on the account. See [`/transactions/{id}/feedback`](ref:post-transaction-feedback) for transaction-specific feedback details.

Reference: https://trustly.ferndocs.com/api-reference/api/accounts/post-account-feedback

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Body (application/json)

This endpoint expects an object.

- `merchantId` (double, required) — A unique Trustly merchant identifier.
- `account` (FeedbackPostRequestBodyContentApplicationJsonSchemaAccount, required) — The token is required only when account number and routing number are not sent and vice-versa.
- `feedback` (Feedback, required) — The resulting feedback of an ACH transaction

## Response

### 200

OK

- `message` (string, optional) — Successful message.

## Errors

### 400 Bad Request Error

Invalid parameter

- `domain` (string, optional)
- `code` (integer, optional)
- `location"` (string, optional)
- `message"` (string, optional)
- `occurredAt"` (integer, optional)

### 500 Internal Server Error

Internal Server Error

- `domain` (string, optional)
- `code` (integer, optional)
- `location"` (string, optional)
- `message"` (string, optional)
- `occurredAt"` (integer, optional)

## Types

### FeedbackPostRequestBodyContentApplicationJsonSchemaAccount

The token is required only when account number and routing number are not sent and vice-versa.

- `accountNumber` (string, optional)
- `routingNumber` (string, optional)
- `token` (string, optional) — The token received as return of the Tokenize API.

### Feedback

The resulting feedback of an ACH transaction

- `status` (enum, required) — The final status of the payment operation: * `2`: Authorized * `3`: Processed * `4`: Completed * `5`: Failed * `6`: Expired * `7`: Canceled * `9`: Disputed * `10`: Reversed * `13`: Voided
  - Allowed values: `2`, `3`, `4`, `5`, `6`, `7`, `9`, `10`, `13`
- `subStatus` (string, required) — The ACH return code. Example: * `R01`: Insufficient Fund * `R04`: Invalid Account Number * `R16`: Account Frozen
- `externalId` (string, optional) — The merchant reference of the payment.
- `description` (string, optional) — Unrestricted field to inform any description about the payment.
- `submissionDate` (double, optional) — The Unix Timestamp (epoch) in ms of when the payment was sent to ACH.
- `returnDate` (double, optional) — The Unix Timestamp (epoch) in ms of when ACH provided a return.
- `amount` (string, optional) — The amount of the payment. (10 characters with support for 2 decimal places)
- `currency` (enum, optional) — 3-letter ISO Currency Code. Currently only USD is supported.
  - Allowed values: `USD`

## Examples

### Successful Example

**Response**

```json
{
  "message": "Feedback received successfully."
}
```

**SDK Code**

```python Successful Example
import requests

url = "https://sandbox.trustly.one/api/v1/feedback"

response = requests.post(url, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Successful Example
const url = 'https://sandbox.trustly.one/api/v1/feedback';
const credentials = btoa("<username>:<password>");

const options = {method: 'POST', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Successful Example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/feedback"

	req, _ := http.NewRequest("POST", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Successful Example
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/feedback")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java Successful Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/feedback")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php Successful Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/feedback', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Successful Example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/feedback");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

IRestResponse response = client.Execute(request);
```

```swift Successful Example
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/feedback")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example

**Request**

```json
{
  "merchantId": 110005514,
  "account": {
    "accountNumber": "1000001800",
    "routingNumber": "124003116"
  },
  "feedback": {
    "status": 5,
    "subStatus": "R04",
    "externalId": "01912c39-fb07-7fde-b5cf-80479532075e",
    "description": "Invalid Account Number",
    "submissionDate": 1723023197206,
    "returnDate": 1723023197206,
    "amount": "0.0",
    "currency": "USD"
  }
}
```

**Response**

```json
{
  "message": "Feedback received successfully."
}
```

**SDK Code**

```python Example
import requests

url = "https://sandbox.trustly.one/api/v1/feedback"

payload = {
    "merchantId": 110005514,
    "account": {
        "accountNumber": "1000001800",
        "routingNumber": "124003116"
    },
    "feedback": {
        "status": 5,
        "subStatus": "R04",
        "externalId": "01912c39-fb07-7fde-b5cf-80479532075e",
        "description": "Invalid Account Number",
        "submissionDate": 1723023197206,
        "returnDate": 1723023197206,
        "amount": "0.0",
        "currency": "USD"
    }
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Example
const url = 'https://sandbox.trustly.one/api/v1/feedback';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"merchantId":110005514,"account":{"accountNumber":"1000001800","routingNumber":"124003116"},"feedback":{"status":5,"subStatus":"R04","externalId":"01912c39-fb07-7fde-b5cf-80479532075e","description":"Invalid Account Number","submissionDate":1723023197206,"returnDate":1723023197206,"amount":"0.0","currency":"USD"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/feedback"

	payload := strings.NewReader("{\n  \"merchantId\": 110005514,\n  \"account\": {\n    \"accountNumber\": \"1000001800\",\n    \"routingNumber\": \"124003116\"\n  },\n  \"feedback\": {\n    \"status\": 5,\n    \"subStatus\": \"R04\",\n    \"externalId\": \"01912c39-fb07-7fde-b5cf-80479532075e\",\n    \"description\": \"Invalid Account Number\",\n    \"submissionDate\": 1723023197206,\n    \"returnDate\": 1723023197206,\n    \"amount\": \"0.0\",\n    \"currency\": \"USD\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/feedback")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchantId\": 110005514,\n  \"account\": {\n    \"accountNumber\": \"1000001800\",\n    \"routingNumber\": \"124003116\"\n  },\n  \"feedback\": {\n    \"status\": 5,\n    \"subStatus\": \"R04\",\n    \"externalId\": \"01912c39-fb07-7fde-b5cf-80479532075e\",\n    \"description\": \"Invalid Account Number\",\n    \"submissionDate\": 1723023197206,\n    \"returnDate\": 1723023197206,\n    \"amount\": \"0.0\",\n    \"currency\": \"USD\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/feedback")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchantId\": 110005514,\n  \"account\": {\n    \"accountNumber\": \"1000001800\",\n    \"routingNumber\": \"124003116\"\n  },\n  \"feedback\": {\n    \"status\": 5,\n    \"subStatus\": \"R04\",\n    \"externalId\": \"01912c39-fb07-7fde-b5cf-80479532075e\",\n    \"description\": \"Invalid Account Number\",\n    \"submissionDate\": 1723023197206,\n    \"returnDate\": 1723023197206,\n    \"amount\": \"0.0\",\n    \"currency\": \"USD\"\n  }\n}")
  .asString();
```

```php Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/feedback', [
  'body' => '{
  "merchantId": 110005514,
  "account": {
    "accountNumber": "1000001800",
    "routingNumber": "124003116"
  },
  "feedback": {
    "status": 5,
    "subStatus": "R04",
    "externalId": "01912c39-fb07-7fde-b5cf-80479532075e",
    "description": "Invalid Account Number",
    "submissionDate": 1723023197206,
    "returnDate": 1723023197206,
    "amount": "0.0",
    "currency": "USD"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/feedback");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchantId\": 110005514,\n  \"account\": {\n    \"accountNumber\": \"1000001800\",\n    \"routingNumber\": \"124003116\"\n  },\n  \"feedback\": {\n    \"status\": 5,\n    \"subStatus\": \"R04\",\n    \"externalId\": \"01912c39-fb07-7fde-b5cf-80479532075e\",\n    \"description\": \"Invalid Account Number\",\n    \"submissionDate\": 1723023197206,\n    \"returnDate\": 1723023197206,\n    \"amount\": \"0.0\",\n    \"currency\": \"USD\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "merchantId": 110005514,
  "account": [
    "accountNumber": "1000001800",
    "routingNumber": "124003116"
  ],
  "feedback": [
    "status": 5,
    "subStatus": "R04",
    "externalId": "01912c39-fb07-7fde-b5cf-80479532075e",
    "description": "Invalid Account Number",
    "submissionDate": 1723023197206,
    "returnDate": 1723023197206,
    "amount": "0.0",
    "currency": "USD"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/feedback")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```