Zum Inhalt

Reference

Companies

GET/api/v1/companiesSearch companies

Finds companies by name or city, 50 per page, alphabetically. Use get_company for one company's details, people and orders.scope customers:read

Query

querystringWords to find in the name or city.
roleone of customer, supplier
include_inactivebooleanInclude deactivated rows. Default: only active ones, as the lists in nxva.base show.
pageinteger1-based page of 50 rows. Omit for the first page.

Response 200

items[]object[]
items[].idstring
items[].namestring
items[].citystring | null
items[].is_customerboolean
items[].is_supplierboolean
items[].is_activeboolean
items[].peopleinteger
items[].urlstring
pageinteger
totalinteger
has_moreboolean
Schema
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_customer": {
            "type": "boolean"
          },
          "is_supplier": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "people": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "city",
          "is_customer",
          "is_supplier",
          "is_active",
          "people",
          "url"
        ],
        "additionalProperties": false
      }
    },
    "page": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "total": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "items",
    "page",
    "total",
    "has_more"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

POST/api/v1/companiesCreate company

Creates a company -- a customer by default. Refused when an active company of the same name exists, with its id: use that one, or pass allow_duplicate when it really is a different company. Search first with search_companies.scope customers:write

Body (JSON)

namerequiredstring
is_customerbooleanDefault: true.
is_supplierbooleanDefault: false. A company can be both.
streetstringStreet and number. An empty string clears it; omit it to leave it as it is.
zipstringPostcode. An empty string clears it; omit it to leave it as it is.
citystringCity. An empty string clears it; omit it to leave it as it is.
vat_idstringVAT id, e.g. DE123456789. An empty string clears it; omit it to leave it as it is.
country_codestringISO 3166-1 alpha-2, e.g. "DE". Decides reverse charge on invoices. Default for a new company: DE.
document_languageone of de, enThe language quotes and invoices to this company are written in. Default for a new company: de.
avv_signed_onstringThe day the data processing agreement (AVV) was signed, YYYY-MM-DD, not in the future. An empty string clears it. Without it, provisioning does not start an instance for this company.
business_evidence_notestringWhy this company counts as a business for VAT, as evidence. An empty string clears it; omit it to leave it as it is.
payment_term_daysinteger | nullDays an invoice to this company is due in, proposed on its quotes and used on its free invoices. null clears it: the billing settings' default applies. Omit it to leave it as it is.
allow_duplicatebooleanCreate it even though an active company has this name.

Response 200

idstring
createdboolean
namestring
streetstring | null
zipstring | null
citystring | null
vat_idstring | null
country_codestring
document_languagestring
payment_term_daysinteger | null
avv_signed_onstring | null
is_customerboolean
is_supplierboolean
is_activeboolean
mail_recipients[]optionalobject[]
mail_recipients[].kindstring
mail_recipients[].rolestring
mail_recipients[].personobject | null
mail_recipients[].person.idstring
mail_recipients[].person.namestring
mail_recipients[].emailstring | null
ticket_sources[]optionalobject[]
ticket_sources[].idstring
ticket_sources[].labelstring
ticket_sources[].kindstring
ticket_sources[].addressstring
ticket_sources[].activeboolean
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "created": {
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "street": {
      "type": [
        "string",
        "null"
      ]
    },
    "zip": {
      "type": [
        "string",
        "null"
      ]
    },
    "city": {
      "type": [
        "string",
        "null"
      ]
    },
    "vat_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "country_code": {
      "type": "string"
    },
    "document_language": {
      "type": "string"
    },
    "payment_term_days": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "avv_signed_on": {
      "type": [
        "string",
        "null"
      ]
    },
    "is_customer": {
      "type": "boolean"
    },
    "is_supplier": {
      "type": "boolean"
    },
    "is_active": {
      "type": "boolean"
    },
    "mail_recipients": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "person": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "role",
          "person",
          "email"
        ],
        "additionalProperties": false
      }
    },
    "ticket_sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "address",
          "active"
        ],
        "additionalProperties": false
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "created",
    "name",
    "street",
    "zip",
    "city",
    "vat_id",
    "country_code",
    "document_language",
    "payment_term_days",
    "avv_signed_on",
    "is_customer",
    "is_supplier",
    "is_active",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

GET/api/v1/companies/{id}Get company

One company: address, VAT id, note, its people, its orders, how many of its tasks are still open, who receives its invoices and order documents, and the ticket systems its mails come from.scope customers:read

Path

idrequiredstringThe company's id, from search_companies.

Response 200

