Skip to main content
PATCH
/
documents
/
{document_id}
/
draft
Patch Document Draft Endpoint
curl --request PATCH \
  --url http://localhost:8000/documents/{document_id}/draft \
  --header 'Content-Type: application/json' \
  --data '
{
  "lines": [
    {
      "line_number": 123,
      "description": "<string>",
      "quantity": 123,
      "unit_price": 123,
      "discount": 123,
      "subtotal": 123,
      "tax_rate_code": "<string>",
      "main_code": "<string>",
      "aux_code": "<string>",
      "tax_code": "2"
    }
  ],
  "taxes": [
    {
      "tax_code": "<string>",
      "tax_rate_code": "<string>",
      "taxable_base": 123,
      "rate": 123,
      "tax_amount": 123
    }
  ],
  "subtotal": 123,
  "total_discount": 123,
  "total_tax": 123,
  "total": 123
}
'
{
  "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",
  "sequential": 123,
  "access_key": "<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",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "payments": []
}

Headers

authorization
string | null
x-api-key
string | null
x-tenant-id
string | null

Path Parameters

document_id
string<uuid>
required

Cookies

factio_access_token
string | null

Body

application/json
lines
DraftLineInput · object[]
required
taxes
DraftTaxInput · object[]
required
subtotal
required
total_discount
required
total_tax
required
total
required

Response

Successful Response

Schema for Document response — current state and authorization info.

id
string<uuid>
required
tenant_id
string<uuid>
required
issuer_id
string<uuid>
required
establishment_id
string<uuid>
required
emission_point_id
string<uuid>
required
document_type
enum<string>
required

Types of fiscal documents supported by the SRI.

Available options:
01,
04,
05,
06,
07
sequential
integer | null
required
access_key
string | null
required
status
enum<string>
required

Status values for document lifecycle.

Available options:
DRAFT,
VALIDATED,
NUMBER_RESERVED,
XML_GENERATED,
SIGNED,
RECEPTION_PENDING,
SUBMITTED_TO_SRI,
RECEIVED_BY_SRI,
AUTHORIZATION_PENDING,
AUTHORIZED,
REJECTED,
RECEPTION_RETRY_SCHEDULED,
AUTHORIZATION_RETRY_SCHEDULED,
RECEPTION_UNKNOWN,
AUTHORIZATION_UNKNOWN,
MANUAL_REVIEW_REQUIRED,
FAILED_PERMANENT,
CANCELLATION_REQUESTED,
CANCELLED,
VOIDED_BY_NC
idempotency_key
string | null
required
issue_date
string<date>
required
subtotal
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
total_discount
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
total_tax
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
total
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
buyer_id_type
string | null
required
buyer_id
string | null
required
buyer_name
string | null
required
buyer_email
string | null
required
buyer_address
string | null
required
modified_document_id
string<uuid> | null
required
modified_document_type
string | null
required
modified_document_number
string | null
required
modified_document_issue_date
string<date> | null
required
reason
string | null
required
authorization_number
string | null
required
authorization_date
string<date-time> | null
required
sri_environment
enum<string>
required

SRI environment types.

Available options:
TEST,
PRODUCTION
created_at
string<date-time>
required
updated_at
string<date-time>
required
payments
DocumentPaymentResponse · object[]