API reference
Customers
The customers you invoice. A document references one by id. 6 operations.
List customers
GET /customers
Returns a paginated, filterable list of customers. By default returns 20 customers 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. name:asc, city:desc) |
search | query | string | Global search term |
taxpayerNumber | query | string | Filter by tax number (NIF) |
name | query | string | Filter by name |
firstName | query | string | Filter by first name |
lastName | query | string | Filter by last name |
companyName | query | string | Filter by company name |
companyPosition | query | string | Filter by position in the company |
email | query | string | Filter by email |
website | query | string | Filter by website |
description | query | string | Filter by description |
address | query | string | Filter by address |
postalCode | query | string | Filter by postal code |
country | query | string | Filter by country |
phone | query | string | Filter by phone |
fax | query | string | Filter by fax |
mobile | query | string | Filter by mobile phone |
city | query | string | Filter by city |
system | query | boolean | Filter by system type |
isArchived | query | boolean | Filter by archived status |
curl 'https://api.fiz.co/customers' \
--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.customers.list();from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.customers.list()<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->customers->list();Response 200
List of customers returned successfully
| Field | Type | Description |
|---|---|---|
[]. | string | Unique customer identifier |
[]. | string · can be null | Tax number (NIF) |
[]. | string · can be null | Customer name |
[]. | string · can be null | Photo URL |
[]. | string · can be null | Company name |
[]. | string · can be null | Position in the company |
[]. | string · can be null | Customer email |
[]. | string · can be null | Website |
[]. | string · can be null | Description |
[]. | string · can be null | Address |
[]. | string · can be null | Postal code |
[]. | string · can be null | Country code |
[]. | string · can be null | Phone |
[]. | string · can be null | Fax |
[]. | string · can be null | Mobile phone |
[]. | string · can be null | City |
[]. | boolean · can be null | Whether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore. |
Errors
400Invalid parameters401Unauthorized - API key missing or invalid429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Create customer
POST /customers
Creates a new customer in the system
Request body
Data required to create the customer
| Field | Type | Description |
|---|---|---|
name required | string | Customer name |
firstName | string | First name |
lastName | string | Last name |
email | string | Customer email |
taxpayerNumber | string | Tax number (NIF) |
country | string | Country code (ISO 3166-1 alpha-2) |
phone | string | Phone |
mobile | string | Mobile phone |
fax | string | Fax |
address | string | Address |
city | string | City |
postalCode | string | Postal code |
website | string | Website |
companyName | string | Company name |
companyPosition | string | Position in the company |
description | string | Description |
photo | string | Photo URL |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request POST 'https://api.fiz.co/customers' \
--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 '{
"name": "João Silva"
}'import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.customers.create({
name: 'João Silva',
});from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.customers.create({
"name": "João Silva",
})<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->customers->create([
'name' => 'João Silva',
]);Response 201
Customer created successfully
| Field | Type | Description |
|---|---|---|
id | string | Unique customer identifier |
taxpayerNumber | string · can be null | Tax number (NIF) |
name | string · can be null | Customer name |
photo | string · can be null | Photo URL |
companyName | string · can be null | Company name |
companyPosition | string · can be null | Position in the company |
email | string · can be null | Customer email |
website | string · can be null | Website |
description | string · can be null | Description |
address | string · can be null | Address |
postalCode | string · can be null | Postal code |
country | string · can be null | Country code |
phone | string · can be null | Phone |
fax | string · can be null | Fax |
mobile | string · can be null | Mobile phone |
city | string · can be null | City |
isArchived | boolean · can be null | Whether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore. |
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 body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Get customer by ID
GET /customers/{id}
Returns a single customer by its unique identifier
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Unique customer identifier |
curl 'https://api.fiz.co/customers/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.customers.retrieve('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.customers.retrieve("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->customers->retrieve('ID');Response 200
Customer found
| Field | Type | Description |
|---|---|---|
id | string | Unique customer identifier |
taxpayerNumber | string · can be null | Tax number (NIF) |
name | string · can be null | Customer name |
photo | string · can be null | Photo URL |
companyName | string · can be null | Company name |
companyPosition | string · can be null | Position in the company |
email | string · can be null | Customer email |
website | string · can be null | Website |
description | string · can be null | Description |
address | string · can be null | Address |
postalCode | string · can be null | Postal code |
country | string · can be null | Country code |
phone | string · can be null | Phone |
fax | string · can be null | Fax |
mobile | string · can be null | Mobile phone |
city | string · can be null | City |
isArchived | boolean · can be null | Whether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore. |
Errors
400Invalid ID401Unauthorized - API key missing or invalid404Customer not found429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Update customer
PATCH /customers/{id}
Updates an existing customer
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Unique customer identifier |
Request body
Customer fields to update
| Field | Type | Description |
|---|---|---|
name | string | Customer name |
firstName | string | First name |
lastName | string | Last name |
email | string | Customer email |
taxpayerNumber | string | Tax number (NIF) |
country | string | Country code (ISO 3166-1 alpha-2) |
phone | string | Phone |
mobile | string | Mobile phone |
fax | string | Fax |
address | string | Address |
city | string | City |
postalCode | string | Postal code |
website | string | Website |
companyName | string | Company name |
companyPosition | string | Position in the company |
description | string | Description |
photo | string | Photo URL |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request PATCH 'https://api.fiz.co/customers/ID' \
--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 '{
"name": "João Silva",
"firstName": "João",
"lastName": "Silva"
}'import { Fiz } from '@fiz-co/sdk';
const fiz = new Fiz(); // reads FIZ_API_KEY
const result = await fiz.customers.update('ID', {
name: 'João Silva',
firstName: 'João',
lastName: 'Silva',
});from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.customers.update("ID", {
"name": "João Silva",
"firstName": "João",
"lastName": "Silva",
})<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->customers->update('ID', [
'name' => 'João Silva',
'firstName' => 'João',
'lastName' => 'Silva',
]);Response 200
Customer updated successfully
| Field | Type | Description |
|---|---|---|
id | string | Unique customer identifier |
taxpayerNumber | string · can be null | Tax number (NIF) |
name | string · can be null | Customer name |
photo | string · can be null | Photo URL |
companyName | string · can be null | Company name |
companyPosition | string · can be null | Position in the company |
email | string · can be null | Customer email |
website | string · can be null | Website |
description | string · can be null | Description |
address | string · can be null | Address |
postalCode | string · can be null | Postal code |
country | string · can be null | Country code |
phone | string · can be null | Phone |
fax | string · can be null | Fax |
mobile | string · can be null | Mobile phone |
city | string · can be null | City |
isArchived | boolean · can be null | Whether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore. |
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 body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Archive customer
DELETE /customers/{id}
Archives a customer by its unique identifier. The customer is not permanently removed, only marked as archived.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Unique customer identifier |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request DELETE 'https://api.fiz.co/customers/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.customers.delete('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.customers.delete("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->customers->delete('ID');Response 200
Customer archived successfully
| Field | Type | Description |
|---|---|---|
id | string | Unique customer identifier |
taxpayerNumber | string · can be null | Tax number (NIF) |
name | string · can be null | Customer name |
photo | string · can be null | Photo URL |
companyName | string · can be null | Company name |
companyPosition | string · can be null | Position in the company |
email | string · can be null | Customer email |
website | string · can be null | Website |
description | string · can be null | Description |
address | string · can be null | Address |
postalCode | string · can be null | Postal code |
country | string · can be null | Country code |
phone | string · can be null | Phone |
fax | string · can be null | Fax |
mobile | string · can be null | Mobile phone |
city | string · can be null | City |
isArchived | boolean · can be null | Whether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore. |
Errors
400Invalid ID401Unauthorized - API key missing or invalid404Customer 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 body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Restore archived customer
POST /customers/{id}/restore
Restores an archived customer, which shows up in the default listing again. An archived customer still holds its taxpayer number, so creating another one with the same number is refused: find it with GET /customers?isArchived=true&taxpayerNumber=… and restore it. Restoring a customer that is not archived has no effect.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | Unique customer identifier |
# Once per operation. Keep it and reuse it on every retry.
IDEMPOTENCY_KEY=$(uuidgen)curl --request POST 'https://api.fiz.co/customers/ID/restore' \
--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.customers.restore('ID');from fiz_sdk import Fiz
fiz = Fiz() # reads FIZ_API_KEY
result = fiz.customers.restore("ID")<?php
require 'vendor/autoload.php';
$fiz = new Fiz\Fiz(); // reads FIZ_API_KEY
$result = $fiz->customers->restore('ID');Response 200
Customer restored successfully
| Field | Type | Description |
|---|---|---|
id | string | Unique customer identifier |
taxpayerNumber | string · can be null | Tax number (NIF) |
name | string · can be null | Customer name |
photo | string · can be null | Photo URL |
companyName | string · can be null | Company name |
companyPosition | string · can be null | Position in the company |
email | string · can be null | Customer email |
website | string · can be null | Website |
description | string · can be null | Description |
address | string · can be null | Address |
postalCode | string · can be null | Postal code |
country | string · can be null | Country code |
phone | string · can be null | Phone |
fax | string · can be null | Fax |
mobile | string · can be null | Mobile phone |
city | string · can be null | City |
isArchived | boolean · can be null | Whether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore. |
Errors
400Invalid ID401Unauthorized - API key missing or invalid404Customer 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 body429The OAuth connection’s request limit is reached. Nothing was executed: repeat the same request after Retry-After seconds.
Errors
Errors share one shape: statusCode, message, code and error, with the request id in the X-Request-Id header.