---
title: "Criar cliente"
url: "https://devcenter.stone.com.br/apis/v5-docs-legacy/versions/b9aaff36-6dcc-4353-8398-836d6c13dfa5/operations/criar-cliente-1"
---

> Full API specification: https://devcenter.stone.com.br/apis/v5-docs-legacy/versions/b9aaff36-6dcc-4353-8398-836d6c13dfa5.md

# Criar cliente

`POST` `/customers`

Operation ID: `criar-cliente-1`

## Request body

Content types: `application/json`

## Responses

- `200` - 200
- `422` - 422

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Pagar.me v5 API (Legado)
  version: 5.0.0
servers:
  - url: https://api.stone.com.br/core/v5
paths:
  /customers:
    post:
      summary: Criar cliente
      description: ""
      operationId: criar-cliente-1
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: "Nome do cliente. Max: 64 caracteres."
                email:
                  type: string
                  description: "E-mail do cliente. Max: 64 caracteres"
                code:
                  type: string
                  description: "Código de referência do cliente no sistema da loja. Max: 52
                    caracteres"
                document:
                  type: string
                  description: "CPF, CNPJ ou PASSPORT do cliente. Max: 16 caracteres para CPF e
                    CNPJ e Max: 50 caracteres para PASSPORT"
                document_type:
                  type: string
                  description: "Tipo de documento. Valores possíveis: CPF, CNPJ ou PASSPORT."
                type:
                  type: string
                  description: "Tipo de cliente. Valores possíveis: **individual** (pessoa física)
                    ou **company** (pessoa jurídica).<br>**Obrigatório**, caso o
                    `document` seja enviado."
                gender:
                  type: string
                  description: "Sexo do cliente . Valores possíveis: **male** ou **female**"
                address:
                  type: object
                  description: Endereço do cliente.
                  properties:
                    country:
                      type: string
                      description: País (Código do país no formato ISO 3166-1 alpha-2)(2 digitos)
                    state:
                      type: string
                      description: Estado (Código do estado no formato ISO 3166-2).
                    city:
                      type: string
                      description: Cidade.
                    zip_code:
                      type: string
                      description: Código Postal (CEP) (Apenas numérico).
                    line_1:
                      type: string
                      description: Dados principais do endereço. Neste campo deve ser informado
                        Número, Rua, Bairro, nesta ordem e separados por
                        vírgula.
                    line_2:
                      type: string
                      description: Dados complementares do endereço. Neste campo pode ser informado
                        complemento, referências.
                phones:
                  type: object
                  description: Telefones do cliente. [Saiba mais sobre o
                    telefones](https://docs.pagar.me/reference#telefones-1)
                  properties:
                    home_phone:
                      type: object
                      description: Telefone residencial do cliente.
                      properties:
                        country_code:
                          type: string
                          description: Código do País (Apenas numérico).
                        area_code:
                          type: string
                          description: Código da área (Apenas numérico).
                        number:
                          type: string
                          description: Número do telefone (Apenas numérico).
                    mobile_phone:
                      type: object
                      description: Telefone celular do cliente.
                      properties:
                        country_code:
                          type: string
                          description: Código do País (Apenas numérico).
                        area_code:
                          type: string
                          description: Código da área (Apenas numérico).
                        number:
                          type: string
                          description: Número do telefone (Apenas numérico).
                birthdate:
                  type: string
                  description: Data de nascimento do cliente.
                  default: mm/dd/aaa
                  format: date
                metadata:
                  type: string
                  description: Objeto chave/valor utilizado para armazenar informações adicionais
                    sobre o cliente. [Saiba mais sobre
                    metadata](https://docs.pagar.me/reference/metadata-1)
            examples:
              Request Example:
                value:
                  name: Tony Stark
                  email: tonystarkk@avengers.com
                  code: MY_CUSTOMER_001
                  document: "93095135270"
                  type: individual
                  document_type: CPF
                  gender: male
                  address:
                    line_1: 375, Av. General Justo, Centro
                    line_2: 8º andar
                    zip_code: "20021130"
                    city: Rio de Janeiro
                    state: RJ
                    country: BR
                  birthdate: 05/03/1984
                  phones:
                    home_phone:
                      country_code: "55"
                      area_code: "21"
                      number: "000000000"
                    mobile_phone:
                      country_code: "55"
                      area_code: "21"
                      number: "000000000"
                  metadata:
                    company: Avengers
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "id": "cus_QA5V47r9c0Im3dzN",
                        "name": "Tony Stark",
                        "email": "tonystarkk@avengers.com",
                        "code": "MY_CUSTOMER_001",
                        "document": "93095135270",
                        "document_type": "CPF",  
                        "type": "individual",
                        "gender": "male",
                        "delinquent": false,
                        "address": {
                            "id": "addr_KewjagEfrCbY1doZ",
                            "line_1": "375, Av. General Justo, Centro",
                            "line_2": "8º andar",
                            "zip_code": "20021130",
                            "city": "Rio de Janeiro",
                            "state": "RJ",
                            "country": "BR",
                            "status": "active",
                            "created_at": "2017-09-22T15:36:46Z",
                            "updated_at": "2018-04-03T17:46:20Z"
                        },
                        "created_at": "2017-09-22T15:36:46Z",
                        "updated_at": "2018-04-03T17:46:20Z",
                        "birthdate": "1984-05-03T00:00:00Z",
                        "phones": {
                            "home_phone": {
                                "country_code": "55",
                                "number": "000000000",
                                "area_code": "21"
                            },
                            "mobile_phone": {
                                "country_code": "55",
                                "number": "000000000",
                                "area_code": "21"
                            }
                        },
                        "metadata": {
                            "id": "my_customer_id",
                            "company": "Avengers"
                        }
                    }
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: cus_QA5V47r9c0Im3dzN
                  name:
                    type: string
                    example: Tony Stark
                  email:
                    type: string
                    example: tonystarkk@avengers.com
                  code:
                    type: string
                    example: MY_CUSTOMER_001
                  document:
                    type: string
                    example: "93095135270"
                  document_type:
                    type: string
                    example: CPF
                  type:
                    type: string
                    example: individual
                  gender:
                    type: string
                    example: male
                  delinquent:
                    type: boolean
                    example: false
                    default: true
                  address:
                    type: object
                    properties:
                      id:
                        type: string
                        example: addr_KewjagEfrCbY1doZ
                      line_1:
                        type: string
                        example: 375, Av. General Justo, Centro
                      line_2:
                        type: string
                        example: 8º andar
                      zip_code:
                        type: string
                        example: "20021130"
                      city:
                        type: string
                        example: Rio de Janeiro
                      state:
                        type: string
                        example: RJ
                      country:
                        type: string
                        example: BR
                      status:
                        type: string
                        example: active
                      created_at:
                        type: string
                        example: 2017-09-22T15:36:46Z
                      updated_at:
                        type: string
                        example: 2018-04-03T17:46:20Z
                  created_at:
                    type: string
                    example: 2017-09-22T15:36:46Z
                  updated_at:
                    type: string
                    example: 2018-04-03T17:46:20Z
                  birthdate:
                    type: string
                    example: 1984-05-03T00:00:00Z
                  phones:
                    type: object
                    properties:
                      home_phone:
                        type: object
                        properties:
                          country_code:
                            type: string
                            example: "55"
                          number:
                            type: string
                            example: "000000000"
                          area_code:
                            type: string
                            example: "21"
                      mobile_phone:
                        type: object
                        properties:
                          country_code:
                            type: string
                            example: "55"
                          number:
                            type: string
                            example: "000000000"
                          area_code:
                            type: string
                            example: "21"
                  metadata:
                    type: object
                    properties:
                      id:
                        type: string
                        example: my_customer_id
                      company:
                        type: string
                        example: Avengers
        "422":
          description: "422"
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "message": "The request is invalid.",
                        "errors": {
                            "customer.name": [
                                "The name field is required."
                            ]
                        },
                        "request": {
                            "email": "tonystarkk@avengers.com",
                            "code": "MY_CUSTOMER_001",
                            "document": "123456789",
                            "type": "individual",
                            "address": {
                                "line_1": "375, Av. General Justo, Centro",
                                "line_2": "8º andar",
                                "zip_code": "20021130",
                                "city": "Rio de Janeiro",
                                "state": "RJ",
                                "country": "BR"
                            },
                            "birthdate": "1984-05-03T00:00:00Z",
                            "phones": {
                                "home_phone": {
                                    "country_code": "55",
                                    "number": "000000000",
                                    "area_code": "21"
                                },
                                "mobile_phone": {
                                    "country_code": "55",
                                    "number": "000000000",
                                    "area_code": "21"
                                }
                            },
                            "gender": "male",
                            "metadata": {
                                "company": "Avengers"
                            }
                        }
                    }
      deprecated: false
security:
  - sec0: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic
```
