---
title: "Criar Cabeçalho de Documentos de Venda"
method: POST
path: "/api/commercial_sales_documents"
tags: ["Versões Anteriores", "Vendas1", "Documentos de Venda1"]
---

# Criar Cabeçalho de Documentos de Venda

`POST /api/commercial_sales_documents`

| Atributo | Descrição | Opcional |
| --- | --- | --- |
| document_type | Tipo de documento. "FT": fatura, "FS": fatura simplificada, "FR": fatura-recibo. | Não |
| date | Data do documento; por omissão, a data do pedido. | Sim |
| document_series_prefix | Em alternativa ao campo "document_series_id". | Sim |
| customer_tax_registration_number | NIF do cliente. se o cliente com o NIF indicado não existir, será criado automaticamente. | Sim |
| customer_business_name | Nome do cliente. | Não |
| customer_address_detail | Morada do cliente. | Sim |
| customer_postcode | Código postal do cliente, no formato 0000-000. | Sim |
| customer_city | Cidade/Localidade do cliente. | Sim |
| customer_country | País do cliente. Por omissão, "PT"; é o código ISO alpha-2 do país do cliente. | Sim |
| customer_id | No caso do cliente já existir e não pretender criar um novo. | Sim |
| due_date | Data de vencimento; por omissão, a data do documento, ou a referente ao prazo de pagamento configurado no cliente. | Sim |
| settlement_expression | Desconto no cabeçalho, em percentagem; são suportados descontos compostos, como "3+5" | Sim |
| payment_mechanism | Modos de pagamento aceites. | Sim |
| vat_included_prices | Os preços nas linhas são com IVA incluído? Por omissão, não (false). | Sim |
| operation_country | A região de operação para efeitos de IVA. | Sim |
| currency_iso_code | É o código ISO da moeda do documento. | Sim |
| currency_conversion_rate | É a taxa de conversão para EUR. | Sim |
| retention | Percentagem de retenção a aplicar sobre os serviços. | Sim |
| retention_type | Tipo de retenção ("IRS" ou "IRC"). Por omissão, "IRS". | Sim |
| apply_retention_when_paid | A retenção é feita logo no documento (false) ou apenas no recebimento (true). Por omissão, false. | Sim |
| notes | Notas ao documento. | Sim |
| external_reference | Referência do documento externo. | Sim |

## Request body

- object
  - `data` object
    - `attributes` object
      - `apply_retention_when_paid` boolean
      - `currency_conversion_rate` number
      - `currency_iso_code` string
      - `customer_id` number
      - `date` string
      - `document_type` string
      - `due_date` string
      - `external_reference` string
      - `notes` string
      - `operation_country` string
      - `payment_mechanism` string
      - `retention` number
      - `retention_type` string
      - `settlement_expression` string
      - `vat_included_prices` boolean
    - `type` string

## Response `200`

Sucesso

