Refund Payin
POSThttps://api.cleverhub.co/api/v2/payins/refund
Initiate a refund request on a completed payin (with received
status). Before initiating the refund, check if the payin method is refundable (is_refundable == true
).
Request
- application/json
Body
uuidintegerrequired
Payment request ID
amountnumber
Refund amount, must be numeric. If not specified, the refund amount will be the same as the total amount.
descriptionstringrequired
Partial refund reason, must be at least 5 characters long
Responses
- 200
- 400
- 401
- 422
Refund Started
- application/json
- Schema
- Example (auto)
Schema
total_amountstring
Total amount of the transaction
refund_amountstring
Amount refunded
descriptionstring
Reason for the refund
payin_request object
{
"total_amount": "100.0",
"refund_amount": "10.0",
"description": "Test refund",
"payin_request": {
"uuid": "APU221YS",
"name": "Toby",
"description": "Test refund description",
"email": "toby.tran@helloclever.com",
"external_id": "1234556",
"status": "return_pending",
"pay_code": {
"pay_id": "n2qrikv@dreamithost.com.au"
},
"currency": "AUD",
"gst": false,
"amount": "100.0",
"gst_amount": 0,
"total": "100.0",
"paid_amount": "0.0",
"payment_method": "pay_id",
"is_refundable": true,
"expried_at": "2025-10-01T03:16:06.375+0000",
"pay_by": "2024-10-01T03:16:05.460+0000",
"payin_notification": {
"endpoint_url": "https://clver.com",
"authorization_header": "****"
}
}
}
Bad Request
Unauthorized
- application/json
- Schema
- Example (auto)
- Example
Schema
errors object
{
"errors": {
"code": "string",
"message": "string"
}
}
{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}
Unprocessable Entity
- application/json
- Schema
- Example (auto)
- Example
Schema
errors object
{
"errors": {
"payment_request_id": "string",
"refund_amount": "string",
"reason": "string"
}
}
{
"errors": {
"refund_amount": "can't be blank",
"reason": " can't be blank"
}
}
Authorization: app-id
name: app-idtype: apiKeydescription: The app-id is registered and secured inside Hello Clever system and only required when client has initiated or in the middle of the transaction.in: header
name: secret-keytype: apiKeydescription: The secret-key is our client's secret of the source. Required if a publishable key is used to retrieve the source.in: header
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.cleverhub.co/api/v2/payins/refund");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("app-id", "<app-id>");
request.Headers.Add("secret-key", "<app-id>");
var content = new StringContent("{\n \"uuid\": \"APU221YS\",\n \"amount\": 10,\n \"description\": \"Partial Refund Reason\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear