cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/credit_notes/cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"credit_note": {
"custom_attributes": []
}
}'from exsited import build_client
client = build_client()
response = client.credit_notes.update_credit_note(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d", {"credit_note": {"custom_attributes": []}}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.creditNotes.updateCreditNote('cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d', {
credit_note: {custom_attributes: []},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->creditNotes->updateCreditNote('cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d', [
'credit_note' => ['custom_attributes' => []],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.credit_notes.credit_notes_dto.CreditNotesDto.CreditNoteRead;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<CreditNoteRead> response = client.creditNotes().updateCreditNote(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
Map.of("credit_note", Map.of("custom_attributes", List.of())));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.CreditNotes.UpdateCreditNoteAsync(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
new Dictionary<string, object?>
{
["credit_note"] = new Dictionary<string, object?>
{
["custom_attributes"] = new List<object?>(),
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.creditNotes.updateCreditNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
{
'credit_note': {'custom_attributes': []},
},
);
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.CreditNotes().UpdateCreditNote(context.Background(), "cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d", map[string]any{
"credit_note": map[string]any{"custom_attributes": []any{}},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"credit_note": {
"account": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>"
},
"code": "<string>",
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"currency": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>"
},
"custom_attributes": [
{
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>",
"type": "<string>",
"value": "<unknown>"
}
],
"href": "<string>",
"id": "<string>",
"initial_amount": "<string>",
"invoices": [
{
"href": "<string>",
"id": "<string>",
"object": "<string>"
}
],
"issue_date": "<string>",
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"object": "<string>",
"payment": {
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"refund_amount": "<string>",
"refundable": true,
"remaining_amount": "<string>",
"status": "<string>",
"version": 123
}
}Credit notes
Update a credit note
Changes a credit note’s fields, such as its custom attributes, and returns it.
PATCH
/
credit_notes
/
{credit_note_id}
cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/credit_notes/cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"credit_note": {
"custom_attributes": []
}
}'from exsited import build_client
client = build_client()
response = client.credit_notes.update_credit_note(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d", {"credit_note": {"custom_attributes": []}}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.creditNotes.updateCreditNote('cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d', {
credit_note: {custom_attributes: []},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->creditNotes->updateCreditNote('cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d', [
'credit_note' => ['custom_attributes' => []],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.credit_notes.credit_notes_dto.CreditNotesDto.CreditNoteRead;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<CreditNoteRead> response = client.creditNotes().updateCreditNote(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
Map.of("credit_note", Map.of("custom_attributes", List.of())));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.CreditNotes.UpdateCreditNoteAsync(
"cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d",
new Dictionary<string, object?>
{
["credit_note"] = new Dictionary<string, object?>
{
["custom_attributes"] = new List<object?>(),
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.creditNotes.updateCreditNote(
'cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d',
{
'credit_note': {'custom_attributes': []},
},
);
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.CreditNotes().UpdateCreditNote(context.Background(), "cn_8a1d2c3b4e5f4a6b9c7d0e1f2a3b4c5d", map[string]any{
"credit_note": map[string]any{"custom_attributes": []any{}},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"credit_note": {
"account": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>"
},
"code": "<string>",
"created_by": {
"name": "<string>",
"object": "<string>"
},
"created_on": "<string>",
"currency": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>"
},
"custom_attributes": [
{
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>",
"type": "<string>",
"value": "<unknown>"
}
],
"href": "<string>",
"id": "<string>",
"initial_amount": "<string>",
"invoices": [
{
"href": "<string>",
"id": "<string>",
"object": "<string>"
}
],
"issue_date": "<string>",
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"object": "<string>",
"payment": {
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"refund_amount": "<string>",
"refundable": true,
"remaining_amount": "<string>",
"status": "<string>",
"version": 123
}
}Updates the fields sent under
credit_note, such as custom_attributes, and returns the credit note.
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 credit note's id, which starts with cn_.
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
The updated credit note, under credit_note.
Show child attributes
Show child attributes