Get Document
curl --request GET \
--url http://localhost:8000/documents/{document_id}import requests
url = "http://localhost:8000/documents/{document_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:8000/documents/{document_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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/documents/{document_id}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"establishment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emission_point_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_type": "<string>",
"sequential": 123,
"access_key": "<string>",
"status": "<string>",
"idempotency_key": "<string>",
"issue_date": "2023-12-25",
"subtotal": "<string>",
"total_discount": "<string>",
"total_tax": "<string>",
"total": "<string>",
"buyer_id_type": "<string>",
"buyer_id": "<string>",
"buyer_name": "<string>",
"buyer_email": "<string>",
"buyer_address": "<string>",
"modified_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modified_document_type": "<string>",
"modified_document_number": "<string>",
"modified_document_issue_date": "2023-12-25",
"reason": "<string>",
"authorization_number": "<string>",
"authorization_date": "2023-11-07T05:31:56Z",
"sri_environment": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"available_actions": {
"can_edit": true,
"can_submit": true,
"can_cancel": true,
"can_retry": true,
"can_reconcile": true,
"can_mark_failed": true,
"can_resend_email": true,
"can_create_credit_note": true
},
"cancellation_info": {
"requested_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z"
},
"artifacts": {
"xml_url": "<string>",
"pdf_url": "<string>",
"ride_url": "<string>"
},
"sri_response": {
"reception_state": "<string>",
"authorization_state": "<string>",
"authorization_number": "<string>",
"authorization_date": "2023-11-07T05:31:56Z",
"messages": [
{
"identifier": "<string>",
"message": "<string>",
"additional_info": "<string>",
"message_type": "<string>"
}
]
},
"job_status": {
"last_attempt_at": "2023-11-07T05:31:56Z",
"next_retry_at": "2023-11-07T05:31:56Z",
"attempt_count": 123,
"worker_id": "<string>"
},
"related_documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_type": "<string>",
"sequential": 123,
"access_key": "<string>",
"status": "<string>",
"relationship": "<string>"
}
],
"status_history": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_status": "<string>",
"new_status": "<string>",
"changed_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changed_by_worker_id": "<string>",
"detail": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_number": 123,
"description": "<string>",
"main_code": "<string>",
"aux_code": "<string>",
"quantity": "<string>",
"unit_price": "<string>",
"discount": "<string>",
"subtotal": "<string>",
"tax_code": "<string>",
"tax_rate_code": "<string>"
}
],
"taxes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tax_code": "<string>",
"tax_rate_code": "<string>",
"taxable_base": "<string>",
"rate": "<string>",
"tax_amount": "<string>"
}
],
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_number": 123,
"payment_method_code": "<string>",
"total": "<string>",
"term": 123,
"time_unit": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}documents
Get Document
Retrieve the current state of a Document with full detail.
Returns the document with its current status, authorization information, available actions, artifacts, SRI response, job status, related documents, and complete status history.
RLS ensures the document belongs to the active tenant; an explicit tenant_id filter is added as a defence-in-depth measure.
GET
/
documents
/
{document_id}
Get Document
curl --request GET \
--url http://localhost:8000/documents/{document_id}import requests
url = "http://localhost:8000/documents/{document_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:8000/documents/{document_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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/documents/{document_id}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"establishment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emission_point_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_type": "<string>",
"sequential": 123,
"access_key": "<string>",
"status": "<string>",
"idempotency_key": "<string>",
"issue_date": "2023-12-25",
"subtotal": "<string>",
"total_discount": "<string>",
"total_tax": "<string>",
"total": "<string>",
"buyer_id_type": "<string>",
"buyer_id": "<string>",
"buyer_name": "<string>",
"buyer_email": "<string>",
"buyer_address": "<string>",
"modified_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modified_document_type": "<string>",
"modified_document_number": "<string>",
"modified_document_issue_date": "2023-12-25",
"reason": "<string>",
"authorization_number": "<string>",
"authorization_date": "2023-11-07T05:31:56Z",
"sri_environment": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"available_actions": {
"can_edit": true,
"can_submit": true,
"can_cancel": true,
"can_retry": true,
"can_reconcile": true,
"can_mark_failed": true,
"can_resend_email": true,
"can_create_credit_note": true
},
"cancellation_info": {
"requested_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z"
},
"artifacts": {
"xml_url": "<string>",
"pdf_url": "<string>",
"ride_url": "<string>"
},
"sri_response": {
"reception_state": "<string>",
"authorization_state": "<string>",
"authorization_number": "<string>",
"authorization_date": "2023-11-07T05:31:56Z",
"messages": [
{
"identifier": "<string>",
"message": "<string>",
"additional_info": "<string>",
"message_type": "<string>"
}
]
},
"job_status": {
"last_attempt_at": "2023-11-07T05:31:56Z",
"next_retry_at": "2023-11-07T05:31:56Z",
"attempt_count": 123,
"worker_id": "<string>"
},
"related_documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_type": "<string>",
"sequential": 123,
"access_key": "<string>",
"status": "<string>",
"relationship": "<string>"
}
],
"status_history": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_status": "<string>",
"new_status": "<string>",
"changed_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changed_by_worker_id": "<string>",
"detail": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"lines": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_number": 123,
"description": "<string>",
"main_code": "<string>",
"aux_code": "<string>",
"quantity": "<string>",
"unit_price": "<string>",
"discount": "<string>",
"subtotal": "<string>",
"tax_code": "<string>",
"tax_rate_code": "<string>"
}
],
"taxes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tax_code": "<string>",
"tax_rate_code": "<string>",
"taxable_base": "<string>",
"rate": "<string>",
"tax_amount": "<string>"
}
],
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_number": 123,
"payment_method_code": "<string>",
"total": "<string>",
"term": 123,
"time_unit": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Cookies
Response
Successful Response
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes