For the complete documentation index, see llms.txt. This page is also available as Markdown.

Documentos de venda

As rotas aqui descritas permitem gerir todos os processos relativos a documentos de venda — orçamentos, faturas-proforma, guias, faturas e notas —, incluindo a sua descarga em PDF.

Os documentos de venda na versão v1 da API têm a mesma estrutura anteriormente descrita para a v0: são compostos por um cabeçalho e uma ou mais linhas. Nesta nova versão, é possível criar ambos num só pedido, descrito de seguida.

Criação do documento

post
Body
document_typestringRequiredExample: FT|FS|FR
datestringOptionalExample: 2023-01-01
document_series_idintegerOptionalExample: 1
document_series_prefixstringOptionalExample: Prefixo da série
customer_idintegerOptionalExample: 1
customer_tax_registration_numberstringOptionalExample: 999999990
customer_business_namestringOptionalExample: Nome do cliente
customer_address_detailstringOptionalExample: Morada do cliente
customer_postcodestringOptionalExample: 0000-000
customer_citystringOptionalExample: Cidade/Localidade do cliente
customer_countrystringOptionalExample: PT
due_datestringOptionalExample: 2023-01-01
settlement_expressionstringOptionalExample: 7.5
payment_mechanismstringOptionalExample: MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA
bank_account_idintegerOptionalExample: 1
cash_account_idintegerOptionalExample: 1
vat_included_pricesbooleanOptionalExample: false
tax_exemption_reason_idintegerOptionalExample: 1
operation_countrystringOptionalExample: PT-MA
currency_idintegerOptionalExample: 1
currency_iso_codestringOptionalExample: USD
currency_conversion_ratenumberOptionalExample: 1.21
retentionnumberOptionalExample: 7.5
retention_typestringOptionalExample: IRS|IRC
apply_retention_when_paidbooleanOptionalExample: true
notesstringOptionalExample: Notas ao documento
external_referencestringOptionalExample: Referência do documento externo
finalizebooleanOptionalExample: true
return_pdfbooleanOptionalExample: true
Responses
200

OK