idstring
namestring
streetstring | null
zipstring | null
citystring | null
country_codestring
vat_idstring | null
payment_term_daysinteger | null
avv_signed_onstring | null
notestring | null
is_customerboolean
is_supplierboolean
is_activeboolean
people[]object[]
people[].idstring
people[].namestring
people[].emailstring | null
people[].phonestring | null
people[].positionstring | null
people[].is_activeboolean
orders[]optionalobject[]
orders[].idstring
orders[].numberstring
orders[].titlestring
orders[].statusstring
mail_recipients[]optionalobject[]
mail_recipients[].kindstring
mail_recipients[].rolestring
mail_recipients[].personobject | null
mail_recipients[].person.idstring
mail_recipients[].person.namestring
mail_recipients[].emailstring | null
ticket_sources[]optionalobject[]
ticket_sources[].idstring
ticket_sources[].labelstring
ticket_sources[].kindstring
ticket_sources[].addressstring
ticket_sources[].key_patternstring | null
ticket_sources[].activeboolean
ticket_sources[].default_orderstring | null
ticket_sources[].fallback_personstring | null
ticket_sources[].answer_modestring
ticket_sources[].answer_addressstring | null
open_tasksinteger
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "street": {
      "type": [
        "string",
        "null"
      ]
    },
    "zip": {
      "type": [
        "string",
        "null"
      ]
    },
    "city": {
      "type": [
        "string",
        "null"
      ]
    },
    "country_code": {
      "type": "string"
    },
    "vat_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "payment_term_days": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "avv_signed_on": {
      "type": [
        "string",
        "null"
      ]
    },
    "note": {
      "type": [
        "string",
        "null"
      ]
    },
    "is_customer": {
      "type": "boolean"
    },
    "is_supplier": {
      "type": "boolean"
    },
    "is_active": {
      "type": "boolean"
    },
    "people": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "position": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "position",
          "is_active"
        ],
        "additionalProperties": false
      }
    },
    "orders": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "title",
          "status"
        ],
        "additionalProperties": false
      }
    },
    "mail_recipients": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "person": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "role",
          "person",
          "email"
        ],
        "additionalProperties": false
      }
    },
    "ticket_sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "key_pattern": {
            "type": [
              "string",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "default_order": {
            "type": [
              "string",
              "null"
            ]
          },
          "fallback_person": {
            "type": [
              "string",
              "null"
            ]
          },
          "answer_mode": {
            "type": "string"
          },
          "answer_address": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "address",
          "key_pattern",
          "active",
          "default_order",
          "fallback_person",
          "answer_mode",
          "answer_address"
        ],
        "additionalProperties": false
      }
    },
    "open_tasks": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "name",
    "street",
    "zip",
    "city",
    "country_code",
    "vat_id",
    "payment_term_days",
    "avv_signed_on",
    "note",
    "is_customer",
    "is_supplier",
    "is_active",
    "people",
    "open_tasks",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

PATCH/api/v1/companies/{id}Update company

Changes a company's name, roles, address, VAT id, country, document language, payment term or AVV date. Only the fields given change. A role stays while quotes or contracts rely on it.scope customers:write

Path

idrequiredstringThe company's id, from search_companies.

Body (JSON)

namestring
is_customerboolean
is_supplierboolean
activebooleanfalse deactivates the company: it stays, with its quotes and orders, but is no longer offered. true activates it again.
streetstringStreet and number. An empty string clears it; omit it to leave it as it is.
zipstringPostcode. An empty string clears it; omit it to leave it as it is.
citystringCity. An empty string clears it; omit it to leave it as it is.
vat_idstringVAT id, e.g. DE123456789. An empty string clears it; omit it to leave it as it is.
country_codestringISO 3166-1 alpha-2, e.g. "DE". Decides reverse charge on invoices. Default for a new company: DE.
document_languageone of de, enThe language quotes and invoices to this company are written in. Default for a new company: de.
avv_signed_onstringThe day the data processing agreement (AVV) was signed, YYYY-MM-DD, not in the future. An empty string clears it. Without it, provisioning does not start an instance for this company.
business_evidence_notestringWhy this company counts as a business for VAT, as evidence. An empty string clears it; omit it to leave it as it is.
payment_term_daysinteger | nullDays an invoice to this company is due in, proposed on its quotes and used on its free invoices. null clears it: the billing settings' default applies. Omit it to leave it as it is.

Response 200

idstring
createdboolean
namestring
streetstring | null
zipstring | null
citystring | null
vat_idstring | null
country_codestring
document_languagestring
payment_term_daysinteger | null
avv_signed_onstring | null
is_customerboolean
is_supplierboolean
is_activeboolean
mail_recipients[]optionalobject[]
mail_recipients[].kindstring
mail_recipients[].rolestring
mail_recipients[].personobject | null
mail_recipients[].person.idstring
mail_recipients[].person.namestring
mail_recipients[].emailstring | null
ticket_sources[]optionalobject[]
ticket_sources[].idstring
ticket_sources[].labelstring
ticket_sources[].kindstring
ticket_sources[].addressstring
ticket_sources[].activeboolean
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "created": {
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "street": {
      "type": [
        "string",
        "null"
      ]
    },
    "zip": {
      "type": [
        "string",
        "null"
      ]
    },
    "city": {
      "type": [
        "string",
        "null"
      ]
    },
    "vat_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "country_code": {
      "type": "string"
    },
    "document_language": {
      "type": "string"
    },
    "payment_term_days": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "avv_signed_on": {
      "type": [
        "string",
        "null"
      ]
    },
    "is_customer": {
      "type": "boolean"
    },
    "is_supplier": {
      "type": "boolean"
    },
    "is_active": {
      "type": "boolean"
    },
    "mail_recipients": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "person": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "role",
          "person",
          "email"
        ],
        "additionalProperties": false
      }
    },
    "ticket_sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "address",
          "active"
        ],
        "additionalProperties": false
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "created",
    "name",
    "street",
    "zip",
    "city",
    "vat_id",
    "country_code",
    "document_language",
    "payment_term_days",
    "avv_signed_on",
    "is_customer",
    "is_supplier",
    "is_active",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.