curl --request POST \
--url https://api.nocotax.app/credit_notes/{id}/attach_credit \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.nocotax.app/credit_notes/{id}/attach_credit"
payload = {}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.nocotax.app/credit_notes/{id}/attach_credit', 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.nocotax.app/credit_notes/{id}/attach_credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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.nocotax.app/credit_notes/{id}/attach_credit"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://api.nocotax.app/credit_notes/{id}/attach_credit")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nocotax.app/credit_notes/{id}/attach_credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "cn_1792060749cx1x66f4b3d5",
"livemode": false,
"object": "credit_note",
"amount_to_credit": 2888,
"amount_overcredited": 0,
"amount_credited": 900,
"amount_post_payment": 2888,
"amount_pre_payment": 0,
"amount_remaining": 1988,
"automatic_tax_calculation": {
"enabled": false
},
"credit_status": "to_credit",
"currency": "EUR",
"customer_data": {
"name": "Schuster Group",
"billing_address": {
"city": "Traciebury",
"line1": "6128 Graig Motorway",
"line2": "Suite 792",
"country": "SI",
"postal_code": "00898-4009"
},
"tax_identification_number": "358255008",
"business_registration_number": "09404782600204"
},
"customer_id": "org_1792060749bbdrea0b2eb1",
"customer_tax_registration_data": [],
"customer_tax_registration_ids": [],
"document_date": "2026-10-15",
"document_number": "CN00001",
"flow": "sales",
"invoice_id": null,
"issuer": null,
"legal_notices": null,
"locale": "en",
"memo": null,
"metadata": {},
"numbering_sequence_id": "ns_1792060749b5j09867df54",
"order_reference": null,
"period": null,
"representations": {
"hosted_page_url": "https://repo.nocotax.test:3000/credit_notes/OucGq8Ai9LsHYeuWeB1QntSCwShAcuaRu_06_ZB4thI",
"pdf_file_url": "https://repo.nocotax.test:3000/credit_notes/OucGq8Ai9LsHYeuWeB1QntSCwShAcuaRu_06_ZB4thI/pdf"
},
"status": "finalized",
"status_transitions": {
"finalized_at": "2026-10-15T12:39:09.619+02:00"
},
"supplier_country": "KM",
"supplier_data": {
"name": "Smith-Medhurst",
"billing_address": {
"city": "South Bernarda",
"line1": "7593 Effertz Rapids",
"line2": "Suite 637",
"country": "KM",
"postal_code": "82701"
},
"tax_identification_number": "561354234",
"business_registration_number": "39698604400339"
},
"supplier_id": "org_1792060749ay2m25e21425",
"supplier_tax_registration_data": [],
"supplier_tax_registration_ids": [],
"taxes": [],
"total_extratax_amount": 2888,
"total_tax_amount": 0,
"total_tax_included_amount": 2888,
"created_at": "2026-10-15T10:39:09.610Z",
"updated_at": "2026-10-15T10:39:10.517Z"
}Attach a credit
Attachs a credit (financial movement or balance transaction) to a finalized and to_credit credit note, updating its credit status and remaining amount.
This endpoint allows you to associate a credit transaction with a specific credit note. Depending on the provided transaction_data, it adjusts the credit_note’s amount_credited, amount_remaining and updates its credit status.
If transaction_data is provided: The transaction is attached to the credit note, and the amount_remaining is reduced by the transaction amount. If the transaction amount covers the remaining balance, the credit note is marked as fully credited.
If transaction_data is not provided: The system assumes the credit is for the full amount_remaining of the credit note. The credit note is automatically marked as credited, and the amount_remaining is set to zero.
curl --request POST \
--url https://api.nocotax.app/credit_notes/{id}/attach_credit \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.nocotax.app/credit_notes/{id}/attach_credit"
payload = {}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.nocotax.app/credit_notes/{id}/attach_credit', 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.nocotax.app/credit_notes/{id}/attach_credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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.nocotax.app/credit_notes/{id}/attach_credit"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://api.nocotax.app/credit_notes/{id}/attach_credit")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nocotax.app/credit_notes/{id}/attach_credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "cn_1792060749cx1x66f4b3d5",
"livemode": false,
"object": "credit_note",
"amount_to_credit": 2888,
"amount_overcredited": 0,
"amount_credited": 900,
"amount_post_payment": 2888,
"amount_pre_payment": 0,
"amount_remaining": 1988,
"automatic_tax_calculation": {
"enabled": false
},
"credit_status": "to_credit",
"currency": "EUR",
"customer_data": {
"name": "Schuster Group",
"billing_address": {
"city": "Traciebury",
"line1": "6128 Graig Motorway",
"line2": "Suite 792",
"country": "SI",
"postal_code": "00898-4009"
},
"tax_identification_number": "358255008",
"business_registration_number": "09404782600204"
},
"customer_id": "org_1792060749bbdrea0b2eb1",
"customer_tax_registration_data": [],
"customer_tax_registration_ids": [],
"document_date": "2026-10-15",
"document_number": "CN00001",
"flow": "sales",
"invoice_id": null,
"issuer": null,
"legal_notices": null,
"locale": "en",
"memo": null,
"metadata": {},
"numbering_sequence_id": "ns_1792060749b5j09867df54",
"order_reference": null,
"period": null,
"representations": {
"hosted_page_url": "https://repo.nocotax.test:3000/credit_notes/OucGq8Ai9LsHYeuWeB1QntSCwShAcuaRu_06_ZB4thI",
"pdf_file_url": "https://repo.nocotax.test:3000/credit_notes/OucGq8Ai9LsHYeuWeB1QntSCwShAcuaRu_06_ZB4thI/pdf"
},
"status": "finalized",
"status_transitions": {
"finalized_at": "2026-10-15T12:39:09.619+02:00"
},
"supplier_country": "KM",
"supplier_data": {
"name": "Smith-Medhurst",
"billing_address": {
"city": "South Bernarda",
"line1": "7593 Effertz Rapids",
"line2": "Suite 637",
"country": "KM",
"postal_code": "82701"
},
"tax_identification_number": "561354234",
"business_registration_number": "39698604400339"
},
"supplier_id": "org_1792060749ay2m25e21425",
"supplier_tax_registration_data": [],
"supplier_tax_registration_ids": [],
"taxes": [],
"total_extratax_amount": 2888,
"total_tax_amount": 0,
"total_tax_included_amount": 2888,
"created_at": "2026-10-15T10:39:09.610Z",
"updated_at": "2026-10-15T10:39:10.517Z"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
id
Body
If provided, the type of payment that should be attached to the invoice, and its characteristics.
Show child attributes
Show child attributes
Response
successful
The amount to credit at the time the credit note is finalized, in the currency's smaller unit (eg. cents)
If the amount of transactions attached to this credit note exceed its amount to credit, the amount overcredited, in the currency's smaller unit (eg. cents)
The amount that has been credited, in the currency's smaller unit (eg. cents)
The amount that will need to be credited to the customer
If attached to an invoice, the amount by which the corresponding invoice amount_remaining is reduced
The amount still to credit, in the currency's smaller unit (eg. cents)
When automatic tax calculation is enabled, Nocotax automatically determines which tax rates must be applied to each item sold within the document.
Show child attributes
Show child attributes
The credit status of the credit note. to_credit: The credit note has an amount that needs to be credited to the customer. credited: This credit note has been totally credited to the customer.
to_credit, credited The currency ISO code of the document
Show child attributes
Show child attributes
The ID of the organization this document refers as a customer
The customer’s tax registration data. They are displayed on the PDF of the document, and may be used for automatic tax calculation if enabled.
Show child attributes
Show child attributes
The customer’s tax registration IDs.
The date of issuance of this document. Its value is null when the document status is draft
The number of this document. Its value is null when the document status is draft
If the issuer of the document is not the supplier (in case of white-label or self billing), information on the issuer
Show child attributes
Show child attributes
Specifies the direction or role of the account owner in the invoicing transaction.
sales: The account owner is the supplier (i.e., the entity issuing the document for goods or services provided).
purchases: The account owner is the customer (i.e., the entity receiving the document for goods or services purchased).
platform: The account owner is a facilitator (i.e., the entity enabling the transaction between a customer and a supplier, such as a marketplace or intermediary).
sales, purchases, platform If this credit note refers to an invoice, the ID of this invoice.
A text representing a legal notice to display on document representations
The locale used for this credit note representations (PDF)
Document memo
The ID of the numbering sequence this document is using to generate its number at finalization
The period associated with this document. Used to recognize and defer revenue
Show child attributes
Show child attributes
After finalization of a document, you can share its representations to whoever you want. This is a set of URLs you can share.
Show child attributes
Show child attributes
The status of the document, one of draft, finalized, cancelled
draft, finalized, cancelled Show child attributes
Show child attributes
The country (ISO alpha 2) of the country of issuance of the document
Show child attributes
Show child attributes
The ID of the organization this document refers as a supplier
The supplier's tax registration data. They are displayed on the PDF of the document, and may be used for automatic tax calculation if enabled.
Show child attributes
Show child attributes
The customer’s tax registration IDs.
The document's tax breakdown
Show child attributes
Show child attributes
Total extratax amount of the document, in the currency's smaller unit (eg. cents)
Total tax amount of the document, in the currency's smaller unit (eg. cents)
Total tax included of the document, in the currency's smaller unit (eg. cents)
