API reference
Pro formas
Commercial proposals before an invoice. Not fiscal documents: never reported to the AT. 6 operations.
List pro formas
GET /proposals
Returns a list of pro formas with pagination and filters. By default, returns 20 records starting at offset 0.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
offset | query | number | Number of records to skip (offset) |
limit | query | number | Maximum number of records to return |
sort | query | string | Sort field and order (e.g. date:desc, number:asc) |
search | query | string | Global search term (number, customer, etc.) |
status | query | string | Filter by status One of: CANCELED, CREATED, ISSUED, PROCESSING |
fromDate | query | string | Filter from this date (ISO 8601 with timezone) |
toDate | query | string | Filter up to this date (ISO 8601 with timezone) |
curl 'https://api.fiz.co/proposals' \
--header "x-api-key: $FIZ_API_KEY"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.proposals.list();from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.proposals.list()<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->proposals->list();Response 200
List of pro formas returned successfully
| Field | Type | Description |
|---|---|---|
[]. | string | Unique pro forma identifier |
[]. | string · can be null | Pro forma number, assigned at creation |
[]. | string · can be null | Document type One of: PROFORMA |
[]. | string | Status: CREATED (active), ISSUED (converted into an invoice), CANCELED (void) One of: CANCELED, CREATED, ISSUED, PROCESSING |
[]. | string · can be null | Document date |
[]. | string · can be null | Validity / due date |
[]. | string · can be null | Currency |
[]. | string · can be null | Notes |
[]. | string · can be null | CAE code |
[]. | object · can be null | Series |
[]. | string · can be null | Series identifier |
[]. | string · can be null | Series name |
[]. | object · can be null | Customer |
[]. | string · can be null | Customer identifier |
[]. | object · can be null | Customer data |
[]. | string · can be null | Tax number (NIF) |
[]. | string · can be null | Customer name |
[]. | string · can be null | Customer email |
[]. | string · can be null | Customer country |
[]. | string · can be null | Customer phone |
[]. | object · can be null | Totals |
[]. | number · can be null | Amount without tax |
[]. | number · can be null | Amount with tax |
[]. | number · can be null | Amount without tax and discount |
[]. | number · can be null | Tax amount |
[]. | string · can be null | Global discount type One of: AMOUNT, PERCENT |
[]. | number · can be null | Global discount percentage |
[]. | number · can be null | Global discount amount |
[]. | number · can be null | Total |
[]. | number · can be null | Total payable |
[]. | number · can be null | Withholding tax amount |
[]. | number · can be null | Total of credit notes |
[]. | object[] · can be null | Items |
[]. | string | Identifier of the item on the invoice |
[]. | string · can be null | Item reference |
[]. | object · can be null | Item metadata |
[]. | number · can be null | Item quantity |
[]. | number · can be null | Amount without tax |
[]. | number · can be null | Amount with tax |
[]. | number · can be null | Tax amount |
[]. | number · can be null | Discount amount applied to the item |
[]. | number · can be null | Unit amount without tax |
[]. | number · can be null | Unit amount with tax |
[]. | number · can be null | Withholding tax amount |
[]. | boolean · can be null | Withholding tax enabled |
[]. | object · can be null | Item data |
[]. | string · can be null | Item name |
[]. | string · can be null | Item description |
[]. | string | Item type |
[]. | number · can be null | Unit price |
[]. | number · can be null | Tax rate |
[]. | string · can be null | VAT rate |
[]. | string · can be null | VAT territory |
[]. | string · can be null | VAT exemption reason |
[]. | boolean · can be null | Automatic VAT enabled |
[]. | string · can be null | Only on the lines of partial credit/debit notes: what the line changes on the corrected invoice line — the quantity (QUANTITY) or the unit price (PRICE). Absent on other lines and on older notes. One of: QUANTITY, PRICE |
[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line before this note. |
[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line after this note. |
[]. | object[] · can be null | Invoices raised from this pro forma |
[]. | string | Identifier of the invoice raised from the pro forma |
[]. | string · can be null | Invoice number |
[]. | string · can be null | Document type |
[]. | string | Invoice status |
[]. | string · can be null | Invoice date |
[]. | string · can be null | Creation date |
[]. | string · can be null | Cancellation date, when canceled |
Errors
400Invalid parameters401Unauthorized - API key missing or invalid
Create pro forma
POST /proposals
Creates a pro forma (commercial proposal). A pro forma is numbered immediately (PF …), is not reported to the AT and has no fiscal effect. It stays CREATED until it is converted into an invoice in the FIZ app (ISSUED) or canceled (CANCELED).
Request body
Data required to create the pro forma
| Field | Type | Description |
|---|---|---|
date | string | Document date (optional). If omitted, the current date and time are used. |
dueDate | string | Validity / due date of the pro forma (optional). If omitted, the document date is used. |
cae | string | CAE code (economic activity classification). Optional on a pro forma, but required once it is converted into an invoice. |
customerId required | string | Customer identifier |
seriesId | string | Series identifier (optional). Use the "id" returned by GET /series. |
notes | string | Pro forma notes (optional) |
items required | object[] | List of pro forma items |
items[]. required | string | Item identifier |
items[]. required | number | Item quantity |
items[]. | number | Unit price before VAT for this line (optional). Overrides the item's price on this document only: the catalogue item keeps its price. Send unitPrice OR unitPriceWithVat, not both. |
items[]. | number | Unit price including VAT for this line (optional), instead of unitPrice. Converted to the price before VAT at the item's VAT rate, without rounding, so the VAT-inclusive total matches to the cent. Like unitPrice, it applies to this document only. Cannot be combined with an amount discount (discountType=AMOUNT), which is before VAT: use a percentage discount. |
items[]. | string | Discount type for this line (optional). Overrides the discount set on the catalogue item. Applied before the invoice's global discount. One of: AMOUNT, PERCENT |
items[]. | number | Discount percentage for this line (e.g. 10 for 10%). Requires discountType=PERCENT. |
items[]. | number | Absolute per-unit discount amount for this line, before VAT. Requires discountType=AMOUNT. |
items[]. | boolean | Apply withholding tax on this line (optional). If omitted, the line follows the item (withholdingTaxAvailable). With true, withholding applies to this document only, at withholdingTaxPercent or, without it, the item's percentage; the type is IRS for a sole trader and IRC for a company. With false, the line has no withholding. The catalogue item is not changed. |
items[]. | number | Withholding tax percentage for this line (optional, e.g. 25). Turns withholding on for the line; cannot be sent with withholdingTaxEnabled=false. Applies to this document only. |
summary | object | Pro forma summary with global discount (optional) |
summary. | string | Global discount type One of: AMOUNT, PERCENT |
summary. | number | Global discount percentage (e.g. 10 for 10%) |
summary. | number | Absolute global discount amount |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request POST 'https://api.fiz.co/proposals' \
--header "x-api-key: $FIZ_API_KEY" \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}" \
--data '{
"customerId": "6863b1513117c5892ff55296",
"items": [
{
"id": "68483e978073231c3947077c",
"quantity": 1,
"discountType": "PERCENT",
"discountPercent": 10
}
]
}'import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.proposals.create({
customerId: '6863b1513117c5892ff55296',
items: [
{
id: '68483e978073231c3947077c',
quantity: 1,
discountType: 'PERCENT',
discountPercent: 10,
},
],
});from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.proposals.create({
"customerId": "6863b1513117c5892ff55296",
"items": [
{
"id": "68483e978073231c3947077c",
"quantity": 1,
"discountType": "PERCENT",
"discountPercent": 10,
},
],
})<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->proposals->create([
'customerId' => '6863b1513117c5892ff55296',
'items' => [
[
'id' => '68483e978073231c3947077c',
'quantity' => 1,
'discountType' => 'PERCENT',
'discountPercent' => 10,
],
],
]);Response 201
Pro forma created successfully
| Field | Type | Description |
|---|---|---|
id | string | Unique pro forma identifier |
number | string · can be null | Pro forma number, assigned at creation |
documentType | string · can be null | Document type One of: PROFORMA |
status | string | Status: CREATED (active), ISSUED (converted into an invoice), CANCELED (void) One of: CANCELED, CREATED, ISSUED, PROCESSING |
date | string · can be null | Document date |
dueDate | string · can be null | Validity / due date |
currency | string · can be null | Currency |
notes | string · can be null | Notes |
cae | string · can be null | CAE code |
series | object · can be null | Series |
series. | string · can be null | Series identifier |
series. | string · can be null | Series name |
customer | object · can be null | Customer |
customer. | string · can be null | Customer identifier |
customer. | object · can be null | Customer data |
customer. | string · can be null | Tax number (NIF) |
customer. | string · can be null | Customer name |
customer. | string · can be null | Customer email |
customer. | string · can be null | Customer country |
customer. | string · can be null | Customer phone |
summary | object · can be null | Totals |
summary. | number · can be null | Amount without tax |
summary. | number · can be null | Amount with tax |
summary. | number · can be null | Amount without tax and discount |
summary. | number · can be null | Tax amount |
summary. | string · can be null | Global discount type One of: AMOUNT, PERCENT |
summary. | number · can be null | Global discount percentage |
summary. | number · can be null | Global discount amount |
summary. | number · can be null | Total |
summary. | number · can be null | Total payable |
summary. | number · can be null | Withholding tax amount |
summary. | number · can be null | Total of credit notes |
items | object[] · can be null | Items |
items[]. | string | Identifier of the item on the invoice |
items[]. | string · can be null | Item reference |
items[]. | object · can be null | Item metadata |
items[]. | number · can be null | Item quantity |
items[]. | number · can be null | Amount without tax |
items[]. | number · can be null | Amount with tax |
items[]. | number · can be null | Tax amount |
items[]. | number · can be null | Discount amount applied to the item |
items[]. | number · can be null | Unit amount without tax |
items[]. | number · can be null | Unit amount with tax |
items[]. | number · can be null | Withholding tax amount |
items[]. | boolean · can be null | Withholding tax enabled |
items[]. | object · can be null | Item data |
items[]. | string · can be null | Item name |
items[]. | string · can be null | Item description |
items[]. | string | Item type |
items[]. | number · can be null | Unit price |
items[]. | number · can be null | Tax rate |
items[]. | string · can be null | VAT rate |
items[]. | string · can be null | VAT territory |
items[]. | string · can be null | VAT exemption reason |
items[]. | boolean · can be null | Automatic VAT enabled |
items[]. | string · can be null | Only on the lines of partial credit/debit notes: what the line changes on the corrected invoice line — the quantity (QUANTITY) or the unit price (PRICE). Absent on other lines and on older notes. One of: QUANTITY, PRICE |
items[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line before this note. |
items[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line after this note. |
relatedDocuments | object[] · can be null | Invoices raised from this pro forma |
relatedDocuments[]. | string | Identifier of the invoice raised from the pro forma |
relatedDocuments[]. | string · can be null | Invoice number |
relatedDocuments[]. | string · can be null | Document type |
relatedDocuments[]. | string | Invoice status |
relatedDocuments[]. | string · can be null | Invoice date |
createdAt | string · can be null | Creation date |
canceledAt | string · can be null | Cancellation date, when canceled |
Errors
400Invalid data401Unauthorized - API key missing or invalid409A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown422The idempotency key was already used with a different request body
Get pro forma by ID
GET /proposals/{id}
Returns a pro forma with its lines, totals and the invoices raised from it (relatedDocuments).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Pro forma identifier |
curl 'https://api.fiz.co/proposals/ID' \
--header "x-api-key: $FIZ_API_KEY"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.proposals.retrieve('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.proposals.retrieve("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->proposals->retrieve('ID');Response 200
Pro forma found
| Field | Type | Description |
|---|---|---|
id | string | Unique pro forma identifier |
number | string · can be null | Pro forma number, assigned at creation |
documentType | string · can be null | Document type One of: PROFORMA |
status | string | Status: CREATED (active), ISSUED (converted into an invoice), CANCELED (void) One of: CANCELED, CREATED, ISSUED, PROCESSING |
date | string · can be null | Document date |
dueDate | string · can be null | Validity / due date |
currency | string · can be null | Currency |
notes | string · can be null | Notes |
cae | string · can be null | CAE code |
series | object · can be null | Series |
series. | string · can be null | Series identifier |
series. | string · can be null | Series name |
customer | object · can be null | Customer |
customer. | string · can be null | Customer identifier |
customer. | object · can be null | Customer data |
customer. | string · can be null | Tax number (NIF) |
customer. | string · can be null | Customer name |
customer. | string · can be null | Customer email |
customer. | string · can be null | Customer country |
customer. | string · can be null | Customer phone |
summary | object · can be null | Totals |
summary. | number · can be null | Amount without tax |
summary. | number · can be null | Amount with tax |
summary. | number · can be null | Amount without tax and discount |
summary. | number · can be null | Tax amount |
summary. | string · can be null | Global discount type One of: AMOUNT, PERCENT |
summary. | number · can be null | Global discount percentage |
summary. | number · can be null | Global discount amount |
summary. | number · can be null | Total |
summary. | number · can be null | Total payable |
summary. | number · can be null | Withholding tax amount |
summary. | number · can be null | Total of credit notes |
items | object[] · can be null | Items |
items[]. | string | Identifier of the item on the invoice |
items[]. | string · can be null | Item reference |
items[]. | object · can be null | Item metadata |
items[]. | number · can be null | Item quantity |
items[]. | number · can be null | Amount without tax |
items[]. | number · can be null | Amount with tax |
items[]. | number · can be null | Tax amount |
items[]. | number · can be null | Discount amount applied to the item |
items[]. | number · can be null | Unit amount without tax |
items[]. | number · can be null | Unit amount with tax |
items[]. | number · can be null | Withholding tax amount |
items[]. | boolean · can be null | Withholding tax enabled |
items[]. | object · can be null | Item data |
items[]. | string · can be null | Item name |
items[]. | string · can be null | Item description |
items[]. | string | Item type |
items[]. | number · can be null | Unit price |
items[]. | number · can be null | Tax rate |
items[]. | string · can be null | VAT rate |
items[]. | string · can be null | VAT territory |
items[]. | string · can be null | VAT exemption reason |
items[]. | boolean · can be null | Automatic VAT enabled |
items[]. | string · can be null | Only on the lines of partial credit/debit notes: what the line changes on the corrected invoice line — the quantity (QUANTITY) or the unit price (PRICE). Absent on other lines and on older notes. One of: QUANTITY, PRICE |
items[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line before this note. |
items[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line after this note. |
relatedDocuments | object[] · can be null | Invoices raised from this pro forma |
relatedDocuments[]. | string | Identifier of the invoice raised from the pro forma |
relatedDocuments[]. | string · can be null | Invoice number |
relatedDocuments[]. | string · can be null | Document type |
relatedDocuments[]. | string | Invoice status |
relatedDocuments[]. | string · can be null | Invoice date |
createdAt | string · can be null | Creation date |
canceledAt | string · can be null | Cancellation date, when canceled |
Errors
401Unauthorized - API key missing or invalid404Pro forma not found
Delete pro forma
DELETE /proposals/{id}
Permanently deletes an active (CREATED) or canceled (CANCELED) pro forma. A pro forma converted into an invoice (ISSUED) cannot be deleted, because the invoice references it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Pro forma identifier |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request DELETE 'https://api.fiz.co/proposals/ID' \
--header "x-api-key: $FIZ_API_KEY" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.proposals.delete('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.proposals.delete("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->proposals->delete('ID');Response 200
Pro forma deleted successfully
| Field | Type | Description |
|---|---|---|
id | string | Identifier of the deleted pro forma |
number | string · can be null | Number of the deleted pro forma |
status | string | Status at the time of deletion One of: CANCELED, CREATED, ISSUED, PROCESSING |
Errors
400Pro forma converted into an invoice — cannot be deleted401Unauthorized - API key missing or invalid404Pro forma not found409A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown422The idempotency key was already used with a different request body
Cancel pro forma
POST /proposals/{id}/cancel
Cancels an active (CREATED) pro forma. The pro forma becomes CANCELED and stays in the history. A pro forma already converted into an invoice (ISSUED) cannot be canceled.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Pro forma identifier |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request POST 'https://api.fiz.co/proposals/ID/cancel' \
--header "x-api-key: $FIZ_API_KEY" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?set the operation key first, in the step above}"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.proposals.cancel('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.proposals.cancel("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->proposals->cancel('ID');Response 200
Pro forma canceled successfully
| Field | Type | Description |
|---|---|---|
id | string | Unique pro forma identifier |
number | string · can be null | Pro forma number, assigned at creation |
documentType | string · can be null | Document type One of: PROFORMA |
status | string | Status: CREATED (active), ISSUED (converted into an invoice), CANCELED (void) One of: CANCELED, CREATED, ISSUED, PROCESSING |
date | string · can be null | Document date |
dueDate | string · can be null | Validity / due date |
currency | string · can be null | Currency |
notes | string · can be null | Notes |
cae | string · can be null | CAE code |
series | object · can be null | Series |
series. | string · can be null | Series identifier |
series. | string · can be null | Series name |
customer | object · can be null | Customer |
customer. | string · can be null | Customer identifier |
customer. | object · can be null | Customer data |
customer. | string · can be null | Tax number (NIF) |
customer. | string · can be null | Customer name |
customer. | string · can be null | Customer email |
customer. | string · can be null | Customer country |
customer. | string · can be null | Customer phone |
summary | object · can be null | Totals |
summary. | number · can be null | Amount without tax |
summary. | number · can be null | Amount with tax |
summary. | number · can be null | Amount without tax and discount |
summary. | number · can be null | Tax amount |
summary. | string · can be null | Global discount type One of: AMOUNT, PERCENT |
summary. | number · can be null | Global discount percentage |
summary. | number · can be null | Global discount amount |
summary. | number · can be null | Total |
summary. | number · can be null | Total payable |
summary. | number · can be null | Withholding tax amount |
summary. | number · can be null | Total of credit notes |
items | object[] · can be null | Items |
items[]. | string | Identifier of the item on the invoice |
items[]. | string · can be null | Item reference |
items[]. | object · can be null | Item metadata |
items[]. | number · can be null | Item quantity |
items[]. | number · can be null | Amount without tax |
items[]. | number · can be null | Amount with tax |
items[]. | number · can be null | Tax amount |
items[]. | number · can be null | Discount amount applied to the item |
items[]. | number · can be null | Unit amount without tax |
items[]. | number · can be null | Unit amount with tax |
items[]. | number · can be null | Withholding tax amount |
items[]. | boolean · can be null | Withholding tax enabled |
items[]. | object · can be null | Item data |
items[]. | string · can be null | Item name |
items[]. | string · can be null | Item description |
items[]. | string | Item type |
items[]. | number · can be null | Unit price |
items[]. | number · can be null | Tax rate |
items[]. | string · can be null | VAT rate |
items[]. | string · can be null | VAT territory |
items[]. | string · can be null | VAT exemption reason |
items[]. | boolean · can be null | Automatic VAT enabled |
items[]. | string · can be null | Only on the lines of partial credit/debit notes: what the line changes on the corrected invoice line — the quantity (QUANTITY) or the unit price (PRICE). Absent on other lines and on older notes. One of: QUANTITY, PRICE |
items[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line before this note. |
items[]. | number · can be null | With noteChangeKind: the quantity or unit price of the invoice line after this note. |
relatedDocuments | object[] · can be null | Invoices raised from this pro forma |
relatedDocuments[]. | string | Identifier of the invoice raised from the pro forma |
relatedDocuments[]. | string · can be null | Invoice number |
relatedDocuments[]. | string · can be null | Document type |
relatedDocuments[]. | string | Invoice status |
relatedDocuments[]. | string · can be null | Invoice date |
createdAt | string · can be null | Creation date |
canceledAt | string · can be null | Cancellation date, when canceled |
Errors
400Pro forma already converted into an invoice or already canceled401Unauthorized - API key missing or invalid404Pro forma not found409A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown422The idempotency key was already used with a different request body
Download pro forma PDF
GET /proposals/{id}/pdf
Generates and returns the download link for the PDF of a pro forma.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Pro forma identifier |
isDuplicate | query | boolean | Mark PDF as duplicate |
templateId | query | string | ID of the template to use |
curl 'https://api.fiz.co/proposals/ID/pdf' \
--header "x-api-key: $FIZ_API_KEY"import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.proposals.pdf('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.proposals.pdf("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->proposals->pdf('ID');Response 200
PDF generated successfully
| Field | Type | Description |
|---|---|---|
id | string | PDF file ID |
name | string · can be null | PDF file name |
url | string · can be null | PDF download URL |
Errors
401Unauthorized - API key missing or invalid404Pro forma not found
Errors
Errors share one shape: statusCode, message, code and error, with the request id in the X-Request-Id header.