# Customers

## GET /customers

> Returns all customers

```json
{"openapi":"3.0.1","info":{"title":"P4W Api Gateway","version":"v1"},"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"Api key taken from 'Gateway API key' setting.","name":"ApiKey","in":"header"}},"schemas":{"CustomerDetails":{"type":"object","properties":{"companyName":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddress"},"nullable":true},"id":{"type":"string","format":"uuid"},"client":{"$ref":"#/components/schemas/ClientGetList"},"customerCode":{"type":"string","nullable":true},"isDiscontinued":{"type":"boolean"}},"additionalProperties":false},"CustomerAddress":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"attnTo":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"routeNumber":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"stateProvince":{"type":"string","nullable":true},"zipPostalCode":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"isDefault":{"type":"boolean"}},"additionalProperties":false},"ClientGetList":{"type":"object","properties":{"description":{"type":"string","nullable":true},"ssccCompanyId":{"type":"string","nullable":true},"companyName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"stateProvince":{"type":"string","nullable":true},"zipPostalCode":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/customers":{"get":{"tags":["Customers"],"summary":"Returns all customers","parameters":[{"name":"CustomerCode","in":"query","schema":{"type":"string"}},{"name":"ClientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"Page","in":"query","schema":{"type":"integer","format":"int32"}},{"name":"PageSize","in":"query","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerDetails"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerDetails"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerDetails"}}}}},"406":{"description":"Not Acceptable","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## POST /customers

> Create new customer

```json
{"openapi":"3.0.1","info":{"title":"P4W Api Gateway","version":"v1"},"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"Api key taken from 'Gateway API key' setting.","name":"ApiKey","in":"header"}},"schemas":{"CustomerCreate":{"type":"object","properties":{"companyName":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddress"},"nullable":true},"clientId":{"type":"string","format":"uuid","nullable":true},"customerCode":{"type":"string","nullable":true}},"additionalProperties":false},"CustomerAddress":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"attnTo":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"routeNumber":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"stateProvince":{"type":"string","nullable":true},"zipPostalCode":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"isDefault":{"type":"boolean"}},"additionalProperties":false},"IdDocument":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"additionalProperties":false}}},"paths":{"/customers":{"post":{"tags":["Customers"],"summary":"Create new customer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}},"text/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/IdDocument"}},"application/json":{"schema":{"$ref":"#/components/schemas/IdDocument"}},"text/json":{"schema":{"$ref":"#/components/schemas/IdDocument"}}}},"406":{"description":"Not Acceptable","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## PUT /customers

> Update an existing customer

```json
{"openapi":"3.0.1","info":{"title":"P4W Api Gateway","version":"v1"},"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"Api key taken from 'Gateway API key' setting.","name":"ApiKey","in":"header"}},"schemas":{"CustomerUpdate":{"type":"object","properties":{"companyName":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddress"},"nullable":true},"id":{"type":"string","format":"uuid"}},"additionalProperties":false},"CustomerAddress":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"attnTo":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"routeNumber":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"stateProvince":{"type":"string","nullable":true},"zipPostalCode":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"isDefault":{"type":"boolean"}},"additionalProperties":false},"IdDocument":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"additionalProperties":false}}},"paths":{"/customers":{"put":{"tags":["Customers"],"summary":"Update an existing customer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}},"text/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/IdDocument"}},"application/json":{"schema":{"$ref":"#/components/schemas/IdDocument"}},"text/json":{"schema":{"$ref":"#/components/schemas/IdDocument"}}}},"406":{"description":"Not Acceptable","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## GET /customers/{id}

> Returns a single customer by id

```json
{"openapi":"3.0.1","info":{"title":"P4W Api Gateway","version":"v1"},"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"Api key taken from 'Gateway API key' setting.","name":"ApiKey","in":"header"}},"schemas":{"CustomerDetails":{"type":"object","properties":{"companyName":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/CustomerAddress"},"nullable":true},"id":{"type":"string","format":"uuid"},"client":{"$ref":"#/components/schemas/ClientGetList"},"customerCode":{"type":"string","nullable":true},"isDiscontinued":{"type":"boolean"}},"additionalProperties":false},"CustomerAddress":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"attnTo":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"routeNumber":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"stateProvince":{"type":"string","nullable":true},"zipPostalCode":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"isDefault":{"type":"boolean"}},"additionalProperties":false},"ClientGetList":{"type":"object","properties":{"description":{"type":"string","nullable":true},"ssccCompanyId":{"type":"string","nullable":true},"companyName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"stateProvince":{"type":"string","nullable":true},"zipPostalCode":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/customers/{id}":{"get":{"tags":["Customers"],"summary":"Returns a single customer by id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/CustomerDetails"}},"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDetails"}},"text/json":{"schema":{"$ref":"#/components/schemas/CustomerDetails"}}}},"406":{"description":"Not Acceptable","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```

## DELETE /customers/{id}

> Delete customer by Id

```json
{"openapi":"3.0.1","info":{"title":"P4W Api Gateway","version":"v1"},"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","description":"Api key taken from 'Gateway API key' setting.","name":"ApiKey","in":"header"}}},"paths":{"/customers/{id}":{"delete":{"tags":["Customers"],"summary":"Delete customer by Id","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"406":{"description":"Not Acceptable","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.p4.software/english-1/customers-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
