cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/purchase_credit_notes/pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"purchase_credit_note": {
"custom_attributes": []
}
}'from exsited import build_client
client = build_client()
response = client.purchase_credit_notes.update_purchase_credit_note(
"pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b",
{"purchase_credit_note": {"custom_attributes": []}},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.purchaseCreditNotes.updatePurchaseCreditNote('pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b', {
purchase_credit_note: {custom_attributes: []},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->purchaseCreditNotes->updatePurchaseCreditNote(
'pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b',
['purchase_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.purchase_credit_notes.purchase_credit_notes_dto.PurchaseCreditNotesDto.PurchaseCreditNoteRead;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<PurchaseCreditNoteRead> response = client.purchaseCreditNotes().updatePurchaseCreditNote(
"pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b",
Map.of("purchase_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.PurchaseCreditNotes.UpdatePurchaseCreditNoteAsync(
"pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b",
new Dictionary<string, object?>
{
["purchase_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.purchaseCreditNotes.updatePurchaseCreditNote(
'pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b',
{
'purchase_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.PurchaseCreditNotes().UpdatePurchaseCreditNote(context.Background(), "pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b", map[string]any{
"purchase_credit_note": map[string]any{"custom_attributes": []any{}},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"purchase_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>"
},
"href": "<string>",
"id": "<string>",
"initial_amount": "<string>",
"issue_date": "<string>",
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"object": "<string>",
"purchase_credit_note_rows": [
{
"credit_note_from_blank_method": "<string>",
"credit_note_from_credit_note": "<string>",
"credit_note_from_payment_method": "<string>",
"credit_note_total": "<string>",
"payment_method": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"payment_processor": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"refund_from_blank_method": "<string>",
"refund_from_credit_note": "<string>",
"refund_from_payment_method": "<string>",
"refund_total": "<string>"
}
],
"purchase_payment": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"refund_amount": "<string>",
"refundable": true,
"remaining_amount": "<string>",
"status": "<unknown>",
"version": 123
}
}Purchase credit notes
Update a purchase credit note
Changes fields of a purchase credit note, such as its custom attributes, and returns it under purchase_credit_note.
PATCH
/
purchase_credit_notes
/
{purchase_credit_note_id}
cURL
curl -X PATCH "$EXSITED_BASE_URL/api/v4/purchase_credit_notes/pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"purchase_credit_note": {
"custom_attributes": []
}
}'from exsited import build_client
client = build_client()
response = client.purchase_credit_notes.update_purchase_credit_note(
"pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b",
{"purchase_credit_note": {"custom_attributes": []}},
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.purchaseCreditNotes.updatePurchaseCreditNote('pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b', {
purchase_credit_note: {custom_attributes: []},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->purchaseCreditNotes->updatePurchaseCreditNote(
'pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b',
['purchase_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.purchase_credit_notes.purchase_credit_notes_dto.PurchaseCreditNotesDto.PurchaseCreditNoteRead;
import java.util.List;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<PurchaseCreditNoteRead> response = client.purchaseCreditNotes().updatePurchaseCreditNote(
"pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b",
Map.of("purchase_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.PurchaseCreditNotes.UpdatePurchaseCreditNoteAsync(
"pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b",
new Dictionary<string, object?>
{
["purchase_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.purchaseCreditNotes.updatePurchaseCreditNote(
'pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b',
{
'purchase_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.PurchaseCreditNotes().UpdatePurchaseCreditNote(context.Background(), "pcn_5e4d3c2b1a0f4e9d8c7b6a5f4e3d2c1b", map[string]any{
"purchase_credit_note": map[string]any{"custom_attributes": []any{}},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"purchase_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>"
},
"href": "<string>",
"id": "<string>",
"initial_amount": "<string>",
"issue_date": "<string>",
"last_updated_by": {
"name": "<string>",
"object": "<string>"
},
"last_updated_on": "<string>",
"object": "<string>",
"purchase_credit_note_rows": [
{
"credit_note_from_blank_method": "<string>",
"credit_note_from_credit_note": "<string>",
"credit_note_from_payment_method": "<string>",
"credit_note_total": "<string>",
"payment_method": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"payment_processor": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"refund_from_blank_method": "<string>",
"refund_from_credit_note": "<string>",
"refund_from_payment_method": "<string>",
"refund_total": "<string>"
}
],
"purchase_payment": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"object": "<string>"
},
"refund_amount": "<string>",
"refundable": true,
"remaining_amount": "<string>",
"status": "<unknown>",
"version": 123
}
}Updates the purchase credit note, wrapped in
purchase_credit_note, for example its custom_attributes. The updated credit note comes back under purchase_credit_note. An empty custom_attributes list, as in the example, removes all custom attributes.
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 purchase credit note's id, such as pcn_....
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
The updated purchase credit note, under purchase_credit_note.
Show child attributes
Show child attributes