# Transaction flow with bank transfer payment

The following steps show a full transaction from start to finish with a bank transfer payment.

Before you begin this guide, follow our [setup guide](/docs/intro/auth).

### Create a sellers and buyers

Follow our [users](/docs/guides/transactions/users) guide to create user objects for both seller and buyer.

### Get Trustap Fee (Charge)

Before creating a transaction, retrieve the charge for the transaction. This returns the cost for using the Trustap service for this transaction.

`price` is an integer, in which the last 2 digits are the decimal part of the price. For example, `price:1050` `currency:eur` = €10.50.

Get Trustap fee
```CURL
curl -i -X GET \
  -u '<API_KEY>:' \
  'https://api.test.trustap.com/v2/fees?amount=20000&currency=usd&payment_method=bank_transfer'
```

Response
```json
{
	"buyer": 1050,
	"config": 1,
	"seller": 0
}
```

### Create a transaction with a seller and buyer

In the Trustap API, the transaction object includes details about the the buyer and seller, the type of transaction, and the status of the transaction.

Create a transaction
```CURL
curl -i -X POST \
  -u 'API_KEY' \
  https://api.test.trustap.com/v2/transactions \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": 20000,
    "amount_extra": 0,
    "buyer_id": "1-be75312f-ef39-4f06-b4c7-d903e96800c3",
    "currency": "usd",
    "description": "Trustap socks",
    "fees_buyer": 1050,
    "fees_config": 1,
    "fees_seller": 0,
    "image_url": "https://docs.trustap.com/images/trustap-socks.png",
    "payment_method": "bank_transfer",
    "role": "seller",
    "seller_id": "1-718bce10-23e8-43ba-a279-7e301d78273a"
  }'
```

Response
```json
{
	"buyer": {
		"id": "1-be75312f-ef39-4f06-b4c7-d903e96800c3",
		"is_guest": true
	},
	"client_id": "5a3d7990-9f1c-4e11-8d67-3da5b160c50a",
	"deadlines": {
		"complaints": null
	},
	"description": "Trustap socks",
	"events": {
		"by_key": {
			"created": "2026-04-29T15:41:56Z",
			"joined": "2026-04-29T15:41:56Z"
		},
		"by_time": [
			{
				"at": "2026-04-29T15:41:56Z",
				"code": "created"
			},
			{
				"at": "2026-04-29T15:41:56Z",
				"code": "joined"
			}
		]
	},
	"id": "tx_01kqcyew65e4n9dtkaax7wp7r3",
	"payment_link": "https://actions.stage.trustap.com/transactions/tx_01kqcyew65e4n9dtkaax7wp7r3/pay",
	"pricing": {
		"amount": 20000,
		"amount_extra": 0,
		"currency": "usd",
		"fees": {
			"buyer": 1050,
			"buyer_client": 0,
			"seller": 0,
			"seller_client": 0
		}
	},
	"seller": {
		"id": "1-718bce10-23e8-43ba-a279-7e301d78273a",
		"is_guest": true
	},
	"status": "joined"
}
```

### Buyer transfers funds

After a transaction is created, redirect the buyer to the payment page to pay for it.

In the following examples, replace `<CALLBACK_PAYMENT>` with the redirect URI you set [during your Trustap setup](/docs/intro/auth). This is the location where the buyer will be redirected to following payment.

| Use case | URL |
|  --- | --- |
| Test environment | `https://actions.stage.trustap.com/transactions/{transaction_id}/pay?redirect_uri=<CALLBACK_PAYMENT>` |
| Production environment | `https://actions.trustap.com/transactions/{transaction_id}/pay?<CALLBACK_PAYMENT>` |


For example:

```cURL
https://actions.stage.trustap.com/transactions/tx_01kqcyew65e4n9dtkaax7wp7r3/pay?redirect_uri=https://www.trustap.com/
```

Alternatively, use `payment_link` from transaction object.

The Trustap API also supports `state` when sending a buyer to the payment screen.

Learn more about `state` in our [guide](/docs/guides/state).

The payment screen looks like the following.

Bank transfer payment screen
The buyer is shown bank transfer details after they submit their personal details.

Bank transfer details
If your buyer's account has funds already available, Trustap automatically uses those funds to pay for the transaction.

In this case, you will not see bank details at this step, however funds will transfer and move the [transaction status](/docs/guides/transactions/transaction-lifecycle)  to `paid`.

The get bank details endpoint returns a `400` error with the code `paid_with_balance`.

If the buyer's account has funds to partially pay for the transaction, Trustap uses those funds and requests payment for the remaining balance.