application/json
idintegerOptionalExample: 1
document_typestringOptionalExample: FT|FS|FR
datestringOptionalExample: 2023-01-01
document_series_idintegerOptionalExample: 1
document_series_prefixstringOptionalExample: Prefixo da série
customer_idintegerOptionalExample: 1
customer_tax_registration_numberstringOptionalExample: 999999990
customer_business_namestringOptionalExample: Nome do cliente
customer_address_detailstringOptionalExample: Morada do cliente
customer_postcodestringOptionalExample: 0000-000
customer_citystringOptionalExample: Cidade/Localidade do cliente
customer_countrystringOptionalExample: PT
due_datestringOptionalExample: 2023-01-01
settlement_expressionstringOptionalExample: 7.5
payment_mechanismstringOptionalExample: MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA
bank_account_idintegerOptionalExample: 1
cash_account_idintegerOptionalExample: 1
vat_included_pricesbooleanOptionalExample: false
tax_exemption_reason_idintegerOptionalExample: 1
operation_countrystringOptionalExample: PT-MA
currency_idintegerOptionalExample: 1
currency_iso_codestringOptionalExample: USD
currency_conversion_ratenumberOptionalExample: 1.21
retentionnumberOptionalExample: 7.5
retention_typestringOptionalExample: IRS|IRC
apply_retention_when_paidbooleanOptionalExample: true
notesstringOptionalExample: Notas ao documento
external_referencestringOptionalExample: Referência do documento externo
urlstringOptionalExample: https://app.cloudware.pt/path_to_file
post/v1/commercial_sales_documents
POST /v1/commercial_sales_documents HTTP/1.1
Host: api-cwb.cldware.com
Content-Type: application/json
Accept: */*
Content-Length: 1245

{
  "document_type": "FT|FS|FR",
  "date": "2023-01-01",
  "document_series_id": 1,
  "document_series_prefix": "Prefixo da série",
  "customer_id": 1,
  "customer_tax_registration_number": "999999990",
  "customer_business_name": "Nome do cliente",
  "customer_address_detail": "Morada do cliente",
  "customer_postcode": "0000-000",
  "customer_city": "Cidade/Localidade do cliente",
  "customer_country": "PT",
  "due_date": "2023-01-01",
  "settlement_expression": "7.5",
  "payment_mechanism": "MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA",
  "bank_account_id": 1,
  "cash_account_id": 1,
  "vat_included_prices": false,
  "tax_exemption_reason_id": 1,
  "operation_country": "PT-MA",
  "currency_id": 1,
  "currency_iso_code": "USD",
  "currency_conversion_rate": 1.21,
  "retention": 7.5,
  "retention_type": "IRS|IRC",
  "apply_retention_when_paid": true,
  "notes": "Notas ao documento",
  "external_reference": "Referência do documento externo",
  "finalize": true,
  "return_pdf": true,
  "lines": [
    {
      "item_type": "Service|Product|TaxDescriptor",
      "item_id": 1,
      "item_code": "Código do serviço/produto/descritor",
      "description": "Descrição da linha",
      "unit_of_measure_id": 1,
      "unit_of_measure": "Unidade de medida",
      "quantity": 1,
      "unit_price": 9.99,
      "settlement_expression": "3",
      "tax_id": 1,
      "tax_code": "NOR|INT|RED|ISE",
      "tax_percentage": 22,
      "tax_country_region": "PT-MA"
    }
  ]
}
200

OK

{
  "id": 1,
  "document_type": "FT|FS|FR",
  "date": "2023-01-01",
  "document_series_id": 1,
  "document_series_prefix": "Prefixo da série",
  "customer_id": 1,
  "customer_tax_registration_number": "999999990",
  "customer_business_name": "Nome do cliente",
  "customer_address_detail": "Morada do cliente",
  "customer_postcode": "0000-000",
  "customer_city": "Cidade/Localidade do cliente",
  "customer_country": "PT",
  "due_date": "2023-01-01",
  "settlement_expression": "7.5",
  "payment_mechanism": "MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA",
  "bank_account_id": 1,
  "cash_account_id": 1,
  "vat_included_prices": false,
  "tax_exemption_reason_id": 1,
  "operation_country": "PT-MA",
  "currency_id": 1,
  "currency_iso_code": "USD",
  "currency_conversion_rate": 1.21,
  "retention": 7.5,
  "retention_type": "IRS|IRC",
  "apply_retention_when_paid": true,
  "notes": "Notas ao documento",
  "external_reference": "Referência do documento externo",
  "url": "https://app.cloudware.pt/path_to_file",
  "lines": [
    {
      "id": 1,
      "item_type": "Service|Product|TaxDescriptor",
      "item_id": 1,
      "item_code": "Código do serviço/produto/descritor",
      "description": "Descrição da linha",
      "unit_of_measure_id": 1,
      "unit_of_measure": "Unidade de medida",
      "quantity": 1,
      "unit_price": 9.99,
      "settlement_expression": "3",
      "tax_id": 1,
      "tax_code": "NOR|INT|RED|ISE",
      "tax_percentage": 22,
      "tax_country_region": "PT-MA"
    }
  ]
}

O payload JSON a enviar contém a seguinte informação:

  • NOTA 1: A série associada ao documento tem já que existir, e o seu "id" interno pode ser obtido por um

  • NOTA 2: Se o cliente for identificado pelo seu "id" interno tem já que existir, e o seu "id" interno pode ser obtido por um

  • NOTA 3: São também suportados dois "países" adicionais: "PT-AC" (Portugal, Açores) e "PT-MA" (Portugal, Madeira). Os países disponíveis podem ser consultados por um GET /countries, ou um em particular por um

  • NOTA 4: O "id" interno da conta bancária da empresa deve ser obtido por um

  • NOTA 5: O "id" interno da conta de caixa da empresa deve ser obtido por um

  • NOTA 6: O "id" interno do motivo de isenção deve ser obtido por um

  • NOTA 7: O "id" interno da moeda deve ser obtido por um

  • NOTA 8: O item (serviço, produto ou descritor) tem já que existir, e o seu "id" interno pode ser obtido por um

  • NOTA 9: A unidade de medida tem já que existir, e o seu "id" interno pode ser obtido por um

  • NOTA 10: O "id" interno da taxa de IVA deve ser obtido por um

Para as faturas-recibos (FR), o recibo associado é criado automaticamente quando a FR é finalizada.

Eliminação do documento

Enquanto estiver em preparação, o documento pode ser eliminado.

delete
Path parameters
idintegerRequired

id of the document to delete

Responses
200

OK

No content

delete/v1/commercial_sales_documents/{id}
DELETE /v1/commercial_sales_documents/{id} HTTP/1.1
Host: api-cwb.cldware.com
Accept: */*
200

