Skip to main content
POST
Create Document Draft

Headers

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

Cookies

factio_access_token
string | null

Body

application/json

Schema for creating a document (invoice, credit note, etc.).

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
issue_date
string<date>
required
subtotal
required

Subtotal before taxes and discounts

Required range: x >= 0
total_tax
required

Total tax amount

Required range: x >= 0
total
required

Total amount (subtotal - discount + tax)

Required range: x >= 0
lines
DocumentLineCreate · object[]
required

Document line items

Minimum array length: 1
taxes
DocumentTaxCreate · object[]
required

Document tax entries

Minimum array length: 1
numeric_code
string
required

8-digit numeric code for access key generation

Required string length: 8
Pattern: ^\d{8}$
total_discount
default:0.00

Total discount amount

Required range: x >= 0
buyer_id_type
string | null

Buyer identification type (RUC, cedula, passport, etc.)

Maximum string length: 10
buyer_id
string | null

Buyer identification number

Maximum string length: 20
buyer_name
string | null

Buyer name

Maximum string length: 300
buyer_email
string | null

Buyer email address

Maximum string length: 255
buyer_address
string | null

Buyer address

Maximum string length: 500
modified_document_id
string<uuid> | null

Original document referenced by this document

modified_document_type
string | null

SRI type code of the modified document

Maximum string length: 2
modified_document_number
string | null

Formatted document number of the modified document

Maximum string length: 20
modified_document_issue_date
string<date> | null

Issue date of the modified document

reason
string | null

Reason for the document, mainly required for credit notes

Maximum string length: 500
idempotency_key
string | null

Client-provided idempotency key to prevent duplicate submissions

Maximum string length: 255
payments
DocumentPaymentCreate · object[]

SRI payment method entries

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[]