cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/refunds/REF-0001" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"refund": {
"reference": "BANK-REF-2001",
"note": "Refunded to the original card."
}
}'from exsited import build_client
client = build_client()
response = client.refunds.update_refund(
"REF-0001",
{
"refund": {
"reference": "BANK-REF-2001",
"note": "Refunded to the original card.",
}
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.refunds.updateRefund('REF-0001', {
refund: {reference: 'BANK-REF-2001', note: 'Refunded to the original card.'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->refunds->updateRefund('REF-0001', [
'refund' => ['reference' => 'BANK-REF-2001', 'note' => 'Refunded to the original card.'],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.refunds.refunds_dto.RefundsDto.RefundUpdated;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<RefundUpdated> response = client.refunds().updateRefund(
"REF-0001",
Map.of(
"refund", Map.of(
"reference", "BANK-REF-2001",
"note", "Refunded to the original card.")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Refunds.UpdateRefundAsync(
"REF-0001",
new Dictionary<string, object?>
{
["refund"] = new Dictionary<string, object?>
{
["reference"] = "BANK-REF-2001",
["note"] = "Refunded to the original card.",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.refunds.updateRefund('REF-0001', {
'refund': {
'reference': 'BANK-REF-2001',
'note': 'Refunded to the original card.',
},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Refunds().UpdateRefund(context.Background(), "REF-0001", map[string]any{
"refund": map[string]any{
"reference": "BANK-REF-2001",
"note": "Refunded to the original card.",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"refund": {
"account": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"amount": "<string>",
"created_by": "<string>",
"created_on": "<string>",
"credit_note": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"credit_note_id": "<string>",
"custom_attributes": [
"<unknown>"
],
"gateway_response": "<string>",
"id": "<string>",
"issue_date": "<string>",
"last_updated_by": "<string>",
"last_updated_on": "<string>",
"note": "<string>",
"object": "<string>",
"payment_method": "<string>",
"payment_processor": "<string>",
"reconcile_status": "<string>",
"reference": "<string>",
"status": "<string>",
"uuid": "<string>",
"version": 123
}
}Refunds
Update a refund
Changes a refund’s reference or note and returns the refund.
PATCH
/
refunds
/
{refund_id}
cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/refunds/REF-0001" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"refund": {
"reference": "BANK-REF-2001",
"note": "Refunded to the original card."
}
}'from exsited import build_client
client = build_client()
response = client.refunds.update_refund(
"REF-0001",
{
"refund": {
"reference": "BANK-REF-2001",
"note": "Refunded to the original card.",
}
},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.refunds.updateRefund('REF-0001', {
refund: {reference: 'BANK-REF-2001', note: 'Refunded to the original card.'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->refunds->updateRefund('REF-0001', [
'refund' => ['reference' => 'BANK-REF-2001', 'note' => 'Refunded to the original card.'],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.refunds.refunds_dto.RefundsDto.RefundUpdated;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<RefundUpdated> response = client.refunds().updateRefund(
"REF-0001",
Map.of(
"refund", Map.of(
"reference", "BANK-REF-2001",
"note", "Refunded to the original card.")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Refunds.UpdateRefundAsync(
"REF-0001",
new Dictionary<string, object?>
{
["refund"] = new Dictionary<string, object?>
{
["reference"] = "BANK-REF-2001",
["note"] = "Refunded to the original card.",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.refunds.updateRefund('REF-0001', {
'refund': {
'reference': 'BANK-REF-2001',
'note': 'Refunded to the original card.',
},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Refunds().UpdateRefund(context.Background(), "REF-0001", map[string]any{
"refund": map[string]any{
"reference": "BANK-REF-2001",
"note": "Refunded to the original card.",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"refund": {
"account": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"amount": "<string>",
"created_by": "<string>",
"created_on": "<string>",
"credit_note": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"credit_note_id": "<string>",
"custom_attributes": [
"<unknown>"
],
"gateway_response": "<string>",
"id": "<string>",
"issue_date": "<string>",
"last_updated_by": "<string>",
"last_updated_on": "<string>",
"note": "<string>",
"object": "<string>",
"payment_method": "<string>",
"payment_processor": "<string>",
"reconcile_status": "<string>",
"reference": "<string>",
"status": "<string>",
"uuid": "<string>",
"version": 123
}
}Updates the fields sent under
refund, such as reference and note. The refund’s version goes up.
The SDK samples get their client from credentials your app registers once when it starts, as shown in Authentication. To try the call here, click Try it, set
host to your Exsited API host name and paste an access token from Get an access token. To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its -d payload.Authorizations
An access token from POST /api/v4/oauth2/token. The SDKs get and renew it for you.
Path Parameters
The refund's code, which the refunds listing returns as id.
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
The updated refund, under refund.
Show child attributes
Show child attributes