cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/refunds/REF-0001/notes" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--form-string 'note=Customer asked for a copy by post.' \
-F "file=@receipt.pdf"from exsited import build_client
client = build_client()
response = client.refunds.create_refund_note(
"REF-0001",
"Customer asked for a copy by post.",
files={"file": open("receipt.pdf", "rb")},
)
print(response.data)
import {readFileSync} from 'node:fs';
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.refunds.createRefundNote('REF-0001', 'Customer asked for a copy by post.', {
files: {file: ['receipt.pdf', readFileSync('receipt.pdf')]},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->refunds->createRefundNote('REF-0001', 'Customer asked for a copy by post.', [
'file' => ['receipt.pdf', fopen('receipt.pdf', 'r')],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.client.RequestOptions;
import com.exsited.resources.refunds.refunds_dto.RefundsDto.RefundNote;
import java.nio.file.Path;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<RefundNote> response = client.refunds().createRefundNote(
"REF-0001",
"Customer asked for a copy by post.",
Map.of("file", Path.of("receipt.pdf")),
RequestOptions.none());
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Refunds.CreateRefundNoteAsync(
"REF-0001",
"Customer asked for a copy by post.",
new Dictionary<string, object?> { ["file"] = new object?[] { "receipt.pdf", File.ReadAllBytes("receipt.pdf") } });
Console.WriteLine(response.Json);
import 'dart:io';
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.refunds.createRefundNote(
'REF-0001',
'Customer asked for a copy by post.',
files: {
'file': ['receipt.pdf', File('receipt.pdf').readAsBytesSync()],
},
);
print(response.map);
import (
"context"
"fmt"
"log"
"os"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
file, err := os.ReadFile("receipt.pdf")
if err != nil {
log.Fatal(err)
}
response, err := client.Refunds().CreateRefundNote(context.Background(), "REF-0001", "Customer asked for a copy by post.", map[string]any{"file": []any{"receipt.pdf", file}}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"note": {
"attachments": [
{
"uuid": "<string>",
"filename": "<string>",
"content_type": "<string>",
"size": 123,
"href": "<string>"
}
],
"content": "<string>",
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"group": "<unknown>",
"href": "<string>",
"id": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<unknown>",
"object": "<string>",
"refund": {
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"user": "<unknown>",
"version": 123,
"watchers": [
{
"email": "<unknown>",
"name": "<string>",
"type": "<string>"
}
]
}
}Refunds
Create a refund note
Adds a note, and optionally a file, to a refund and returns the note.
POST
/
refunds
/
{refund_id}
/
notes
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/refunds/REF-0001/notes" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--form-string 'note=Customer asked for a copy by post.' \
-F "file=@receipt.pdf"from exsited import build_client
client = build_client()
response = client.refunds.create_refund_note(
"REF-0001",
"Customer asked for a copy by post.",
files={"file": open("receipt.pdf", "rb")},
)
print(response.data)
import {readFileSync} from 'node:fs';
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.refunds.createRefundNote('REF-0001', 'Customer asked for a copy by post.', {
files: {file: ['receipt.pdf', readFileSync('receipt.pdf')]},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->refunds->createRefundNote('REF-0001', 'Customer asked for a copy by post.', [
'file' => ['receipt.pdf', fopen('receipt.pdf', 'r')],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.client.RequestOptions;
import com.exsited.resources.refunds.refunds_dto.RefundsDto.RefundNote;
import java.nio.file.Path;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<RefundNote> response = client.refunds().createRefundNote(
"REF-0001",
"Customer asked for a copy by post.",
Map.of("file", Path.of("receipt.pdf")),
RequestOptions.none());
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Refunds.CreateRefundNoteAsync(
"REF-0001",
"Customer asked for a copy by post.",
new Dictionary<string, object?> { ["file"] = new object?[] { "receipt.pdf", File.ReadAllBytes("receipt.pdf") } });
Console.WriteLine(response.Json);
import 'dart:io';
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.refunds.createRefundNote(
'REF-0001',
'Customer asked for a copy by post.',
files: {
'file': ['receipt.pdf', File('receipt.pdf').readAsBytesSync()],
},
);
print(response.map);
import (
"context"
"fmt"
"log"
"os"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
file, err := os.ReadFile("receipt.pdf")
if err != nil {
log.Fatal(err)
}
response, err := client.Refunds().CreateRefundNote(context.Background(), "REF-0001", "Customer asked for a copy by post.", map[string]any{"file": []any{"receipt.pdf", file}}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"note": {
"attachments": [
{
"uuid": "<string>",
"filename": "<string>",
"content_type": "<string>",
"size": 123,
"href": "<string>"
}
],
"content": "<string>",
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"group": "<unknown>",
"href": "<string>",
"id": "<string>",
"last_updated_by": "<unknown>",
"last_updated_on": "<unknown>",
"object": "<string>",
"refund": {
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"user": "<unknown>",
"version": 123,
"watchers": [
{
"email": "<unknown>",
"name": "<string>",
"type": "<string>"
}
]
}
}Sends a multipart form: the text as the
note field and any attachment as file. Deleting the note later needs the CREATE_REFUND_NOTE permission.
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.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
multipart/form-data
Response
201 - application/json
The new note, under note.
Show child attributes
Show child attributes