OK

No content

Finalização do documento

O documento pode ser imediatamente finalizado aquando da sua criação (ver o ponto anterior, atributo "finalize"). Mas pode ser deixado em preparação, e finalizado depois, por meio de um pedido adicional.

patch
Path parameters
idintegerRequired

id of the document to finalize

Body
return_pdfbooleanOptionalExample: true
Responses
200

OK

application/json
idintegerOptionalExample: 1
document_typestringOptionalExample: FT|FS|FR
datestringOptionalExample: 2023-01-01
document_series_idintegerOptionalExample: 1
document_series_prefixstringOptionalExample: Prefixo da série
customer_idintegerOptionalExample: 1
customer_tax_registration_numberstringOptionalExample: 999999990
customer_business_namestringOptionalExample: Nome do cliente
customer_address_detailstringOptionalExample: Morada do cliente
customer_postcodestringOptionalExample: 0000-000
customer_citystringOptionalExample: Cidade/Localidade do cliente
customer_countrystringOptionalExample: PT
due_datestringOptionalExample: 2023-01-01
settlement_expressionstringOptionalExample: 7.5
payment_mechanismstringOptionalExample: MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA
bank_account_idintegerOptionalExample: 1
cash_account_idintegerOptionalExample: 1
vat_included_pricesbooleanOptionalExample: false
tax_exemption_reason_idintegerOptionalExample: 1
operation_countrystringOptionalExample: PT-MA
currency_idintegerOptionalExample: 1
currency_iso_codestringOptionalExample: USD
currency_conversion_ratenumberOptionalExample: 1.21
retentionnumberOptionalExample: 7.5
retention_typestringOptionalExample: IRS|IRC
apply_retention_when_paidbooleanOptionalExample: true
notesstringOptionalExample: Notas ao documento
external_referencestringOptionalExample: Referência do documento externo
urlstringOptionalExample: https://app.cloudware.pt/path_to_file
patch/v1/commercial_sales_documents/{id}/finalize
PATCH /v1/commercial_sales_documents/{id}/finalize HTTP/1.1
Host: api-cwb.cldware.com
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "return_pdf": true
}
200

OK

{
  "id": 1,
  "document_type": "FT|FS|FR",
  "date": "2023-01-01",
  "document_series_id": 1,
  "document_series_prefix": "Prefixo da série",
  "customer_id": 1,
  "customer_tax_registration_number": "999999990",
  "customer_business_name": "Nome do cliente",
  "customer_address_detail": "Morada do cliente",
  "customer_postcode": "0000-000",
  "customer_city": "Cidade/Localidade do cliente",
  "customer_country": "PT",
  "due_date": "2023-01-01",
  "settlement_expression": "7.5",
  "payment_mechanism": "MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA",
  "bank_account_id": 1,
  "cash_account_id": 1,
  "vat_included_prices": false,
  "tax_exemption_reason_id": 1,
  "operation_country": "PT-MA",
  "currency_id": 1,
  "currency_iso_code": "USD",
  "currency_conversion_rate": 1.21,
  "retention": 7.5,
  "retention_type": "IRS|IRC",
  "apply_retention_when_paid": true,
  "notes": "Notas ao documento",
  "external_reference": "Referência do documento externo",
  "url": "https://app.cloudware.pt/path_to_file",
  "lines": [
    {
      "id": 1,
      "item_type": "Service|Product|TaxDescriptor",
      "item_id": 1,
      "item_code": "Código do serviço/produto/descritor",
      "description": "Descrição da linha",
      "unit_of_measure_id": 1,
      "unit_of_measure": "Unidade de medida",
      "quantity": 1,
      "unit_price": 9.99,
      "settlement_expression": "3",
      "tax_id": 1,
      "tax_code": "NOR|INT|RED|ISE",
      "tax_percentage": 22,
      "tax_country_region": "PT-MA"
    }
  ]
}

