> 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.

# Update user status

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

This endpoint updates the status of a user by posting feedback data to Trustly for an authorized Identity transaction. This communicates to Trustly that the user associated with the transaction has been successfully registered in the merchant system, or that the user record has been voided and therefore will not be eligible for future payment transactions. 

To confirm a user was registered, set properties `status` to `4`, `subStatus` to `559` and `description` to `Registered`. To void a user who did not complete registration after completing the Trustly ID flow, set `status` to `13`, `subStatus` to `558` and `description` to `Known bad user`. 

See the [Trustly ID tutorial](doc:trustly-id) for more details.

Reference: https://trustly.ferndocs.com/api-reference/api/identity/post-transaction-feedback

## Authentication

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

## Request

### Path parameters

- `transactionId` (string, required) — Transaction ID retrieved from a Trustly Authorization transaction.

### Body (application/json)

This endpoint expects an object.

- `status` (integer, optional, default: 4)
- `subStatus` (integer, optional, default: 559)
- `description` (string, optional, default: Registered)

## Response

### 200

OK

- `required` (any, optional)
- `transactionId` (string, optional) — A unique transaction identifier generated by Trustly (15 character max).
- `transactionType` (enum, optional) — Type of transaction record. Definitions and descriptions can be found in [this table](https://amer.developers.trustly.com/payments/docs/type-definitions#transaction-types)
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `10`
- `payment` (Payment, optional) — A Trustly Payment
- `currency` (enum, optional) — 3-letter ISO Currency Code. Currently only USD is supported.
  - Allowed values: `USD`
- `amount` (string, optional) — The amount of the transaction. (10 characters with support for 2 decimal places)
- `pending` (string, optional) — The total amount that is still pending completion. (10 characters with support for 2 decimal places)
- `paid` (string, optional) — The total amount that was already paid. (10 characters with support for 2 decimal places)
- `refunded` (string, optional) — The total amount that was refunded. (10 characters with support for 2 decimal places)
- `reversed` (string, optional) — The total amount that was reversed. (10 characters with support for 2 decimal places)
- `balance` (string, optional) — The balance of the amount paid, minus the amount reversed and/or refunded. (10 characters with support for 2 decimal places)
- `paymentProviderTransaction` (PaymentProviderTransaction, optional) — Payment Provider Transaction
- `status` (enum, optional) — Status code of the Payment Provider Transaction record. Definitions and descriptions can be found in [this table](https://amer.developers.trustly.com/payments/docs/type-definitions#transaction-status-values)
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `10`, `11`, `12`, `13`, `14`
- `statusMessage` (string, optional) — A descriptive status message. (120 characters)
- `ip` (string, optional) — The client IP address in IPv4 or IPv6 format.
- `createdAt` (integer, optional) — The date and time the transaction was created as a UNIX timestamp.
- `processedAt` (integer, optional) — The date and time the transaction was processed as a UNIX timestamp.
- `completedAt` (integer, optional) — The date and time the transaction was completed as a UNIX timestamp.
- `updatedAt` (integer, optional) — The date and time the transaction was last updated as a UNIX timestamp.
- `ppTrxId` (string, optional) — internal use only
- `merchantReference` (string, optional) — Merchants internal reference id for the transaction.
- `expiredAt` (integer, optional) — The date and time the preauthorization will expire as a UNIX timestamp.
- `recordVersion` (double, optional) — The current record version.
- `originalTransactionId` (string, optional)
- `fee` (string, optional)
- `timeZone` (string, optional)
- `representmentScheduledAt` (double, optional)
- `paymentProcessorType` (string, optional)
- `statusCode` (string, optional)
- `preAuthorized` (boolean, optional)

## Errors

### 401 Unauthorized Error

Access not authorized

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

## Types

### Payment

A Trustly Payment

- `required` (any, optional)
- `paymentId` (string, optional) — A unique payment identifier generated by Trustly (15 character max).
- `paymentType` (enum, optional) — Financial Institution Account Type: * `1`: Instant - Instant payment. The debit instruction is automatically initiated with that day's batch after consumer authorization. * `2`: Deferred - Deferred payment. Payment is authorized but the capture operation must be called to initiate the debit. You can start to initiate multiple captures that are less than or equal to the original transaction authorization amount. * `3`: Recurring - Recurring payment. Same as deferred but associated to a payment agreement between consumer and merchant that defines how much and when the capture can be started. * `4`: Disbursement - Disbursement payment. This payment type can only be used for disbursements. * `5`: Verification - This payment type is used to verify the customer financial institution account as the payments will be done outside of the Trustly system. * `6`: Retrieval Data retrieval. This payment type is used to retrieve account and user information from Trustly without an associated payment request. This payment type is not enabled by default. Contact Trustly if you need this feature.
  - Allowed values: `1`, `2`, `3`, `4`, `5`, `6`
- `merchant` (PaymentMerchant, optional)
- `merchantReference` (string, optional) — An external reference from the merchant. Ex: Order identifier from merchant e-commerce application.
- `merchantId` (string, optional) — Your Trustly Merchant Id. It will be provided to you.
- `fingerprint` (string, optional) — Internal use only
- `verification` (Verification, optional)
- `account` (Account, optional)
- `description` (string, optional) — A summary description of the order.
- `returnUrl` (string, optional) — Return URL provided with the bank authorization.
- `cancelUrl` (string, optional) — Cancel URL provided with the bank authorization.
- `currency` (enum, optional) — 3-letter ISO Currency Code. Currently only USD is supported.
  - Allowed values: `USD`
- `amount` (string, optional) — The total amount of the order, including tax and shipping. If transactionType is Recurring, this is the Setup Fee Amount.
- `paymentProvider` (PaymentProvider, optional) — Details of the Financial institution
- `allowedPaymentProviderType` (list of integer, optional)
- `auth` (PaymentAuth, optional)
- `authorization` (string, optional) — Authorization token.
- `authorizationStatus` (double, optional) — Status of the related bank authorization. See Transaction Status Values.
- `authorizationStatusMessage` (string, optional) — Status message of the related bank authorization.
- `pending` (string, optional) — The total amount that is still pending completion. (10 characters with support for 2 decimal places)
- `paid` (string, optional) — The total amount that was already paid. (10 characters with support for 2 decimal places)
- `refunded` (string, optional) — The total amount that was refunded. (10 characters with support for 2 decimal places)
- `reversed` (string, optional) — The total amount that was reversed. (10 characters with support for 2 decimal places)
- `balance` (string, optional) — The balance of the amount paid, minus the amount reversed and/or refunded. (10 characters with support for 2 decimal places)
- `createdAt` (integer, optional) — The date and time the transaction was created as a UNIX timestamp.
- `updatedAt` (integer, optional) — The date and time the transaction was last updated as a UNIX timestamp.
- `recordVersion` (double, optional) — The current record version.
- `paymentFlow` (double, optional) — internal use only
- `customer` (Customer, optional) — The Trustly customer object, containing identification details and contact information.
- `address` (Address, optional) — Valid mailing or billing address associated with the customer
- `recurrence` (Recurrence, optional) — Recurring payment options
- `system` (enum, optional) — Financial Institution Account Type: * `-1`: None * `1`: PayWithMyBank * `2`: TrustlyAB
  - Allowed values: `-1`, `1`, `2`
- `country` (enum, optional) — 2-character ISO code of the country for the bank account that was selected. Currently only the US, CA, UK, DE, and AU are supported.
  - Allowed values: `US`, `CA`, `UK`, `DE`, `AU`
- `paymentProviderSubtype` (enum, optional) — Payment Provider Subtype: * `1000`: EasyOnline * `2000`: MEC * `2001`: MCD
  - Allowed values: `1000`, `2000`, `2001`

### PaymentProviderTransaction

Payment Provider Transaction

- `paymentProviderTransactionId` (string, optional) — Unique payment provider transaction identifier.
- `status` (string, optional) — See Payment Provider Transaction Status Codes.
- `statusMessage` (string, optional) — Payment provider transaction status message.
- `signature` (string, optional)
- `statusDescription` (string, optional)
- `paymentProcessor` (PaymentProviderTransactionPaymentProcessor, optional)
- `thirdPartyDeclineCode` (string, optional)
- `clearingHouse` (string, optional)
- `instantSettle` (boolean, optional) — Whether instant settlement was used for transaction.

### PaymentMerchant

- `merchantId` (string, optional) — Unique Trustly Merchant ID.
- `name` (string, optional) — Merchants name.

### Verification

- `status` (enum, optional) — Verification Status: * `1`: Automatic - Payment verification followed Trustly internal rules. * `2`: ToVerify - Payment transaction is held (status = OnHold) for further investigation and approval by the merchant. * `3`: Verified - Payment was verified and approved by the merchant or Trustly (see Verification Mode). * `4`: Refused - Payment was denied by the merchant or Trustly after verification.
  - Allowed values: `1`, `2`, `3`, `4`
- `mode` (enum, optional) — Verification Mode: * `1`: VerifiedByMerchant * `2`: ApprovedByMerchant * `3`: VerifiedByTrustly * `4`: AmountAuthorizedByMerchant
  - Allowed values: `1`, `2`, `3`, `4`
- `verifyCustomer` (boolean, optional) — If true, the Customer information (name and zip code) was verified against information provided by the User's bank.

### Account

- `providerId` (string, optional) — Payment provider ID.
- `paymentProvider` (PaymentProvider, optional) — Details of the Financial institution
- `country` (enum, optional) — 2-character ISO code of the country for the bank account that was selected. Currently only the US, CA, UK, DE, and AU are supported.
  - Allowed values: `US`, `CA`, `UK`, `DE`, `AU`
- `name` (string, optional) — A description to identify a specific account (e.g. Test checking account)
- `type` (double, optional) — See Financial Institution Account Type Values.
- `profile` (double, optional) — See Financial Institution Account Profile Values
- `accountNumber` (string, optional) — Bank Account Number or VAN if `virtualAccountRoutingPair` is equal to `true`.
- `iban` (string, optional) — IBAN (International Bank Account Number) is an internationally agreed system of identifying bank accounts across national borders
- `verified` (boolean, optional) — Indicates if the account is verified or not.
- `verification` (FinancialInstitutionAccountVerification, optional)
- `source` (double, optional)
- `routingNumber` (string, optional) — Bank Routing Number
- `token` (string, optional) — The Account Token
- `accountNumberLastFour` (string, optional) — The last 4 digits of the real account number.
- `virtualAccountRoutingPair` (boolean, optional) — Indicates if account is using virtual/tokenized account and routing numbers (VANs/TANs) or not.

### PaymentProvider

Details of the Financial institution

- `name` (string, required) — Name of the payment provider
- `paymentProviderId` (string, optional) — A unique identifier for the Payment Provider.
- `type` (double, optional)
- `instantPayoutAvailable` (boolean, optional) — Whether payment provider supports instant payout.
- `subType` (enum, optional) — Financial Institution Account Type: * `1000`: Online Banking * `2000`: Manual Entry * `2001`: Manual Entry with Challenge Deposit
  - Allowed values: `1000`, `2000`, `2001`
- `swift` (string, optional)
- `address` (Address, optional) — Valid mailing or billing address associated with the customer
- `country` (enum, optional) — 2-letter ISO country code of the financial institution
  - Allowed values: `US`, `CA`, `UK`, `DE`, `AU`
- `instantPayment` (boolean, optional)

### PaymentAuth

- `token` (string, optional) — Authorization token.
- `status` (integer, optional) — See Authorization Status Values.
- `message` (string, optional) — Authorization message.

### Customer

The Trustly customer object, containing identification details and contact information.

- `name` (string, required) — Full name of the Customer
- `address` (Address, required) — Valid mailing or billing address associated with the customer
- `phone` (string, required) — Customer phone number.
- `email` (string, required) — Customer email address.
- `taxId` (string, optional) — Customer tax ID (e.g. SSN [US], SIN [CA]). *May be required depending on industry and location.*
- `dateOfBirth` (string, optional) — Customer date of birth.
- `createdAt` (integer, optional) — The record created date and time as a UNIX timestamp.
- `updatedAt` (integer, optional) — The record created date and time as a UNIX timestamp.
- `customerId` (string, optional) — A unique Trustly customer identifier.
- `externalId` (string, optional) — A unique merchant customer identifier.
- `merchantId` (string, optional) — A unique Trustly merchant identifier.
- `enrollDate` (integer, optional) — Date of the user's first transaction in your system, regardless of payment method used as a UNIX timestamp.
- `vip` (string, optional) — Range that determines how low-risk the customer represents to the merchant
- `currency` (string, optional) — Customer currency.
- `balance` (string, optional) — Customer account balance (not associated with a financial institution account).
- `organizationNumber` (string, optional) — Organization number for business accounts
- `externalTier` (string, optional) — It should describe the customer''s rank to the merchant (e.g. Gold, Diamond, 4 stars, etc.)
- `personId` (string, optional) — Unique customer identity throughout different banks.
- `customData` (CustomerCustomData, optional) — Object for sending merchant-specific custom data.
- `driverLicense` (DriverLicense, optional)
- `nationalId` (string, optional) — Customer National ID

### Address

Valid mailing or billing address associated with the customer

- `country` (string, required) — 2 character [ISO Country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
- `address1` (string, optional) — Address line 1 (e.g., street or PO Box)
- `address2` (string, optional) — Address line 2 (e.g., apartment, suite or unit number)
- `city` (string, optional) — City, district, town or village
- `state` (string, optional) — State, province or region code
- `zip` (string, optional) — ZIP or Postal Code

### Recurrence

Recurring payment options

- `startDate` (datetime, optional) — Recurring payment start date as a UNIX timestamp.
- `endDate` (datetime, optional) — Recurring payment end date as a UNIX timestamp.
- `nextOccurrence` (datetime, optional) — When the next capture will be issued if using automatic captures as a UNIX timestamp.
- `recurringAmount` (string, optional) — Recurring payment amount. (maximum of 10 characters with support for 2 decimal places)
- `debtSettlement` (string, optional) — Any debt amount settlement done outside of the Trustly like discounts or when consumers pays one recurring debt using another payment method like traditional checks or credit cards. (maximum of 10 characters with support for 2 decimal places)
- `frequency` (integer, optional, default: 1) — How many payments per frequencyUnit. Defaults to 1. Example: To define 2 recurring payments every 3 months set: frequency=2, frequencyUnit=3 and frequencyUnitType=3.
- `frequencyUnit` (double, optional) — Defines with frequencyUnitType the interval of the frequency of payments.
- `frequencyUnitType` (enum, optional) — Frequency Unit Type
  - Allowed values: `Day`, `Week`, `Month`, `Year`
- `automaticCapture` (boolean, optional) — If true, payment captures are issued automatically.
- `recurrenceId` (string, optional)

### PaymentProviderTransactionPaymentProcessor

- `paymentProcessorId` (string, optional)
- `type` (integer, optional)
- `name` (string, optional)
- `shortName` (string, optional)
- `url` (string, optional)
- `active` (string, optional)

### FinancialInstitutionAccountVerification

- `verified` (boolean, required) — true if the account is verified; false otherwise.
- `type` (enum, required) — Verification Type: * `1`: Manual - The account was verified with manual account verification. For example, Manual Electronic Check and Micro Challenge Deposit. * `2`: Online Banking verification - The Account was verified using the Trustly Online Banking application. * `3`: Database verification - The Account was verified using the Trustly database or a Third-Party Service.
  - Allowed values: `1`, `2`, `3`
- `hasEnoughFunds` (boolean, required) — If true, there is enough balance in account.
- `verificationDate` (integer, required) — The date and time the verification was completed as a UNIX timestamp.
- `score` (enum, optional) — Verification Score: * `0`: Invalid input. The account or routing number are invalid. (Verified Mapping = false) * `1`: There is a strong indication that the account is invalid. (Verified Mapping = false) * `2`: There are active non-bankable returns on this account that are less than 3 years old. (Verified Mapping = false) * `3`: There are administrative returns on this account. (Verified Mapping = false) * `4`: The format appears to be suspicious. (Verified Mapping = false) * `5`: There is no data on this account or format. (Verified Mapping = false) * `6`: We have not seen this account, but the format appears to be valid. (Verified Mapping = true) * `7`: We have seen this account but have not received a final disposition on the transaction. (Verified Mapping = true) * `8`: We have seen this account, but not in the last 6 months, and have seen no returns associated with the account. (Verified Mapping = true) * `9`: We have seen this account in the last 6 months and have seen no returns associated with the account. (Verified Mapping = true) * `10`: This account has been directly validated with/by the financial institution or 3rd party. We have the highest confidence that this account is valid. (Verified Mapping = true)
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`
- `thirdPartyScore` (enum, optional) — Verification Third-Party Score: * `0`: Failed RT validation. (Verified Mapping = 0) * `100`: The supplier has a strong indication that this account is invalid. (Verified Mapping = 1) * `200`: The supplier has active non-bankable debt(s) on this account that are less than 3 years old. (Verified Mapping = 2) * `300`: The supplier has administrative returns on this account. (Verified Mapping = 3) * `400`: The supplier does not have Neg data on this account, but the format appears to be suspicious. (Verified Mapping = 4) * `500`: The supplier does not have data on this account or format. (Verified Mapping = 5) * `600`: The supplier has not seen this account, but the format appears valid. (Verified Mapping = 6) * `700`: The supplier has seen this account, but did not receive a final disposition on the transaction. (Verified Mapping = 7) * `800`: The supplier has seen this account, but not in the last 6 months. (Verified Mapping = 8) * `900`: The supplier has seen this account in the last 6 months. (Verified Mapping = 9) * `999`: The supplier has the highest confidence that this account is valid. (Verified Mapping = 10)
  - Allowed values: `0`, `100`, `200`, `300`, `400`, `500`, `600`, `700`, `800`, `900`, `999`
- `numberOfTries` (double, optional) — Number of tries allowed.
- `numberOfAttemptsLeft` (double, optional) — Number of remaining attempts.

### CustomerCustomData

Object for sending merchant-specific custom data.

### DriverLicense

- `number` (string, required) — Driver License number.
- `state` (string, required) — 2 character ISO State code.

## Examples

### Voided

**Request**

```json
{
  "status": 13,
  "subStatus": 558,
  "description": "Known bad user"
}
```

**Response**

```json
{
  "required": null,
  "transactionId": "string",
  "transactionType": 0,
  "payment": {
    "required": null,
    "paymentId": "string",
    "paymentType": 1,
    "merchant": {
      "merchantId": "string",
      "name": "string"
    },
    "merchantReference": "string",
    "merchantId": "string",
    "fingerprint": "string",
    "verification": {
      "status": 1,
      "mode": 1,
      "verifyCustomer": true
    },
    "account": {
      "providerId": "string",
      "paymentProvider": {
        "name": "string",
        "paymentProviderId": "string",
        "type": 1.1,
        "instantPayoutAvailable": true,
        "subType": 1000,
        "swift": "string",
        "address": {
          "country": "string",
          "address1": "string",
          "address2": "string",
          "city": "string",
          "state": "string",
          "zip": "string"
        },
        "country": "US",
        "instantPayment": true
      },
      "country": "US",
      "name": "string",
      "type": 1.1,
      "profile": 1.1,
      "accountNumber": "string",
      "iban": "string",
      "verified": true,
      "verification": {
        "verified": true,
        "type": 1,
        "hasEnoughFunds": true,
        "verificationDate": 1,
        "score": 0,
        "thirdPartyScore": 0,
        "numberOfTries": 1.1,
        "numberOfAttemptsLeft": 1.1
      },
      "source": 1.1,
      "routingNumber": "string",
      "token": "string",
      "accountNumberLastFour": "string",
      "virtualAccountRoutingPair": true
    },
    "description": "string",
    "returnUrl": "string",
    "cancelUrl": "string",
    "currency": "USD",
    "amount": "string",
    "paymentProvider": {
      "name": "string",
      "paymentProviderId": "string",
      "type": 1.1,
      "instantPayoutAvailable": true,
      "subType": 1000,
      "swift": "string",
      "address": {
        "country": "string",
        "address1": "string",
        "address2": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      },
      "country": "US",
      "instantPayment": true
    },
    "allowedPaymentProviderType": [
      1
    ],
    "auth": {
      "token": "string",
      "status": 1,
      "message": "string"
    },
    "authorization": "string",
    "authorizationStatus": 1.1,
    "authorizationStatusMessage": "string",
    "pending": "string",
    "paid": "string",
    "refunded": "string",
    "reversed": "string",
    "balance": "string",
    "createdAt": 1,
    "updatedAt": 1,
    "recordVersion": 1.1,
    "paymentFlow": 1.1,
    "customer": {
      "name": "string",
      "address": {
        "country": "string",
        "address1": "string",
        "address2": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      },
      "phone": "string",
      "email": "string",
      "taxId": "string",
      "dateOfBirth": "string",
      "createdAt": 1,
      "updatedAt": 1,
      "customerId": "string",
      "externalId": "string",
      "merchantId": "string",
      "enrollDate": 1,
      "vip": "string",
      "currency": "string",
      "balance": "string",
      "organizationNumber": "string",
      "externalTier": "string",
      "personId": "string",
      "customData": {},
      "driverLicense": {
        "number": "string",
        "state": "string"
      },
      "nationalId": "string"
    },
    "address": {
      "country": "string",
      "address1": "string",
      "address2": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "recurrence": {
      "startDate": "2024-01-15T09:30:00Z",
      "endDate": "2024-01-15T09:30:00Z",
      "nextOccurrence": "2024-01-15T09:30:00Z",
      "recurringAmount": "string",
      "debtSettlement": "string",
      "frequency": 1,
      "frequencyUnit": 1.1,
      "frequencyUnitType": "Day",
      "automaticCapture": true,
      "recurrenceId": "string"
    },
    "system": -1,
    "country": "US",
    "paymentProviderSubtype": 1000
  },
  "currency": "USD",
  "amount": "string",
  "pending": "string",
  "paid": "string",
  "refunded": "string",
  "reversed": "string",
  "balance": "string",
  "paymentProviderTransaction": {
    "paymentProviderTransactionId": "string",
    "status": "string",
    "statusMessage": "string",
    "signature": "string",
    "statusDescription": "string",
    "paymentProcessor": {
      "paymentProcessorId": "string",
      "type": 1,
      "name": "string",
      "shortName": "string",
      "url": "string",
      "active": "string"
    },
    "thirdPartyDeclineCode": "string",
    "clearingHouse": "string",
    "instantSettle": true
  },
  "status": 0,
  "statusMessage": "string",
  "ip": "string",
  "createdAt": 1,
  "processedAt": 1,
  "completedAt": 1,
  "updatedAt": 1,
  "ppTrxId": "string",
  "merchantReference": "string",
  "expiredAt": 1,
  "recordVersion": 1.1,
  "originalTransactionId": "string",
  "fee": "string",
  "timeZone": "string",
  "representmentScheduledAt": 1.1,
  "paymentProcessorType": "string",
  "statusCode": "string",
  "preAuthorized": true
}
```

**SDK Code**

```python Voided
import requests

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

payload = {
    "status": 13,
    "subStatus": 558,
    "description": "Known bad user"
}
headers = {
    "Content-Type": "application/json"
}

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

print(response.json())
```

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

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"status":13,"subStatus":558,"description":"Known bad user"}'
};

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

```go Voided
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"status\": 13,\n  \"subStatus\": 558,\n  \"description\": \"Known bad user\"\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 Voided
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/transactions/transactionId/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  \"status\": 13,\n  \"subStatus\": 558,\n  \"description\": \"Known bad user\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/transactions/transactionId/feedback")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": 13,\n  \"subStatus\": 558,\n  \"description\": \"Known bad user\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/transactions/transactionId/feedback', [
  'body' => '{
  "status": 13,
  "subStatus": 558,
  "description": "Known bad user"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

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

```csharp Voided
using RestSharp;
using RestSharp.Authenticators;

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

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": 13,\n  \"subStatus\": 558,\n  \"description\": \"Known bad user\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Voided
import Foundation

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

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "status": 13,
  "subStatus": 558,
  "description": "Known bad user"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/transactions/transactionId/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()
```

### Example 2

**Request**

```json
{
  "status": 4,
  "subStatus": 559,
  "description": "Registered"
}
```

**Response**

```json
{
  "required": null,
  "transactionId": "string",
  "transactionType": 0,
  "payment": {
    "required": null,
    "paymentId": "string",
    "paymentType": 1,
    "merchant": {
      "merchantId": "string",
      "name": "string"
    },
    "merchantReference": "string",
    "merchantId": "string",
    "fingerprint": "string",
    "verification": {
      "status": 1,
      "mode": 1,
      "verifyCustomer": true
    },
    "account": {
      "providerId": "string",
      "paymentProvider": {
        "name": "string",
        "paymentProviderId": "string",
        "type": 1.1,
        "instantPayoutAvailable": true,
        "subType": 1000,
        "swift": "string",
        "address": {
          "country": "string",
          "address1": "string",
          "address2": "string",
          "city": "string",
          "state": "string",
          "zip": "string"
        },
        "country": "US",
        "instantPayment": true
      },
      "country": "US",
      "name": "string",
      "type": 1.1,
      "profile": 1.1,
      "accountNumber": "string",
      "iban": "string",
      "verified": true,
      "verification": {
        "verified": true,
        "type": 1,
        "hasEnoughFunds": true,
        "verificationDate": 1,
        "score": 0,
        "thirdPartyScore": 0,
        "numberOfTries": 1.1,
        "numberOfAttemptsLeft": 1.1
      },
      "source": 1.1,
      "routingNumber": "string",
      "token": "string",
      "accountNumberLastFour": "string",
      "virtualAccountRoutingPair": true
    },
    "description": "string",
    "returnUrl": "string",
    "cancelUrl": "string",
    "currency": "USD",
    "amount": "string",
    "paymentProvider": {
      "name": "string",
      "paymentProviderId": "string",
      "type": 1.1,
      "instantPayoutAvailable": true,
      "subType": 1000,
      "swift": "string",
      "address": {
        "country": "string",
        "address1": "string",
        "address2": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      },
      "country": "US",
      "instantPayment": true
    },
    "allowedPaymentProviderType": [
      1
    ],
    "auth": {
      "token": "string",
      "status": 1,
      "message": "string"
    },
    "authorization": "string",
    "authorizationStatus": 1.1,
    "authorizationStatusMessage": "string",
    "pending": "string",
    "paid": "string",
    "refunded": "string",
    "reversed": "string",
    "balance": "string",
    "createdAt": 1,
    "updatedAt": 1,
    "recordVersion": 1.1,
    "paymentFlow": 1.1,
    "customer": {
      "name": "string",
      "address": {
        "country": "string",
        "address1": "string",
        "address2": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      },
      "phone": "string",
      "email": "string",
      "taxId": "string",
      "dateOfBirth": "string",
      "createdAt": 1,
      "updatedAt": 1,
      "customerId": "string",
      "externalId": "string",
      "merchantId": "string",
      "enrollDate": 1,
      "vip": "string",
      "currency": "string",
      "balance": "string",
      "organizationNumber": "string",
      "externalTier": "string",
      "personId": "string",
      "customData": {},
      "driverLicense": {
        "number": "string",
        "state": "string"
      },
      "nationalId": "string"
    },
    "address": {
      "country": "string",
      "address1": "string",
      "address2": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "recurrence": {
      "startDate": "2024-01-15T09:30:00Z",
      "endDate": "2024-01-15T09:30:00Z",
      "nextOccurrence": "2024-01-15T09:30:00Z",
      "recurringAmount": "string",
      "debtSettlement": "string",
      "frequency": 1,
      "frequencyUnit": 1.1,
      "frequencyUnitType": "Day",
      "automaticCapture": true,
      "recurrenceId": "string"
    },
    "system": -1,
    "country": "US",
    "paymentProviderSubtype": 1000
  },
  "currency": "USD",
  "amount": "string",
  "pending": "string",
  "paid": "string",
  "refunded": "string",
  "reversed": "string",
  "balance": "string",
  "paymentProviderTransaction": {
    "paymentProviderTransactionId": "string",
    "status": "string",
    "statusMessage": "string",
    "signature": "string",
    "statusDescription": "string",
    "paymentProcessor": {
      "paymentProcessorId": "string",
      "type": 1,
      "name": "string",
      "shortName": "string",
      "url": "string",
      "active": "string"
    },
    "thirdPartyDeclineCode": "string",
    "clearingHouse": "string",
    "instantSettle": true
  },
  "status": 0,
  "statusMessage": "string",
  "ip": "string",
  "createdAt": 1,
  "processedAt": 1,
  "completedAt": 1,
  "updatedAt": 1,
  "ppTrxId": "string",
  "merchantReference": "string",
  "expiredAt": 1,
  "recordVersion": 1.1,
  "originalTransactionId": "string",
  "fee": "string",
  "timeZone": "string",
  "representmentScheduledAt": 1.1,
  "paymentProcessorType": "string",
  "statusCode": "string",
  "preAuthorized": true
}
```

**SDK Code**

```python
import requests

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

payload = {
    "status": 4,
    "subStatus": 559,
    "description": "Registered"
}
headers = {
    "Content-Type": "application/json"
}

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

print(response.json())
```

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

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"status":4,"subStatus":559,"description":"Registered"}'
};

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

```go
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"status\": 4,\n  \"subStatus\": 559,\n  \"description\": \"Registered\"\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
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/transactions/transactionId/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  \"status\": 4,\n  \"subStatus\": 559,\n  \"description\": \"Registered\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://sandbox.trustly.one/api/v1/transactions/transactionId/feedback")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": 4,\n  \"subStatus\": 559,\n  \"description\": \"Registered\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.trustly.one/api/v1/transactions/transactionId/feedback', [
  'body' => '{
  "status": 4,
  "subStatus": 559,
  "description": "Registered"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

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

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

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

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": 4,\n  \"subStatus\": 559,\n  \"description\": \"Registered\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "status": 4,
  "subStatus": 559,
  "description": "Registered"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/transactions/transactionId/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()
```