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

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

# Editar cliente

`PUT` `/customers/{customer_id}`

Operation ID: `editar-cliente-1`

## Path parameters

- `customer_id` (string, required) - Código do cliente. Formato `cus_XXXXXXXXXXXXXXXX`.

## 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/{customer_id}:
    put:
      summary: Editar cliente
      description: ""
      operationId: editar-cliente-1
      parameters:
        - name: customer_id
          in: path
          description: Código do cliente. Formato `cus_XXXXXXXXXXXXXXXX`.
          schema:
            type: string
          required: true
      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 PASSAPORTE do cliente. Max: 16 caracteres para CPF e
                    CNPJ e Max: 50 caracteres para PASSAPORTE"
                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. [Saiba mais sobre
                    endereços](https://docs.pagar.me/reference/endere%C3%A7os)
                  properties: {}
                phone:
                  type: object
                  description: Telefones do cliente. [Saiba mais sobre o
                    telefones](https://docs.pagar.me/reference#telefones-1)
                  properties: {}
                birthdate:
                  type: string
                  description: Data de nascimento do cliente.
                  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: Peter Parker
                  email: parker@avengers.com
                  gender: male
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                      "id": "cus_6l5dMWZ0hkHZ4XnE",
                      "name": "Peter Parker",
                      "email": "parker@avengers.com",
                      "document": "26224451990",
                      "gender": "male",
                      "type": "individual",
                      "delinquent": false,
                      "created_at": "2017-05-02T23:26:49Z",
                      "updated_at": "2017-05-02T23:28:16Z",
                      "phones": {
                        "home_phone": {
                          "country_code": "55",
                          "number": "0000002000",
                          "area_code": "021"
                        }
                      },
                      "metadata": {
                        "id": "my_customer_id"
                      }
                    }
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: cus_6l5dMWZ0hkHZ4XnE
                  name:
                    type: string
                    example: Peter Parker
                  email:
                    type: string
                    example: parker@avengers.com
                  document:
                    type: string
                    example: "26224451990"
                  gender:
                    type: string
                    example: male
                  type:
                    type: string
                    example: individual
                  delinquent:
                    type: boolean
                    example: false
                    default: true
                  created_at:
                    type: string
                    example: 2017-05-02T23:26:49Z
                  updated_at:
                    type: string
                    example: 2017-05-02T23:28:16Z
                  phones:
                    type: object
                    properties:
                      home_phone:
                        type: object
                        properties:
                          country_code:
                            type: string
                            example: "55"
                          number:
                            type: string
                            example: "0000002000"
                          area_code:
                            type: string
                            example: "021"
                  metadata:
                    type: object
                    properties:
                      id:
                        type: string
                        example: my_customer_id
        "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
```