O payload JSON a enviar contém a seguinte informação:

Anulação do documento

Após a sua finalização, o documento deixa de poder ser eliminado, podendo apenas ser anulado.

patch
Path parameters
idintegerRequired

id of the document to void

Body
voided_reasonstringRequiredExample: Texto descritivo do motivo de anulação
Responses
200

OK

application/json
idintegerOptionalExample: 1
document_typestringOptionalExample: FT|FS|FR
datestringOptionalExample: 2023-01-01
document_series_idintegerOptionalExample: 1
document_series_prefixstringOptionalExample: Prefixo da série
customer_idintegerOptionalExample: 1
customer_tax_registration_numberstringOptionalExample: 999999990
customer_business_namestringOptionalExample: Nome do cliente
customer_address_detailstringOptionalExample: Morada do cliente
customer_postcodestringOptionalExample: 0000-000
customer_citystringOptionalExample: Cidade/Localidade do cliente
customer_countrystringOptionalExample: PT
due_datestringOptionalExample: 2023-01-01
settlement_expressionstringOptionalExample: 7.5
payment_mechanismstringOptionalExample: MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA
bank_account_idintegerOptionalExample: 1
cash_account_idintegerOptionalExample: 1
vat_included_pricesbooleanOptionalExample: false
tax_exemption_reason_idintegerOptionalExample: 1
operation_countrystringOptionalExample: PT-MA
currency_idintegerOptionalExample: 1
currency_iso_codestringOptionalExample: USD
currency_conversion_ratenumberOptionalExample: 1.21
retentionnumberOptionalExample: 7.5
retention_typestringOptionalExample: IRS|IRC
apply_retention_when_paidbooleanOptionalExample: true
notesstringOptionalExample: Notas ao documento
external_referencestringOptionalExample: Referência do documento externo
urlstringOptionalExample: https://app.cloudware.pt/path_to_file
patch/v1/commercial_sales_documents/{id}/void
PATCH /v1/commercial_sales_documents/{id}/void HTTP/1.1
Host: api-cwb.cldware.com
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "voided_reason": "Texto descritivo do motivo de anulação"
}
200

OK

{
  "id": 1,
  "document_type": "FT|FS|FR",
  "date": "2023-01-01",
  "document_series_id": 1,
  "document_series_prefix": "Prefixo da série",
  "customer_id": 1,
  "customer_tax_registration_number": "999999990",
  "customer_business_name": "Nome do cliente",
  "customer_address_detail": "Morada do cliente",
  "customer_postcode": "0000-000",
  "customer_city": "Cidade/Localidade do cliente",
  "customer_country": "PT",
  "due_date": "2023-01-01",
  "settlement_expression": "7.5",
  "payment_mechanism": "MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA",
  "bank_account_id": 1,
  "cash_account_id": 1,
  "vat_included_prices": false,
  "tax_exemption_reason_id": 1,
  "operation_country": "PT-MA",
  "currency_id": 1,
  "currency_iso_code": "USD",
  "currency_conversion_rate": 1.21,
  "retention": 7.5,
  "retention_type": "IRS|IRC",
  "apply_retention_when_paid": true,
  "notes": "Notas ao documento",
  "external_reference": "Referência do documento externo",
  "url": "https://app.cloudware.pt/path_to_file",
  "lines": [
    {
      "id": 1,
      "item_type": "Service|Product|TaxDescriptor",
      "item_id": 1,
      "item_code": "Código do serviço/produto/descritor",
      "description": "Descrição da linha",
      "unit_of_measure_id": 1,
      "unit_of_measure": "Unidade de medida",
      "quantity": 1,
      "unit_price": 9.99,
      "settlement_expression": "3",
      "tax_id": 1,
      "tax_code": "NOR|INT|RED|ISE",
      "tax_percentage": 22,
      "tax_country_region": "PT-MA"
    }
  ]
}

