Update a credit note
curl --request PUT \
--url https://api.example.com/api/credit-notes/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerId": 1,
"exchangeRate": 3.43,
"creditNoteDate": "2021-09-01",
"referenceNo": "123",
"creditNoteNumber": "123",
"note": "123",
"termsConditions": "123",
"open": false,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"itemId": 1,
"quantity": 1,
"rate": 10,
"taxRateId": 1
}
],
"pdfTemplateId": 1,
"discount": 10,
"discountType": "percentage"
}
'import requests
url = "https://api.example.com/api/credit-notes/{id}"
payload = {
"customerId": 1,
"exchangeRate": 3.43,
"creditNoteDate": "2021-09-01",
"referenceNo": "123",
"creditNoteNumber": "123",
"note": "123",
"termsConditions": "123",
"open": False,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"itemId": 1,
"quantity": 1,
"rate": 10,
"taxRateId": 1
}
],
"pdfTemplateId": 1,
"discount": 10,
"discountType": "percentage"
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: 1,
exchangeRate: 3.43,
creditNoteDate: '2021-09-01',
referenceNo: '123',
creditNoteNumber: '123',
note: '123',
termsConditions: '123',
open: false,
warehouseId: 1,
branchId: 1,
entries: [{itemId: 1, quantity: 1, rate: 10, taxRateId: 1}],
pdfTemplateId: 1,
discount: 10,
discountType: 'percentage'
})
};
fetch('https://api.example.com/api/credit-notes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/credit-notes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => 1,
'exchangeRate' => 3.43,
'creditNoteDate' => '2021-09-01',
'referenceNo' => '123',
'creditNoteNumber' => '123',
'note' => '123',
'termsConditions' => '123',
'open' => false,
'warehouseId' => 1,
'branchId' => 1,
'entries' => [
[
'itemId' => 1,
'quantity' => 1,
'rate' => 10,
'taxRateId' => 1
]
],
'pdfTemplateId' => 1,
'discount' => 10,
'discountType' => 'percentage'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/credit-notes/{id}"
payload := strings.NewReader("{\n \"customerId\": 1,\n \"exchangeRate\": 3.43,\n \"creditNoteDate\": \"2021-09-01\",\n \"referenceNo\": \"123\",\n \"creditNoteNumber\": \"123\",\n \"note\": \"123\",\n \"termsConditions\": \"123\",\n \"open\": false,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"itemId\": 1,\n \"quantity\": 1,\n \"rate\": 10,\n \"taxRateId\": 1\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 10,\n \"discountType\": \"percentage\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/credit-notes/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": 1,\n \"exchangeRate\": 3.43,\n \"creditNoteDate\": \"2021-09-01\",\n \"referenceNo\": \"123\",\n \"creditNoteNumber\": \"123\",\n \"note\": \"123\",\n \"termsConditions\": \"123\",\n \"open\": false,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"itemId\": 1,\n \"quantity\": 1,\n \"rate\": 10,\n \"taxRateId\": 1\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 10,\n \"discountType\": \"percentage\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/credit-notes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": 1,\n \"exchangeRate\": 3.43,\n \"creditNoteDate\": \"2021-09-01\",\n \"referenceNo\": \"123\",\n \"creditNoteNumber\": \"123\",\n \"note\": \"123\",\n \"termsConditions\": \"123\",\n \"open\": false,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"itemId\": 1,\n \"quantity\": 1,\n \"rate\": 10,\n \"taxRateId\": 1\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 10,\n \"discountType\": \"percentage\"\n}"
response = http.request(request)
puts response.read_bodyCredit Notes
Update a credit note
PUT
/
api
/
credit-notes
/
{id}
Update a credit note
curl --request PUT \
--url https://api.example.com/api/credit-notes/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'organization-id: <organization-id>' \
--data '
{
"customerId": 1,
"exchangeRate": 3.43,
"creditNoteDate": "2021-09-01",
"referenceNo": "123",
"creditNoteNumber": "123",
"note": "123",
"termsConditions": "123",
"open": false,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"itemId": 1,
"quantity": 1,
"rate": 10,
"taxRateId": 1
}
],
"pdfTemplateId": 1,
"discount": 10,
"discountType": "percentage"
}
'import requests
url = "https://api.example.com/api/credit-notes/{id}"
payload = {
"customerId": 1,
"exchangeRate": 3.43,
"creditNoteDate": "2021-09-01",
"referenceNo": "123",
"creditNoteNumber": "123",
"note": "123",
"termsConditions": "123",
"open": False,
"warehouseId": 1,
"branchId": 1,
"entries": [
{
"itemId": 1,
"quantity": 1,
"rate": 10,
"taxRateId": 1
}
],
"pdfTemplateId": 1,
"discount": 10,
"discountType": "percentage"
}
headers = {
"Authorization": "<authorization>",
"organization-id": "<organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'organization-id': '<organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerId: 1,
exchangeRate: 3.43,
creditNoteDate: '2021-09-01',
referenceNo: '123',
creditNoteNumber: '123',
note: '123',
termsConditions: '123',
open: false,
warehouseId: 1,
branchId: 1,
entries: [{itemId: 1, quantity: 1, rate: 10, taxRateId: 1}],
pdfTemplateId: 1,
discount: 10,
discountType: 'percentage'
})
};
fetch('https://api.example.com/api/credit-notes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/credit-notes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => 1,
'exchangeRate' => 3.43,
'creditNoteDate' => '2021-09-01',
'referenceNo' => '123',
'creditNoteNumber' => '123',
'note' => '123',
'termsConditions' => '123',
'open' => false,
'warehouseId' => 1,
'branchId' => 1,
'entries' => [
[
'itemId' => 1,
'quantity' => 1,
'rate' => 10,
'taxRateId' => 1
]
],
'pdfTemplateId' => 1,
'discount' => 10,
'discountType' => 'percentage'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"organization-id: <organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/credit-notes/{id}"
payload := strings.NewReader("{\n \"customerId\": 1,\n \"exchangeRate\": 3.43,\n \"creditNoteDate\": \"2021-09-01\",\n \"referenceNo\": \"123\",\n \"creditNoteNumber\": \"123\",\n \"note\": \"123\",\n \"termsConditions\": \"123\",\n \"open\": false,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"itemId\": 1,\n \"quantity\": 1,\n \"rate\": 10,\n \"taxRateId\": 1\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 10,\n \"discountType\": \"percentage\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("organization-id", "<organization-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/credit-notes/{id}")
.header("Authorization", "<authorization>")
.header("organization-id", "<organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": 1,\n \"exchangeRate\": 3.43,\n \"creditNoteDate\": \"2021-09-01\",\n \"referenceNo\": \"123\",\n \"creditNoteNumber\": \"123\",\n \"note\": \"123\",\n \"termsConditions\": \"123\",\n \"open\": false,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"itemId\": 1,\n \"quantity\": 1,\n \"rate\": 10,\n \"taxRateId\": 1\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 10,\n \"discountType\": \"percentage\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/credit-notes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["organization-id"] = '<organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": 1,\n \"exchangeRate\": 3.43,\n \"creditNoteDate\": \"2021-09-01\",\n \"referenceNo\": \"123\",\n \"creditNoteNumber\": \"123\",\n \"note\": \"123\",\n \"termsConditions\": \"123\",\n \"open\": false,\n \"warehouseId\": 1,\n \"branchId\": 1,\n \"entries\": [\n {\n \"itemId\": 1,\n \"quantity\": 1,\n \"rate\": 10,\n \"taxRateId\": 1\n }\n ],\n \"pdfTemplateId\": 1,\n \"discount\": 10,\n \"discountType\": \"percentage\"\n}"
response = http.request(request)
puts response.read_bodyHeaders
Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.
Example:
"Bearer bc_1234567890abcdef"
Required if Authorization is a JWT token. The organization ID to operate within.
Path Parameters
Credit note ID
Body
application/json
The customer ID
Example:
1
The exchange rate
Example:
3.43
The credit note date
Example:
"2021-09-01"
The reference number
Example:
"123"
The credit note number
Example:
"123"
The note
Example:
"123"
The terms and conditions
Example:
"123"
The credit note is open
Example:
false
The warehouse ID
Example:
1
The branch ID
Example:
1
The credit note entries
Example:
[
{
"itemId": 1,
"quantity": 1,
"rate": 10,
"taxRateId": 1
}
]
The pdf template ID
Example:
1
The discount amount
Example:
10
The discount type
Available options:
percentage, amount Example:
"percentage"
Response
Credit note successfully updated
⌘I