Refund Payin
This API processes a refund request for a specific payment link. It supports both full and partial refunds. If the refund amount is not provided, the full payment amount will be refunded.
curl --request POST \
--url https://api.cleverhub.co/api/v3/payin_links/refund \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"uuid": "7AMCEF7H",
"amount": 1000,
"description": "Partial Refund Reason"
}
'import requests
url = "https://api.cleverhub.co/api/v3/payin_links/refund"
payload = {
"uuid": "7AMCEF7H",
"amount": 1000,
"description": "Partial Refund Reason"
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({uuid: '7AMCEF7H', amount: 1000, description: 'Partial Refund Reason'})
};
fetch('https://api.cleverhub.co/api/v3/payin_links/refund', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cleverhub.co/api/v3/payin_links/refund",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uuid' => '7AMCEF7H',
'amount' => 1000,
'description' => 'Partial Refund Reason'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v3/payin_links/refund"
payload := strings.NewReader("{\n \"uuid\": \"7AMCEF7H\",\n \"amount\": 1000,\n \"description\": \"Partial Refund Reason\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cleverhub.co/api/v3/payin_links/refund")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"7AMCEF7H\",\n \"amount\": 1000,\n \"description\": \"Partial Refund Reason\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v3/payin_links/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uuid\": \"7AMCEF7H\",\n \"amount\": 1000,\n \"description\": \"Partial Refund Reason\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "7AMCEF7H",
"expires_at": "2025-10-02T19:05:03.971Z",
"payment_url": "https://paylink.cleverhub.co/N0FNQ0VGNAD",
"payin_method_code": "vn_vietqr_vnd",
"amount": 3000,
"description": "Test payin",
"external_id": "123456",
"redirect_url": {
"success": "https://example.com/success"
},
"webhook_notification": {
"authorization_header": "****",
"endpoint_url": "https://example.com/webhook"
},
"sender_info": {
"dob": "1990-01-01",
"city": "Ho Chi Minh City",
"email": "email@gmail.com",
"phone": "0123456789",
"state": "Ho Chi Minh",
"gender": "male",
"reg_no": "A1234567",
"upi_id": "johndoe@upi",
"address": "123 abc",
"user_id": "user_12345",
"bank_code": "VCB",
"bank_name": "Bank VCB",
"first_name": "John",
"last_name": "Doe",
"state_code": "SG",
"postal_code": "700000",
"account_name": "John Doe",
"contact_type": "individual",
"country_code": "VN",
"document_type": "passport",
"account_number": "233240000000",
"document_number": "P123456789"
},
"metadata": {
"custom_note": "Priority customer"
},
"transaction_info": {
"uuid": "3D8G9WJJ",
"currency": "VND",
"amount": 3000,
"paid_amount": 0,
"refund_amount": 0,
"status": "pending",
"status_text": "Customer started a new payment but hasn't proceeded yet."
}
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"uuid": "is invalid",
"description": "can't be blank"
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
Response
Payin link refund started
Unique identifier for the payment transaction.
Expiration time (ISO 8601 UTC) of the payment link.
URL of the payment link.
Code of the selected payment method.
Original payment amount.
Description of the payment transaction.
Custom ID.
Show child attributes
Show child attributes
Webhook configuration for transaction status updates
Show child attributes
Show child attributes
Information about the customer.
Show child attributes
Show child attributes
Optional custom metadata to attach to the transaction.
Information about the transaction.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.cleverhub.co/api/v3/payin_links/refund \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"uuid": "7AMCEF7H",
"amount": 1000,
"description": "Partial Refund Reason"
}
'import requests
url = "https://api.cleverhub.co/api/v3/payin_links/refund"
payload = {
"uuid": "7AMCEF7H",
"amount": 1000,
"description": "Partial Refund Reason"
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({uuid: '7AMCEF7H', amount: 1000, description: 'Partial Refund Reason'})
};
fetch('https://api.cleverhub.co/api/v3/payin_links/refund', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cleverhub.co/api/v3/payin_links/refund",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uuid' => '7AMCEF7H',
'amount' => 1000,
'description' => 'Partial Refund Reason'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v3/payin_links/refund"
payload := strings.NewReader("{\n \"uuid\": \"7AMCEF7H\",\n \"amount\": 1000,\n \"description\": \"Partial Refund Reason\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cleverhub.co/api/v3/payin_links/refund")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"uuid\": \"7AMCEF7H\",\n \"amount\": 1000,\n \"description\": \"Partial Refund Reason\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v3/payin_links/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"uuid\": \"7AMCEF7H\",\n \"amount\": 1000,\n \"description\": \"Partial Refund Reason\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "7AMCEF7H",
"expires_at": "2025-10-02T19:05:03.971Z",
"payment_url": "https://paylink.cleverhub.co/N0FNQ0VGNAD",
"payin_method_code": "vn_vietqr_vnd",
"amount": 3000,
"description": "Test payin",
"external_id": "123456",
"redirect_url": {
"success": "https://example.com/success"
},
"webhook_notification": {
"authorization_header": "****",
"endpoint_url": "https://example.com/webhook"
},
"sender_info": {
"dob": "1990-01-01",
"city": "Ho Chi Minh City",
"email": "email@gmail.com",
"phone": "0123456789",
"state": "Ho Chi Minh",
"gender": "male",
"reg_no": "A1234567",
"upi_id": "johndoe@upi",
"address": "123 abc",
"user_id": "user_12345",
"bank_code": "VCB",
"bank_name": "Bank VCB",
"first_name": "John",
"last_name": "Doe",
"state_code": "SG",
"postal_code": "700000",
"account_name": "John Doe",
"contact_type": "individual",
"country_code": "VN",
"document_type": "passport",
"account_number": "233240000000",
"document_number": "P123456789"
},
"metadata": {
"custom_note": "Priority customer"
},
"transaction_info": {
"uuid": "3D8G9WJJ",
"currency": "VND",
"amount": 3000,
"paid_amount": 0,
"refund_amount": 0,
"status": "pending",
"status_text": "Customer started a new payment but hasn't proceeded yet."
}
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"uuid": "is invalid",
"description": "can't be blank"
}
}