- object
  - `data` object
    - `attributes` object
      - `acts_as_shipment_document` boolean
      - `apply_retention_when_paid` boolean
      - `base_currency_conversion_difference` unknown
      - `base_currency_gross_total` unknown
      - `base_currency_net_total` unknown
      - `base_currency_other_retentions` unknown
      - `base_currency_other_taxes_total` unknown
      - `base_currency_pending_total` unknown
      - `base_currency_retention_aware_gross_total` unknown
      - `base_currency_retention_total` unknown
      - `base_currency_settlement_total` unknown
      - `base_currency_tax_payable` unknown
      - `base_currency_vat_incidence_int` unknown
      - `base_currency_vat_incidence_ise` unknown
      - `base_currency_vat_incidence_nor` unknown
      - `base_currency_vat_incidence_red` unknown
      - `base_currency_vat_total_int` unknown
      - `base_currency_vat_total_nor` unknown
      - `base_currency_vat_total_red` unknown
      - `cashed_vat` boolean
      - `child_documents_ids` unknown
      - `communication_code` unknown
      - `communication_code_source` string
      - `communication_status` string
      - `created_at` string
      - `currency_amount` unknown
      - `currency_conversion_rate` number
      - `currency_iso_code` string
      - `customer_address_detail` string
      - `customer_business_name` string
      - `customer_city` string
      - `customer_country` string
      - `customer_postcode` string
      - `customer_tax_country_region` string
      - `customer_tax_registration_number` string
      - `date` string
      - `description` unknown
      - `document_area` string
      - `document_hash_sum` unknown
      - `document_no` unknown
      - `document_series_no` unknown
      - `document_series_prefix` string
      - `document_type` string
      - `due_date` string
      - `due_days` unknown
      - `email_readed` boolean
      - `emailed` unknown
      - `end_date` unknown
      - `expected_shipment_unloading_time` unknown
      - `expired` unknown
      - `external_reference` string
      - `fulfilled_mask` number
      - `gross_total` number
      - `hash_control` unknown
      - `invoice_counter` unknown
      - `is_active` unknown
      - `is_document_to_self` boolean
      - `is_invoice_receipt` unknown
      - `is_receipt` unknown
      - `is_third_party` boolean
      - `issue_finalized` unknown
      - `line_settlement_with_tax` number
      - `line_settlement_with_tax_unrounded` number
      - `line_settlement_without_tax` number
      - `line_settlement_without_tax_unrounded` number
      - `made_available_to` boolean
      - `manual_registration_number` string
      - `manual_registration_series` string
      - `manual_registration_type` unknown
      - `net_settlement_total` unknown
      - `net_total` number
      - `notes` string
      - `operation_country` string
      - `other_retentions` number
      - `other_taxes_total` number
      - `parent_document_area` unknown
      - `parent_document_reference` string
      - `parent_document_type` unknown
      - `parent_documents_ids` unknown
      - `payment_mechanism` string
      - `pending_retention_value` number
      - `pending_total` number
      - `periodicity` unknown
      - `periodicity_type` unknown
      - `printed` unknown
      - `public_link` string
      - `receipts_ids` unknown
      - `reference` unknown
      - `reference_document_type` unknown
      - `required_mask` number
      - `retention` number
      - `retention_aware_gross_total` number
      - `retention_type` string
      - `retention_value` number
      - `retention_value_unrounded` number
      - `scheduled_description` unknown
      - `scheduled_end_date` unknown
      - `scheduled_interval` unknown
      - `scheduled_invoice_id` unknown
      - `scheduled_start_date` unknown
      - `send_email` unknown
      - `settlement` unknown
      - `settlement_expression` string
      - `settlement_percentage` number
      - `settlement_total` number
      - `settlement_with_tax` number
      - `settlement_with_tax_unrounded` number
      - `settlement_without_tax` number
      - `settlement_without_tax_unrounded` number
      - `shipment_address_detail` unknown
      - `shipment_city` unknown
      - `shipment_country` unknown
      - `shipment_from_address_detail` unknown
      - `shipment_from_city` unknown
      - `shipment_from_country` unknown
      - `shipment_from_postcode` unknown
      - `shipment_loading_time` unknown
      - `shipment_postcode` unknown
      - `sort_status` number
      - `start_date` unknown
      - `status` number
      - `system_entry_date` unknown
      - `tax_payable` number
      - `third_party_type` number
      - `total_pending_quantity` unknown
      - `updated_at` string
      - `vat_incidence_int` number
      - `vat_incidence_int_unrounded` number
      - `vat_incidence_ise` number
      - `vat_incidence_ise_unrounded` number
      - `vat_incidence_nor` number
      - `vat_incidence_nor_unrounded` number
      - `vat_incidence_red` number
      - `vat_incidence_red_unrounded` number
      - `vat_included_prices` boolean
      - `vat_percentage_int` unknown
      - `vat_percentage_nor` unknown
      - `vat_percentage_red` unknown
      - `vat_total_int` number
      - `vat_total_int_unrounded` number
      - `vat_total_nor` number
      - `vat_total_nor_unrounded` number
      - `vat_total_red` number
      - `vat_total_red_unrounded` number
      - `vehicle_registration` unknown
      - `voided_reason` unknown
    - `id` string
    - `relationships` object
      - `bank_accounts` object
        - `data` unknown
      - `cash_accounts` object
        - `data` unknown
      - `commercial_document_series` object
        - `data` object
          - `id` string
          - `type` string
      - `company` object
        - `data` object
          - `id` string
          - `type` string
      - `currency` object
        - `data` object
          - `id` string
          - `type` string
      - `customer` object
        - `data` object
          - `id` string
          - `type` string
      - `lines` object
        - `data` unknown[]
          - unknown
      - `tax_exemption_reasons` object
        - `data` unknown
      - `user` object
        - `data` object
          - `id` string
          - `type` string
    - `type` string
  - `meta` object
    - `observed` object
      - `scalar` number

---

[API](https://skmtc.net/toconline/apis/toconline-open-api.md) · [All operations](https://skmtc.net/toconline/apis/toconline-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/toconline/toconline-open-api/revisions/2c51a28d0f48/schema)
