Transfer Funds from Sellers
After refunding a customer, you may need to retrieve funds from a seller back into your account using a refund transfer. Each refund may have exactly one refund transfer, whose total amount cannot exceed the refund amount.
Before you start
Secret Key- Authenticates requests from your server. Never send it to the browser.
Prerequisites
This guide assumes you have already completed:
- Refund Payments — you will need a refund ID.
- Transfer Funds to Sellers — you will need the payment transfer ID and item IDs from the original transfer.
Grab the refund id:
Refund
{
"id": "rfd_2YKewBonG4tgk12MheY3PiHDy",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "test",
...
}
And the payment transfer id and each item id from the original transfer:
Payment Transfer
{
"id": "trnf_7yFLQWACr3DYDSz1xpoEAVfdq",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "test",
...
"items": [{
"id": "trfi_7yFLQWACr3DYDSz1xpoEAVfdq",
"seller_account_id": "acc_w6dogDaHuU6h1N5e5vfXLUYf",
"amount": 1000,
"transfer_fee": 100
}]
}
Create a Refund Transfer
Call the Create Refund Transfer endpoint:
Create a Refund Transfer
curl 'https://api.publicsquare.com/refund-transfers' \
-X 'POST' \
-H 'X-API-KEY: <SECRET_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"refund_id": "rfd_2YKewBonG4tgk12MheY3PiHDy",
"payment_transfer_id": "trnf_7yFLQWACr3DYDSz1xpoEAVfdq",
"items": [{
"payment_transfer_item_id": "trfi_7yFLQWACr3DYDSz1xpoEAVfdq",
"amount": 1000,
"transfer_fee": 100
}]
}'
The amount is provided in cents. 1000 is the equivalent of $10.00
You should see a refund transfer result similar to:
Refund Transfer Response
{
"id": "trnf_6Qy74FeCJxoJeXetcyTvbSnVF",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "test",
"status": "succeeded",
"refund_id": "rfd_2YKewBonG4tgk12MheY3PiHDy",
"payment_transfer_id": "trnf_7yFLQWACr3DYDSz1xpoEAVfdq",
"transaction_id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"total_amount": 1000,
"currency": "USD",
"items": [{
"id": "trfi_4iarm41gZ1qyxDoGfEEMXyryJ",
"seller_account_id": "acc_w6dogDaHuU6h1N5e5vfXLUYf",
"payment_transfer_item_id": "trfi_7yFLQWACr3DYDSz1xpoEAVfdq",
"amount": 1000,
"transfer_fee": 100
}],
"transaction": {
"id": "trx_95rvMJvAVeG68W4NtLdfkN3LG",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "test",
"status": "succeeded",
"amount": 1000,
"fee_amount": 100,
"net_amount": 900,
"currency": "USD",
"type_id": "trnf_7yFLQWACr3DYDSz1xpoEAVfdq",
"type": "refund_transfer",
"processor": "nuvei",
"processor_id": "7110000000010554769",
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z"
},
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z"
}
Credova creates a refund transaction in the seller's account for each item in the refund transfer.
Conclusion
Following this guide, you have successfully retrieved funds from a seller's account using a refund transfer.
Follow these guides to learn more:
- Transfer Funds to Sellers — send funds to sellers using Payment Transfer Intents
- Search and View Transactions
- Webhooks