Alteração do documento

Após a sua criação, e enquanto estiver em preparação, o documento pode ser alterado. A estrutura do payload é a mesma do POST de criação, incluindo cabeçalho e linhas. Os atributos enviados irão substituir os guardados no momento.

Relativamente às linhas:

  • Para cada linha enviada com indicação do atributo "id", os atributos enviados irão substituir os guardados no momento na linha com esse mesmo "id".

  • Cada linha enviada sem indicação do atributo "id" será considerada uma linha nova, e será acrescentada ao documento.

  • Para eliminar uma linha existente, deverá usar-se a rota respectiva (ver Eliminação de uma linha).

O pedido de alteração pode também incluir, e ser aproveitado para, a finalização do documento — usando o atributo "finalize" — e/ou para a sua materialização em PDF — usando o atributo "return_pdf".

patch
Path parameters
idintegerRequired

id of the document to update

Body
idintegerOptionalExample: 1
document_typestringOptionalExample: FT|FS|FR
datestringOptionalExample: 2023-01-01
document_series_idintegerOptionalExample: 1
document_series_prefixstringOptionalExample: Prefixo da série
customer_idintegerOptionalExample: 1
customer_tax_registration_numberstringOptionalExample: 999999990
customer_business_namestringOptionalExample: Nome do cliente
customer_address_detailstringOptionalExample: Morada do cliente
customer_postcodestringOptionalExample: 0000-000
customer_citystringOptionalExample: Cidade/Localidade do cliente
customer_countrystringOptionalExample: PT
due_datestringOptionalExample: 2023-01-01
settlement_expressionstringOptionalExample: 7.5
payment_mechanismstringOptionalExample: MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA
bank_account_idintegerOptionalExample: 1
cash_account_idintegerOptionalExample: 1
vat_included_pricesbooleanOptionalExample: false
tax_exemption_reason_idintegerOptionalExample: 1
operation_countrystringOptionalExample: PT-MA
currency_idintegerOptionalExample: 1
currency_iso_codestringOptionalExample: USD
currency_conversion_ratenumberOptionalExample: 1.21
retentionnumberOptionalExample: 7.5
retention_typestringOptionalExample: IRS|IRC
apply_retention_when_paidbooleanOptionalExample: true
notesstringOptionalExample: Notas ao documento
external_referencestringOptionalExample: Referência do documento externo
finalizebooleanOptionalExample: true
return_pdfbooleanOptionalExample: true
Responses
200

OK

