# Criar Comprador

## Cria um buyer

> Cria um buyer e retorna o seu identificador (UUID) junto aos dados fornecidos

```json
{"openapi":"3.0.3","info":{"title":"API de Buyers","version":"2.0.0"},"servers":[{"url":"https://api.barte.com","description":"Servidor de Produção"},{"url":"https://sandbox-api.barte.com","description":"Servidor de Sandbox"}],"security":[{"X-Token-Api":[]}],"components":{"securitySchemes":{"X-Token-Api":{"type":"apiKey","name":"X-Token-Api","in":"header"}},"schemas":{"CreateBuyerV2Request":{"type":"object","required":["document","name","email","phone"],"properties":{"document":{"$ref":"#/components/schemas/DocumentRequest"},"name":{"type":"string","maxLength":255},"email":{"type":"string","maxLength":150,"format":"email"},"countryCode":{"type":"string","maxLength":4},"phone":{"type":"string","maxLength":11,"pattern":"^\\d{10,11}$"},"alternativeEmail":{"type":"string","maxLength":150,"format":"email"},"address":{"$ref":"#/components/schemas/AddressSellerClientRequest"}}},"DocumentRequest":{"type":"object","required":["documentNumber","documentType","documentNation"],"properties":{"documentNumber":{"type":"string"},"documentType":{"type":"string","enum":["cpf","cnpj"]},"documentNation":{"type":"string"}}},"AddressSellerClientRequest":{"type":"object","properties":{"street":{"type":"string"},"number":{"type":"string"},"complement":{"type":"string"},"district":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"},"zipCode":{"type":"string"}}},"BuyerV2Response":{"type":"object","properties":{"uuid":{"type":"string"},"document":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"alternativeEmail":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"ErrorDetail":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"string","enum":["PAYMENT-0000","PAYMENT-0500","PAYMENT-9999","BAR-7001","BAD_REQUEST","FORBIDDEN","METHOD_NOT_ALLOWED","NOT_ACCEPTABLE","UNSUPPORTED_MEDIA_TYPE"]},"title":{"type":"string","enum":["BUSINESS_SELLER","BUSINESS_CHECKOUT","BUSINESS_COMMON","BUSINESS_SECURITY","BUSINESS_SUBSCRIPTION","INVALID_REQUEST_PARAM","BUSINESS_METRIC","BUSINESS_ACCOUNTANCY","BUSINESS_NOTIFICATION","BUSINESS_BARTE","BUSINESS_COMPANY","BUSINESS_INVOICE","BUSINESS_TRANSFER","BUSINESS_CARD","BUSINESS_ORDER","card_not_supported"]},"description":{"type":"string"},"action":{"type":"string"},"additionalInfo":{"type":"object","additionalProperties":{"type":"object"}}}},"Metadata":{"type":"object","properties":{"totalRecords":{"type":"integer"},"totalPages":{"type":"integer"},"requestDatetime":{"type":"string","format":"date-time"}}}}},"paths":{"/v2/buyers":{"post":{"tags":["API v2 para criação de Buyers"],"summary":"Cria um buyer","description":"Cria um buyer e retorna o seu identificador (UUID) junto aos dados fornecidos","operationId":"createBuyer","requestBody":{"description":"Dados do buyer a ser criado","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuyerV2Request"}}}},"responses":{"201":{"description":"buyer cadastrado com sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyerV2Response"}}}},"400":{"description":"Requisição inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Não autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Acesso proibido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Erro interno do servidor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# 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.barte.com/api-reference/compradores/criar-comprador.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.
