cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/credit_notes/cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d/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.credit_notes.create_credit_note_note(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
"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.creditNotes.createCreditNoteNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
'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->creditNotes->createCreditNoteNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
'Customer asked for a copy by post.',
['file' => ['receipt.pdf', fopen('receipt.pdf', 'r')]],
);
print_r($response->data);
import com.exsited.Dto;
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.client.RequestOptions;
import java.nio.file.Path;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Dto> response = client.creditNotes().createCreditNoteNote(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
"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.CreditNotes.CreateCreditNoteNoteAsync(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
"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.creditNotes.createCreditNoteNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
'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.CreditNotes().CreateCreditNoteNote(context.Background(), "cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d", "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)
{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Credit notes
Add a note to a credit note
Adds a note, and optionally a file, to a credit note.
POST
/
credit_notes
/
{credit_note_id}
/
notes
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/credit_notes/cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d/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.credit_notes.create_credit_note_note(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
"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.creditNotes.createCreditNoteNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
'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->creditNotes->createCreditNoteNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
'Customer asked for a copy by post.',
['file' => ['receipt.pdf', fopen('receipt.pdf', 'r')]],
);
print_r($response->data);
import com.exsited.Dto;
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.client.RequestOptions;
import java.nio.file.Path;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Dto> response = client.creditNotes().createCreditNoteNote(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
"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.CreditNotes.CreateCreditNoteNoteAsync(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
"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.creditNotes.createCreditNoteNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
'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.CreditNotes().CreateCreditNoteNote(context.Background(), "cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d", "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)
{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Sends a multipart form: the text as the
note field and any attachment as file. Your API client needs the CREATE_CREDIT_NOTE_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 credit note's id, which starts with cn_.
Body
multipart/form-data
Response
The note is created.