curl --request POST \
--url https://api.nocotax.app/invoices/{id}/attach_payment \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.nocotax.app/invoices/{id}/attach_payment"
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/invoices/{id}/attach_payment', 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/invoices/{id}/attach_payment",
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/invoices/{id}/attach_payment"
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/invoices/{id}/attach_payment")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nocotax.app/invoices/{id}/attach_payment")
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": "inv_1792060766conn54eeae7b",
"livemode": false,
"object": "invoice",
"amount_due": 2888,
"amount_overpaid": 0,
"amount_paid": 900,
"amount_remaining": 1988,
"automatic_tax_calculation": {
"enabled": false
},
"currency": "EUR",
"customer_data": {
"name": "Braun-Roberts",
"billing_address": {
"city": "Nienowbury",
"line1": "1542 Haley Avenue",
"line2": "Suite 844",
"country": "RS",
"postal_code": "22513"
},
"tax_identification_number": "506111905",
"business_registration_number": "07304599900007"
},
"customer_id": "org_1792060766b51z521094b2",
"customer_tax_registration_data": [],
"customer_tax_registration_ids": [],
"document_date": "2026-10-15",
"document_number": "INV00001",
"due_date": "2026-10-15",
"flow": "sales",
"issuer": null,
"legal_notices": null,
"locale": "en",
"memo": null,
"metadata": {},
"numbering_sequence_id": "ns_1792060766avzh2319dea7",
"order_reference": null,
"payment_status": "due",
"payment_terms": null,
"period": null,
"postpayment_credit_notes_amount": 0,
"prepayment_credit_notes_amount": 0,
"representations": {
"hosted_page_url": "https://repo.nocotax.test:3000/invoices/X0996iwnT9hU056FKCe-WrX2VhYIjnII5bUDUZiitCY",
"pdf_file_url": "https://repo.nocotax.test:3000/invoices/X0996iwnT9hU056FKCe-WrX2VhYIjnII5bUDUZiitCY/pdf"
},
"status": "finalized",
"status_transitions": {
"finalized_at": "2026-10-15T12:39:26.606+02:00"
},
"supplier_country": "AX",
"supplier_data": {
"name": "Ziemann, Abernathy and Predovic",
"billing_address": {
"city": "South Guillermina",
"line1": "58077 Koelpin Station",
"line2": "Suite 946",
"country": "AX",
"postal_code": "06429-2874"
},
"tax_identification_number": "006547814",
"business_registration_number": "93823292300921"
},
"supplier_id": "org_1792060766arerefe44604",
"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:26.597Z",
"updated_at": "2026-10-15T10:39:27.451Z"
}Attach a payment
Attachs a payment (financial movement or balance transaction) to a finalized and unpaid invoice, updating its payment status and remaining amount.
This endpoint allows you to associate a payment transaction with a specific invoice. Depending on the provided transaction_data, it adjusts the invoice’s amount_paid, amount_remaining and updates its payment status.
If transaction_data is provided: The transaction is attached to the invoice, and the amount_remaining is reduced by the transaction amount. If the transaction amount covers the remaining balance, the invoice is marked as fully paid.
If transaction_data is not provided: The system assumes the payment is for the full amount_remaining of the invoice. The invoice is automatically marked as paid, and the amount_remaining is set to zero.
curl --request POST \
--url https://api.nocotax.app/invoices/{id}/attach_payment \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.nocotax.app/invoices/{id}/attach_payment"
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/invoices/{id}/attach_payment', 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/invoices/{id}/attach_payment",
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/invoices/{id}/attach_payment"
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/invoices/{id}/attach_payment")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nocotax.app/invoices/{id}/attach_payment")
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": "inv_1792060766conn54eeae7b",
"livemode": false,
"object": "invoice",
"amount_due": 2888,
"amount_overpaid": 0,
"amount_paid": 900,
"amount_remaining": 1988,
"automatic_tax_calculation": {
"enabled": false
},
"currency": "EUR",
"customer_data": {
"name": "Braun-Roberts",
"billing_address": {
"city": "Nienowbury",
"line1": "1542 Haley Avenue",
"line2": "Suite 844",
"country": "RS",
"postal_code": "22513"
},
"tax_identification_number": "506111905",
"business_registration_number": "07304599900007"
},
"customer_id": "org_1792060766b51z521094b2",
"customer_tax_registration_data": [],
"customer_tax_registration_ids": [],
"document_date": "2026-10-15",
"document_number": "INV00001",
"due_date": "2026-10-15",
"flow": "sales",
"issuer": null,
"legal_notices": null,
"locale": "en",
"memo": null,
"metadata": {},
"numbering_sequence_id": "ns_1792060766avzh2319dea7",
"order_reference": null,
"payment_status": "due",
"payment_terms": null,
"period": null,
"postpayment_credit_notes_amount": 0,
"prepayment_credit_notes_amount": 0,
"representations": {
"hosted_page_url": "https://repo.nocotax.test:3000/invoices/X0996iwnT9hU056FKCe-WrX2VhYIjnII5bUDUZiitCY",
"pdf_file_url": "https://repo.nocotax.test:3000/invoices/X0996iwnT9hU056FKCe-WrX2VhYIjnII5bUDUZiitCY/pdf"
},
"status": "finalized",
"status_transitions": {
"finalized_at": "2026-10-15T12:39:26.606+02:00"
},
"supplier_country": "AX",
"supplier_data": {
"name": "Ziemann, Abernathy and Predovic",
"billing_address": {
"city": "South Guillermina",
"line1": "58077 Koelpin Station",
"line2": "Suite 946",
"country": "AX",
"postal_code": "06429-2874"
},
"tax_identification_number": "006547814",
"business_registration_number": "93823292300921"
},
"supplier_id": "org_1792060766arerefe44604",
"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:26.597Z",
"updated_at": "2026-10-15T10:39:27.451Z"
}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 due at the time the invoice is finalized, in the currency's smaller unit (eg. cents)
If the amount of transactions attached to this invoice exceed its final amount, the amount overpaid, in the currency's smaller unit (eg. cents)
The amount that has been paid, in the currency's smaller unit (eg. cents)
The amount still due, 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 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
The date on which payment for this invoice is due
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 A text representing a legal notice to display on document representations
The locale used for this invoice representations (PDF)
Document memo
The ID of the numbering sequence this document is using to generate its number at finalization
The status of the invoice payment. open: The invoice has not been paid, but the due date is in the future. due: A payment for the total or a part of this invoice is expected. paid: This invoice has been paid.
open, due, paid Payment terms for this invoice. Represent the number of days after finalization so the invoice is due. Do not provide along with due_date
Show child attributes
Show child attributes
The period associated with this document. Used to recognize and defer revenue
Show child attributes
Show child attributes
Sum of amounts of all post-payment credit notes issued for this invoice
Sum of amounts of all pre-payment credit notes issued for this invoice
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)