application/json
idintegerOptionalExample: 1
document_typestringOptionalExample: FT|FS|FR
datestringOptionalExample: 2023-01-01
document_series_idintegerOptionalExample: 1
document_series_prefixstringOptionalExample: Prefixo da série
customer_idintegerOptionalExample: 1
customer_tax_registration_numberstringOptionalExample: 999999990
customer_business_namestringOptionalExample: Nome do cliente
customer_address_detailstringOptionalExample: Morada do cliente
customer_postcodestringOptionalExample: 0000-000
customer_citystringOptionalExample: Cidade/Localidade do cliente
customer_countrystringOptionalExample: PT
due_datestringOptionalExample: 2023-01-01
settlement_expressionstringOptionalExample: 7.5
payment_mechanismstringOptionalExample: MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA
bank_account_idintegerOptionalExample: 1
cash_account_idintegerOptionalExample: 1
vat_included_pricesbooleanOptionalExample: false
tax_exemption_reason_idintegerOptionalExample: 1
operation_countrystringOptionalExample: PT-MA
currency_idintegerOptionalExample: 1
currency_iso_codestringOptionalExample: USD
currency_conversion_ratenumberOptionalExample: 1.21
retentionnumberOptionalExample: 7.5
retention_typestringOptionalExample: IRS|IRC
apply_retention_when_paidbooleanOptionalExample: true
notesstringOptionalExample: Notas ao documento
external_referencestringOptionalExample: Referência do documento externo
urlstringOptionalExample: https://app.cloudware.pt/path_to_file
patch/v1/commercial_sales_documents/{id}
PATCH /v1/commercial_sales_documents/{id} HTTP/1.1
Host: api-cwb.cldware.com
Content-Type: application/json
Accept: */*
Content-Length: 1259

{
  "id": 1,
  "document_type": "FT|FS|FR",
  "date": "2023-01-01",
  "document_series_id": 1,
  "document_series_prefix": "Prefixo da série",
  "customer_id": 1,
  "customer_tax_registration_number": "999999990",
  "customer_business_name": "Nome do cliente",
  "customer_address_detail": "Morada do cliente",
  "customer_postcode": "0000-000",
  "customer_city": "Cidade/Localidade do cliente",
  "customer_country": "PT",
  "due_date": "2023-01-01",
  "settlement_expression": "7.5",
  "payment_mechanism": "MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA",
  "bank_account_id": 1,
  "cash_account_id": 1,
  "vat_included_prices": false,
  "tax_exemption_reason_id": 1,
  "operation_country": "PT-MA",
  "currency_id": 1,
  "currency_iso_code": "USD",
  "currency_conversion_rate": 1.21,
  "retention": 7.5,
  "retention_type": "IRS|IRC",
  "apply_retention_when_paid": true,
  "notes": "Notas ao documento",
  "external_reference": "Referência do documento externo",
  "finalize": true,
  "return_pdf": true,
  "lines": [
    {
      "id": 1,
      "item_type": "Service|Product|TaxDescriptor",
      "item_id": 1,
      "item_code": "Código do serviço/produto/descritor",
      "description": "Descrição da linha",
      "unit_of_measure_id": 1,
      "unit_of_measure": "Unidade de medida",
      "quantity": 1,
      "unit_price": 9.99,
      "settlement_expression": "3",
      "tax_id": 1,
      "tax_code": "NOR|INT|RED|ISE",
      "tax_percentage": 22,
      "tax_country_region": "PT-MA"
    }
  ]
}
200

OK

{
  "id": 1,
  "document_type": "FT|FS|FR",
  "date": "2023-01-01",
  "document_series_id": 1,
  "document_series_prefix": "Prefixo da série",
  "customer_id": 1,
  "customer_tax_registration_number": "999999990",
  "customer_business_name": "Nome do cliente",
  "customer_address_detail": "Morada do cliente",
  "customer_postcode": "0000-000",
  "customer_city": "Cidade/Localidade do cliente",
  "customer_country": "PT",
  "due_date": "2023-01-01",
  "settlement_expression": "7.5",
  "payment_mechanism": "MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA",
  "bank_account_id": 1,
  "cash_account_id": 1,
  "vat_included_prices": false,
  "tax_exemption_reason_id": 1,
  "operation_country": "PT-MA",
  "currency_id": 1,
  "currency_iso_code": "USD",
  "currency_conversion_rate": 1.21,
  "retention": 7.5,
  "retention_type": "IRS|IRC",
  "apply_retention_when_paid": true,
  "notes": "Notas ao documento",
  "external_reference": "Referência do documento externo",
  "url": "https://app.cloudware.pt/path_to_file",
  "lines": [
    {
      "id": 1,
      "item_type": "Service|Product|TaxDescriptor",
      "item_id": 1,
      "item_code": "Código do serviço/produto/descritor",
      "description": "Descrição da linha",
      "unit_of_measure_id": 1,
      "unit_of_measure": "Unidade de medida",
      "quantity": 1,
      "unit_price": 9.99,
      "settlement_expression": "3",
      "tax_id": 1,
      "tax_code": "NOR|INT|RED|ISE",
      "tax_percentage": 22,
      "tax_country_region": "PT-MA"
    }
  ]
}

Eliminação de uma linha

delete
Path parameters
idintegerRequired

id of the document

lineIdintegerRequired

id of the document line to delete

Responses
200

OK

No content

delete/v1/commercial_sales_documents/{id}/lines/{lineId}
DELETE /v1/commercial_sales_documents/{id}/lines/{lineId} HTTP/1.1
Host: api-cwb.cldware.com
Accept: */*
200