The [Trustap test buyer](/docs/intro/testing#test-bank-transfers) account is pre-funded behaves in this way.

### Seller accepts payment

Once the payment is made by the buyer, the seller can choose to accept the deposit.

Seller accept payment
```CURL
curl -i -X POST \
  -u '<API_KEY>:' \
  'https://api.test.trustap.com/v2/transactions/tx_01kqcyew65e4n9dtkaax7wp7r3/accept_payment' \
  -H 'Trustap-User: 1-718bce10-23e8-43ba-a279-7e301d78273a' \
  -H 'Content-Type: application/json'
```

Response
```JSON
{
	"buyer": {
		"id": "1-def29dfe-8626-48a2-8863-b6fdf2b96ff0",
		"is_guest": true
	},
	"client_id": "5ad5451d-70c7-43c6-86c9-e1d90556856c",
	"deadlines": {
		"complaints": null
	},
	"description": "Trustap socks",
	"events": {
		"by_key": {
			"created": "2026-04-29T11:04:26Z",
			"joined": "2026-04-29T11:04:26Z",
			"paid": "2026-04-29T11:05:19Z",
			"payment_accepted": "2026-04-29T11:06:06Z"
		},
		"by_time": [
			{
				"at": "2026-04-29T11:04:26Z",
				"code": "created"
			},
			{
				"at": "2026-04-29T11:04:26Z",
				"code": "joined"
			},
			{
				"at": "2026-04-29T11:05:19Z",
				"by": "1-def29dfe-8626-48a2-8863-b6fdf2b96ff0",
				"code": "paid"
			},
			{
				"at": "2026-04-29T11:06:06Z",
				"by": "1-3f546125-2ec2-4b14-87f6-54a14ae73e98",
				"code": "payment_accepted"
			}
		]
	},
	"id": "tx_01kq7pz74mffj9x5vsesqkve08",
	"pricing": {
		"amount": 20000,
		"amount_extra": 0,
		"currency": "usd",
		"fees": {
			"buyer": 640,
			"buyer_client": 0,
			"international_payment": 310,
			"seller": 0,
			"seller_client": 0
		}
	},
	"seller": {
		"id": "1-3f546125-2ec2-4b14-87f6-54a14ae73e98",
		"is_guest": true
	},
	"status": "payment_accepted"
}
```

### Confirm handover

After the physical handover, the buyer or the seller must confirm the handover. The 24-hour complaints period begins when either party confirms the handover.

Buyer confirms handover
```CURL
  curl -i -X POST \
  -u '<API_KEY>:' \
  'https://api.test.trustap.com/v2/transactions/tx_01kqcyew65e4n9dtkaax7wp7r3/confirm_handover' \
  -H 'Trustap-User: 1-718bce10-23e8-43ba-a279-7e301d78273a'
```

Response
```JSON
{
	"buyer": {
		"id": "1-def29dfe-8626-48a2-8863-b6fdf2b96ff0",
		"is_guest": true
	},
	"client_id": "5ad5451d-70c7-43c6-86c9-e1d90556856c",
	"deadlines": {
		"complaints": "2026-04-29T11:13:11Z"
	},
	"description": "Trustap socks",
	"events": {
		"by_key": {
			"created": "2026-04-29T11:04:26Z",
			"joined": "2026-04-29T11:04:26Z",
			"paid": "2026-04-29T11:05:19Z",
			"payment_accepted": "2026-04-29T11:06:06Z",
			"seller_handover_confirmed": "2026-04-29T11:08:11Z"
		},
		"by_time": [
			{
				"at": "2026-04-29T11:04:26Z",
				"code": "created"
			},
			{
				"at": "2026-04-29T11:04:26Z",
				"code": "joined"
			},
			{
				"at": "2026-04-29T11:05:19Z",
				"by": "1-def29dfe-8626-48a2-8863-b6fdf2b96ff0",
				"code": "paid"
			},
			{
				"at": "2026-04-29T11:06:06Z",
				"by": "1-3f546125-2ec2-4b14-87f6-54a14ae73e98",
				"code": "payment_accepted"
			},
			{
				"at": "2026-04-29T11:08:11Z",
				"by": "1-3f546125-2ec2-4b14-87f6-54a14ae73e98",
				"code": "seller_handover_confirmed"
			}
		]
	},
	"id": "tx_01kq7pz74mffj9x5vsesqkve08",
	"pricing": {
		"amount": 20000,
		"amount_extra": 0,
		"currency": "gbp",
		"fees": {
			"buyer": 640,
			"buyer_client": 0,
			"international_payment": 310,
			"seller": 0,
			"seller_client": 0
		}
	},
	"seller": {
		"id": "1-3f546125-2ec2-4b14-87f6-54a14ae73e98",
		"is_guest": true
	},
	"status": "seller_handover_confirmed"
}
```

### Complaints period

At this point, the buyer has the option to create a complaint if the were not satisfied with the transaction.
The buyer will receive an email from Trustap with details on how to create a complaint.
Submitting complaint will pause any payout until the issue is resolved. The Trustap support team mediate between both buyer and seller to resolve the complaint.

The complaints period typically lasts 24 hours.

Alternatively, you can enable your buyer to manually [create a complaint](/docs/guides/transactions/complaint).
If a complaint is made, you will receive an email as well as a [webhook event](/docs/concepts/webhooks).

If no complaint is made within the complaints period, funds are automatically released [following the seller claiming the payout](#step-9-seller-claims-payout).

### Seller claims transaction

1. A seller must register for a full Trustap account before they can claim a transaction. See our [full user guide](/docs/guides/transactions/full-users) for details.
2. Using the seller full Trustap account user ID as `Trustap-User`, claim the transaction. This links the transaction to their full Trustap account.


```CURL Seller claims transaction
curl -i -X POST \
-u '<API_KEY>:' \
'https://api.test.trustap.com/v2/transactions/{transaction_id}/claim' \
-H 'Content-Type: application/json' \
-H 'Trustap-User: ee461c3a-3971-45fa-b361-38694c78f69d' \
-d '{
  "role": "seller",
}'
```

1. Following confirmation of handover and a successful complaints period, the seller will receive the payout from the transaction to their account.