{
	"$schema": "http://json-schema.org/draft-03/schema#",
	"title": "Customer groups collection Schema",
	"description": "A schema for retrieving a collection of customer groups.",
	"type": "object",
	"restdocs": "http://restdocs.e-conomic.com/#get-customer-groups-customergroupnumber-customers",
	"properties": {
		"collection": {
			"type": "array",
			"description": "A collection of the customer groups.",
      "items": {
        "title": "Customer",
        "type": "object",
        "description": "A schema for information about a customer group.",
        "properties": {
          "barred": {
            "type": "boolean",
            "description": "Boolean indication of whether the customer is barred from invoicing."
          },
          "address": {
            "type": "string",
            "maxLength": 510,
            "sortable": true,
            "filterable": true,
            "description": "Address for the customer including street and number."
          },
          "balance": {
            "type": "number",
            "readOnly": true,
            "sortable": true,
            "filterable": true,
            "description": "The outstanding amount for this customer."
          },
          "corporateIdentificationNumber": {
            "type": "string",
            "maxLength": 40,
            "sortable": true,
            "filterable": true,
            "description": "Company Identification Number. For example CVR in Denmark."
          },
          "pNumber": {
            "type": "string",
            "minLength": 10,
            "maxLength": 10,
            "description": "Extension of corporate identification number (CVR). Identifying separate production unit (p-nummer)."
          },
          "city": {
            "type": "string",
            "maxLength": 50,
            "sortable": true,
            "filterable": true,
            "description": "The customer's city."
          },
          "country": {
            "type": "string",
            "maxLength": 50,
            "sortable": true,
            "filterable": true,
            "description": "The customer's country."
          },
          "creditLimit": {
            "type": "number",
            "sortable": true,
            "filterable": true,
            "description": "A maximum credit for this customer. Once the maximum is reached or passed in connection with an order/quotation/invoice for this customer you see a warning in e-conomic."
          },
          "currency": {
            "type": "string",
            "maxLength": 3,
            "minLength": 3,
            "required": true,
            "sortable": true,
            "filterable": true,
            "description": "Default payment currency."
          },
          "customerGroup": {
            "type": "object",
            "required": true,
            "description": "In order to set up a new customer, it is necessary to specify a customer group. It is useful to group a company’s customers (e.g., ‘domestic’ and ‘foreign’ customers) and to link the group members to the same account when generating reports.",
            "properties": {
              "customerGroupNumber": {
                "type": "integer",
                "description": "The unique identifier of the customer group."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "description": "A unique link reference to the customer group item.",
                "required": true
              }
            }
          },
          "customerNumber": {
            "type": "integer",
            "maximum": 999999999,
            "minimum": 1,
            "sortable": true,
            "filterable": true,
            "description": "The customer number is a positive unique numerical identifier with a maximum of 9 digits."
          },
          "ean": {
            "type": "string",
            "maxLength": 13,
            "sortable": true,
            "filterable": true,
            "description": "European Article Number. EAN is used for invoicing the Danish public sector."
          },
          "email": {
            "type": "string",
            "maxLength": 255,
            "sortable": true,
            "filterable": true,
            "description": "Customer e-mail address where e-conomic invoices should be emailed. Note: you can specify multiple email addresses in this field, separated by a space. If you need to send a copy of the invoice or write to other e-mail addresses, you can also create one or more customer contacts."
          },
          "vatZone": {
            "type": "object",
            "required": true,
            "description": "Indicates in which VAT-zone the customer is located (e.g.: domestically, in Europe or elsewhere abroad).",
            "properties": {
              "vatZoneNumber": {
                "type": "integer",
                "description": "The unique identifier of the VAT-zone."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "description": "A unique link reference to the VAT-zone item.",
                "required": true
              }
            }
          },
          "layout": {
            "type": "object",
            "description": "Layout to be applied for invoices and other documents for this customer.",
            "properties": {
              "layoutNumber": {
                "type": "integer",
                "description": "The unique identifier of the layout."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "description": "A unique link reference to the layout item.",
                "required": true
              }
            }
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "required": true,
            "sortable": true,
            "filterable": true,
            "description": "The customer name."
          },
          "paymentTerms": {
            "type": "object",
            "required": true,
            "description": "The default payment terms for the customer.",
            "properties": {
              "paymentTermsNumber": {
                "type": "integer",
                "description": "The unique identifier of the payment terms."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "description": "A unique link reference to the payment terms item.",
                "required": true
              }
            }
          },
          "zip": {
            "type": "string",
            "maxLength": 30,
            "sortable": true,
            "filterable": true,
            "description": "The customer's postcode."
          },
          "publicEntryNumber": {
            "type": "string",
            "maxLength": 50,
            "sortable": true,
            "filterable": true,
            "description": "The public entry number is used for electronic invoicing, to define the account invoices will be registered on at the customer."
          },
          "telephoneAndFaxNumber": {
            "type": "string",
            "maxLength": 255,
            "sortable": true,
            "filterable": true,
            "description": "The customer's telephone and/or fax number."
          },
          "mobilePhone": {
            "type": "string",
            "maxLength": 50,
            "sortable": true,
            "filterable": true,
            "description": "The customer's mobile phone number."
          },
          "vatNumber": {
            "type": "string",
            "maxLength": 20,
            "sortable": true,
            "filterable": true,
            "description": "The customer's value added tax identification number. This field is only available to agreements in Sweden, UK, Germany, Poland and Finland. Not to be mistaken for the danish CVR number, which is defined on the ciNucorporateIdentificationNumber property."
          },
          "website": {
            "type": "string",
            "maxLength": 255,
            "sortable": true,
            "filterable": true,
            "description": "Customer website, if applicable."
          },
          "attention": {
            "type": "object",
            "description": "The customer's person of attention.",
            "properties": {
              "customerContactNumber": {
                "type": "integer",
                "description": "The unique identifier of the customer employee."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "description": "A unique link reference to the customer employee item.",
                "required": true
              }
            }
          },
          "customerContact": {
            "type": "object",
            "description": "Reference to main contact employee at customer.",
            "properties": {
              "customerContactNumber": {
                "type": "integer",
                "description": "The unique identifier of the customer contact."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "description": "A unique link reference to the customer contact item.",
                "required": true
              }
            }
          },
          "salesPerson": {
            "type": "object",
            "description": "Reference to the employee responsible for contact with this customer.",
            "properties": {
              "employeeNumber": {
                "type": "integer",
                "description": "The unique identifier of the employee."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "description": "A unique link reference to the employee resource.",
                "required": true
              }
            }
          },
          "self": {
            "type": "string",
            "format": "uri",
            "description": "The unique self reference of the customer resource.",
            "required": true
          }
        }
      }
		},
		"metaData": {
			"type": "object",
			"description": "Information about possible actions, endpoints and resource paths related to the endpoint."
		},
		"pagination": {
			"type": "object",
			"description": "Information about the pagination."
		},
		"self": {
			"type": "string",
			"format": "uri",
			"description": "The unique self reference of the accounts collection.",
			"required": true
		}
	}
}