OK

No content

Consulta do documento

Os documentos podem ser consultados a qualquer altura, antes ou depois de finalizados, e mesmo depois de anulados.

get
Path parameters
idintegerRequired

id of the document of which to get the information

Responses
200

OK

application/json
idintegerOptionalExample: 1
document_typestringOptionalExample: FT|FS|FR
datestringOptionalExample: 2023-01-01
document_series_idintegerOptionalExample: 1
document_series_prefixstringOptionalExample: Prefixo da série
customer_idintegerOptionalExample: 1
customer_tax_registration_numberstringOptionalExample: 999999990
customer_business_namestringOptionalExample: Nome do cliente
customer_address_detailstringOptionalExample: Morada do cliente
customer_postcodestringOptionalExample: 0000-000
customer_citystringOptionalExample: Cidade/Localidade do cliente
customer_countrystringOptionalExample: PT
due_datestringOptionalExample: 2023-01-01
settlement_expressionstringOptionalExample: 7.5
payment_mechanismstringOptionalExample: MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA
bank_account_idintegerOptionalExample: 1
cash_account_idintegerOptionalExample: 1
vat_included_pricesbooleanOptionalExample: false
tax_exemption_reason_idintegerOptionalExample: 1
operation_countrystringOptionalExample: PT-MA
currency_idintegerOptionalExample: 1
currency_iso_codestringOptionalExample: USD
currency_conversion_ratenumberOptionalExample: 1.21
retentionnumberOptionalExample: 7.5
retention_typestringOptionalExample: IRS|IRC
apply_retention_when_paidbooleanOptionalExample: true
notesstringOptionalExample: Notas ao documento
external_referencestringOptionalExample: Referência do documento externo
urlstringOptionalExample: https://app.cloudware.pt/path_to_file
get/v1/commercial_sales_documents/{id}
GET /v1/commercial_sales_documents/{id} HTTP/1.1
Host: api-cwb.cldware.com
Accept: */*
200

OK

{
  "id": 1,
  "document_type": "FT|FS|FR",
  "date": "2023-01-01",
  "document_series_id": 1,
  "document_series_prefix": "Prefixo da série",
  "customer_id": 1,
  "customer_tax_registration_number": "999999990",
  "customer_business_name": "Nome do cliente",
  "customer_address_detail": "Morada do cliente",
  "customer_postcode": "0000-000",
  "customer_city": "Cidade/Localidade do cliente",
  "customer_country": "PT",
  "due_date": "2023-01-01",
  "settlement_expression": "7.5",
  "payment_mechanism": "MO|CH|DC|CC|TR|CO|CS|DE|LC|MB|OU|RT|DDA",
  "bank_account_id": 1,
  "cash_account_id": 1,
  "vat_included_prices": false,
  "tax_exemption_reason_id": 1,
  "operation_country": "PT-MA",
  "currency_id": 1,
  "currency_iso_code": "USD",
  "currency_conversion_rate": 1.21,
  "retention": 7.5,
  "retention_type": "IRS|IRC",
  "apply_retention_when_paid": true,
  "notes": "Notas ao documento",
  "external_reference": "Referência do documento externo",
  "url": "https://app.cloudware.pt/path_to_file",
  "lines": [
    {
      "id": 1,
      "item_type": "Service|Product|TaxDescriptor",
      "item_id": 1,
      "item_code": "Código do serviço/produto/descritor",
      "description": "Descrição da linha",
      "unit_of_measure_id": 1,
      "unit_of_measure": "Unidade de medida",
      "quantity": 1,
      "unit_price": 9.99,
      "settlement_expression": "3",
      "tax_id": 1,
      "tax_code": "NOR|INT|RED|ISE",
      "tax_percentage": 22,
      "tax_country_region": "PT-MA"
    }
  ]
}

Last updated