cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/credit_notes/CN-0001/refunds" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"refund": {
"amount": "2.00",
"payment_method": "Cash"
}
}'from exsited import build_client
client = build_client()
response = client.refunds.create_credit_note_refund(
"CN-0001", {"refund": {"amount": "2.00", "payment_method": "Cash"}}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.refunds.createCreditNoteRefund('CN-0001', {
refund: {amount: '2.00', payment_method: 'Cash'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->refunds->createCreditNoteRefund('CN-0001', [
'refund' => ['amount' => '2.00', 'payment_method' => 'Cash'],
]);
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().createCreditNoteRefund(
"CN-0001",
Map.of("refund", Map.of("amount", "2.00", "payment_method", "Cash")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Refunds.CreateCreditNoteRefundAsync(
"CN-0001",
new Dictionary<string, object?>
{
["refund"] = new Dictionary<string, object?>
{
["amount"] = "2.00",
["payment_method"] = "Cash",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.refunds.createCreditNoteRefund('CN-0001', {
'refund': {'amount': '2.00', 'payment_method': 'Cash'},
});
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().CreateCreditNoteRefund(context.Background(), "CN-0001", map[string]any{
"refund": map[string]any{"amount": "2.00", "payment_method": "Cash"},
}, 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
Create a refund from a credit note
Refunds part or all of a credit note and returns the new refund.
POST
/
credit_notes
/
{credit_note_id}
/
refunds
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/credit_notes/CN-0001/refunds" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"refund": {
"amount": "2.00",
"payment_method": "Cash"
}
}'from exsited import build_client
client = build_client()
response = client.refunds.create_credit_note_refund(
"CN-0001", {"refund": {"amount": "2.00", "payment_method": "Cash"}}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.refunds.createCreditNoteRefund('CN-0001', {
refund: {amount: '2.00', payment_method: 'Cash'},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->refunds->createCreditNoteRefund('CN-0001', [
'refund' => ['amount' => '2.00', 'payment_method' => 'Cash'],
]);
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().createCreditNoteRefund(
"CN-0001",
Map.of("refund", Map.of("amount", "2.00", "payment_method", "Cash")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Refunds.CreateCreditNoteRefundAsync(
"CN-0001",
new Dictionary<string, object?>
{
["refund"] = new Dictionary<string, object?>
{
["amount"] = "2.00",
["payment_method"] = "Cash",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.refunds.createCreditNoteRefund('CN-0001', {
'refund': {'amount': '2.00', 'payment_method': 'Cash'},
});
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().CreateCreditNoteRefund(context.Background(), "CN-0001", map[string]any{
"refund": map[string]any{"amount": "2.00", "payment_method": "Cash"},
}, 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
}
}Creates a refund against the credit note from the fields under
refund: the amount and the payment_method to refund through. The credit note’s refund_amount goes up by the amount.
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 code.
Body
application/json
Show child attributes
Show child attributes
Response
201 - application/json
The new refund, under refund.
Show child attributes
Show child attributes