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.

Authentication: an API key (x-api-key) or an OAuth access token.

Parameters

NameInTypeDescription
offsetquerynumberNumber of records to skip (offset)
limitquerynumberMaximum number of records to return
sortquerystringSort field and order (e.g. name:asc, city:desc)
searchquerystringGlobal search term
taxpayerNumberquerystringFilter by tax number (NIF)
namequerystringFilter by name
firstNamequerystringFilter by first name
lastNamequerystringFilter by last name
companyNamequerystringFilter by company name
companyPositionquerystringFilter by position in the company
emailquerystringFilter by email
websitequerystringFilter by website
descriptionquerystringFilter by description
addressquerystringFilter by address
postalCodequerystringFilter by postal code
countryquerystringFilter by country
phonequerystringFilter by phone
faxquerystringFilter by fax
mobilequerystringFilter by mobile phone
cityquerystringFilter by city
systemquerybooleanFilter by system type
isArchivedquerybooleanFilter 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

FieldTypeDescription
[].idstringUnique customer identifier
[].taxpayerNumberstring · can be nullTax number (NIF)
[].namestring · can be nullCustomer name
[].photostring · can be nullPhoto URL
[].companyNamestring · can be nullCompany name
[].companyPositionstring · can be nullPosition in the company
[].emailstring · can be nullCustomer email
[].websitestring · can be nullWebsite
[].descriptionstring · can be nullDescription
[].addressstring · can be nullAddress
[].postalCodestring · can be nullPostal code
[].countrystring · can be nullCountry code
[].phonestring · can be nullPhone
[].faxstring · can be nullFax
[].mobilestring · can be nullMobile phone
[].citystring · can be nullCity
[].isArchivedboolean · can be nullWhether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore.

Errors

  • 400 Invalid parameters
  • 401 Unauthorized - API key missing or invalid
  • 429 The 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

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Request body

Data required to create the customer

FieldTypeDescription
name requiredstringCustomer name
firstNamestringFirst name
lastNamestringLast name
emailstringCustomer email
taxpayerNumberstringTax number (NIF)
countrystringCountry code (ISO 3166-1 alpha-2)
phonestringPhone
mobilestringMobile phone
faxstringFax
addressstringAddress
citystringCity
postalCodestringPostal code
websitestringWebsite
companyNamestringCompany name
companyPositionstringPosition in the company
descriptionstringDescription
photostringPhoto 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

FieldTypeDescription
idstringUnique customer identifier
taxpayerNumberstring · can be nullTax number (NIF)
namestring · can be nullCustomer name
photostring · can be nullPhoto URL
companyNamestring · can be nullCompany name
companyPositionstring · can be nullPosition in the company
emailstring · can be nullCustomer email
websitestring · can be nullWebsite
descriptionstring · can be nullDescription
addressstring · can be nullAddress
postalCodestring · can be nullPostal code
countrystring · can be nullCountry code
phonestring · can be nullPhone
faxstring · can be nullFax
mobilestring · can be nullMobile phone
citystring · can be nullCity
isArchivedboolean · can be nullWhether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore.

Errors

  • 400 Invalid data
  • 401 Unauthorized - API key missing or invalid
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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

Authentication: an API key (x-api-key) or an OAuth access token.

Parameters

NameInTypeDescription
id requiredpathstringUnique 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

FieldTypeDescription
idstringUnique customer identifier
taxpayerNumberstring · can be nullTax number (NIF)
namestring · can be nullCustomer name
photostring · can be nullPhoto URL
companyNamestring · can be nullCompany name
companyPositionstring · can be nullPosition in the company
emailstring · can be nullCustomer email
websitestring · can be nullWebsite
descriptionstring · can be nullDescription
addressstring · can be nullAddress
postalCodestring · can be nullPostal code
countrystring · can be nullCountry code
phonestring · can be nullPhone
faxstring · can be nullFax
mobilestring · can be nullMobile phone
citystring · can be nullCity
isArchivedboolean · can be nullWhether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore.

Errors

  • 400 Invalid ID
  • 401 Unauthorized - API key missing or invalid
  • 404 Customer not found
  • 429 The 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

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Parameters

NameInTypeDescription
id requiredpathstringUnique customer identifier

Request body

Customer fields to update

FieldTypeDescription
namestringCustomer name
firstNamestringFirst name
lastNamestringLast name
emailstringCustomer email
taxpayerNumberstringTax number (NIF)
countrystringCountry code (ISO 3166-1 alpha-2)
phonestringPhone
mobilestringMobile phone
faxstringFax
addressstringAddress
citystringCity
postalCodestringPostal code
websitestringWebsite
companyNamestringCompany name
companyPositionstringPosition in the company
descriptionstringDescription
photostringPhoto 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

FieldTypeDescription
idstringUnique customer identifier
taxpayerNumberstring · can be nullTax number (NIF)
namestring · can be nullCustomer name
photostring · can be nullPhoto URL
companyNamestring · can be nullCompany name
companyPositionstring · can be nullPosition in the company
emailstring · can be nullCustomer email
websitestring · can be nullWebsite
descriptionstring · can be nullDescription
addressstring · can be nullAddress
postalCodestring · can be nullPostal code
countrystring · can be nullCountry code
phonestring · can be nullPhone
faxstring · can be nullFax
mobilestring · can be nullMobile phone
citystring · can be nullCity
isArchivedboolean · can be nullWhether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore.

Errors

  • 400 Invalid data
  • 401 Unauthorized - API key missing or invalid
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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.

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Parameters

NameInTypeDescription
id requiredpathstringUnique 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

FieldTypeDescription
idstringUnique customer identifier
taxpayerNumberstring · can be nullTax number (NIF)
namestring · can be nullCustomer name
photostring · can be nullPhoto URL
companyNamestring · can be nullCompany name
companyPositionstring · can be nullPosition in the company
emailstring · can be nullCustomer email
websitestring · can be nullWebsite
descriptionstring · can be nullDescription
addressstring · can be nullAddress
postalCodestring · can be nullPostal code
countrystring · can be nullCountry code
phonestring · can be nullPhone
faxstring · can be nullFax
mobilestring · can be nullMobile phone
citystring · can be nullCity
isArchivedboolean · can be nullWhether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore.

Errors

  • 400 Invalid ID
  • 401 Unauthorized - API key missing or invalid
  • 404 Customer not found
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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.

Authentication: an API key (x-api-key) or an OAuth access token. Send an Idempotency-Key to retry this call safely.

Parameters

NameInTypeDescription
id requiredpathstringUnique 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

FieldTypeDescription
idstringUnique customer identifier
taxpayerNumberstring · can be nullTax number (NIF)
namestring · can be nullCustomer name
photostring · can be nullPhoto URL
companyNamestring · can be nullCompany name
companyPositionstring · can be nullPosition in the company
emailstring · can be nullCustomer email
websitestring · can be nullWebsite
descriptionstring · can be nullDescription
addressstring · can be nullAddress
postalCodestring · can be nullPostal code
countrystring · can be nullCountry code
phonestring · can be nullPhone
faxstring · can be nullFax
mobilestring · can be nullMobile phone
citystring · can be nullCity
isArchivedboolean · can be nullWhether the customer is archived. An archived customer is left out of the default listing and can be restored with POST /customers/{id}/restore.

Errors

  • 400 Invalid ID
  • 401 Unauthorized - API key missing or invalid
  • 404 Customer not found
  • 409 A request with this idempotency key is still being processed, or the outcome of the first attempt is unknown
  • 422 The idempotency key was already used with a different request body
  • 429 The 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.

All resources