> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://amer.developers.trustly.com/llms.txt.
> For full documentation content, see https://amer.developers.trustly.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://amer.developers.trustly.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://amer.developers.trustly.com/api-reference/api/accounts/post-account-feedback

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Trustly API
  version: 1.0.0
paths:
  /feedback:
    post:
      operationId: post-account-feedback
      summary: Post Account Feedback
      description: >-
        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.
      tags:
        - subpackage_accounts
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Accounts_post-account-feedback_Response_200
        '400':
          description: Invalid parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseException'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseException'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantId:
                  type: number
                  format: double
                  description: A unique Trustly merchant identifier.
                account:
                  $ref: >-
                    #/components/schemas/FeedbackPostRequestBodyContentApplicationJsonSchemaAccount
                  description: >-
                    The token is required only when account number and routing
                    number are not sent and vice-versa.
                feedback:
                  $ref: '#/components/schemas/Feedback'
              required:
                - merchantId
                - account
                - feedback
servers:
  - url: https://sandbox.trustly.one/api/v1
components:
  schemas:
    FeedbackPostRequestBodyContentApplicationJsonSchemaAccount:
      type: object
      properties:
        accountNumber:
          type: string
        routingNumber:
          type: string
        token:
          type: string
          description: The token received as return of the Tokenize API.
      description: >-
        The token is required only when account number and routing number are
        not sent and vice-versa.
      title: FeedbackPostRequestBodyContentApplicationJsonSchemaAccount
    FeedbackStatus:
      type: string
      enum:
        - '2'
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '9'
        - '10'
        - '13'
      description: |-
        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
      title: FeedbackStatus
    FeedbackCurrency:
      type: string
      enum:
        - USD
      description: 3-letter ISO Currency Code. Currently only USD is supported.
      title: FeedbackCurrency
    Feedback:
      type: object
      properties:
        externalId:
          type: string
          description: The merchant reference of the payment.
        status:
          $ref: '#/components/schemas/FeedbackStatus'
          description: |-
            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
        subStatus:
          type: string
          description: |-
            The ACH return code. Example:
            * `R01`: Insufficient Fund
            * `R04`: Invalid Account Number
            * `R16`: Account Frozen
        description:
          type: string
          description: Unrestricted field to inform any description about the payment.
        submissionDate:
          type: number
          format: double
          description: >-
            The Unix Timestamp (epoch) in ms of when the payment was sent to
            ACH.
        returnDate:
          type: number
          format: double
          description: The Unix Timestamp (epoch) in ms of when ACH provided a return.
        amount:
          type: string
          description: >-
            The amount of the payment. (10 characters with support for 2 decimal
            places)
        currency:
          $ref: '#/components/schemas/FeedbackCurrency'
          description: 3-letter ISO Currency Code. Currently only USD is supported.
      required:
        - status
        - subStatus
      description: The resulting feedback of an ACH transaction
      title: Feedback
    Accounts_post-account-feedback_Response_200:
      type: object
      properties:
        message:
          type: string
          description: Successful message.
      title: Accounts_post-account-feedback_Response_200
    BaseException:
      type: object
      properties:
        domain:
          type: string
        code:
          type: integer
        location":
          type: string
        message":
          type: string
        occurredAt":
          type: integer
      title: BaseException
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
      description: ''

```

## SDK Code Examples

```python Successful Example
import requests

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

headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, 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}`,
    'Content-Type': 'application/json'
  },
  body: undefined
};

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>")
	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 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>")
request["Content-Type"] = 'application/json'

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>")
  .header("Content-Type", "application/json")
  .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' => [
    'Content-Type' => 'application/json',
  ],
    '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);

request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Successful Example
import Foundation

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

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]

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()
```

```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()
```