> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.gomoney.me/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.gomoney.me/_mcp/server.

# Atualizar customer

PATCH https://gmc-api.gomoney.me/api/customers/{customerId}
Content-Type: application/json

Atualiza os dados de um customer pertencente ao usuário autenticado.
A hierarquia aplicada nas taxa das emissões PIX é `customer -> user -> settings`.
O endpoint exige `Bearer token` e `secret-key`.


Reference: https://docs.gomoney.me/api-reference/open-api-explorer/customers/update-customer

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: gomoney-docs-postman-collection
  version: 1.0.0
paths:
  /customers/{customerId}:
    patch:
      operationId: update-customer
      summary: Atualizar customer
      description: >
        Atualiza os dados de um customer pertencente ao usuário autenticado.

        A hierarquia aplicada nas taxa das emissões PIX é `customer -> user ->
        settings`.

        O endpoint exige `Bearer token` e `secret-key`.
      tags:
        - customers
      parameters:
        - name: customerId
          in: path
          description: Identificador do customer.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Token retornado pelo endpoint `/auth/login`.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Customer atualizado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatedCustomer'
        '400':
          description: Corpo inválido.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Token ou secret-key inválidos.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Customer não pertence ao usuário autenticado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Customer não encontrado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomerRequest'
servers:
  - url: https://gmc-api.gomoney.me/api
    description: Base URL da API da plataforma
  - url: https://api-pix.gomoney.me
    description: Base URL da API PIX
components:
  schemas:
    UpdateCustomerRequest:
      type: object
      properties:
        taxId:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
      title: UpdateCustomerRequest
    UpdatedCustomer:
      type: object
      properties:
        _id:
          type: string
        taxId:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
      title: UpdatedCustomer
    ValidationErrorMessage:
      oneOf:
        - type: string
        - type: array
          items:
            type: string
      title: ValidationErrorMessage
    ValidationError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          $ref: '#/components/schemas/ValidationErrorMessage'
        error:
          type: string
      title: ValidationError
    UnauthorizedError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      title: UnauthorizedError
    ForbiddenError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      title: ForbiddenError
    NotFoundError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      title: NotFoundError
  securitySchemes:
    accessTokenBearer:
      type: http
      scheme: bearer
      description: Token retornado pelo endpoint `/auth/login`.
    secretKeyHeader:
      type: apiKey
      in: header
      name: secret-key
      description: Chave Base64 no formato `btoa(clientKey:clientSecret)`.

```

## Examples

### success



**Request**

```json
undefined
```

**Response**

```json
{
  "_id": "66f0b1b5c1f7b7dc0ce30001",
  "taxId": "39053344705",
  "name": "Cliente Externo 01 Atualizado",
  "email": "cliente01.updated@example.com"
}
```

**SDK Code**

```python success
import requests

url = "https://gmc-api.gomoney.me/api/customers/customerId"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, headers=headers)

print(response.json())
```

```javascript success
const url = 'https://gmc-api.gomoney.me/api/customers/customerId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go success
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://gmc-api.gomoney.me/api/customers/customerId"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby success
require 'uri'
require 'net/http'

url = URI("https://gmc-api.gomoney.me/api/customers/customerId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://gmc-api.gomoney.me/api/customers/customerId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://gmc-api.gomoney.me/api/customers/customerId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp success
using RestSharp;

var client = new RestClient("https://gmc-api.gomoney.me/api/customers/customerId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift success
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://gmc-api.gomoney.me/api/customers/customerId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### default



**Request**

```json
{
  "name": "Cliente Externo 01 Atualizado",
  "email": "cliente01.updated@example.com"
}
```

**Response**

```json
{
  "_id": "66f0b1b5c1f7b7dc0ce30001",
  "taxId": "39053344705",
  "name": "Cliente Externo 01 Atualizado",
  "email": "cliente01.updated@example.com"
}
```

**SDK Code**

```python default
import requests

url = "https://gmc-api.gomoney.me/api/customers/customerId"

payload = {
    "name": "Cliente Externo 01 Atualizado",
    "email": "cliente01.updated@example.com"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript default
const url = 'https://gmc-api.gomoney.me/api/customers/customerId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Cliente Externo 01 Atualizado","email":"cliente01.updated@example.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go default
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://gmc-api.gomoney.me/api/customers/customerId"

	payload := strings.NewReader("{\n  \"name\": \"Cliente Externo 01 Atualizado\",\n  \"email\": \"cliente01.updated@example.com\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby default
require 'uri'
require 'net/http'

url = URI("https://gmc-api.gomoney.me/api/customers/customerId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Cliente Externo 01 Atualizado\",\n  \"email\": \"cliente01.updated@example.com\"\n}"

response = http.request(request)
puts response.read_body
```

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://gmc-api.gomoney.me/api/customers/customerId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Cliente Externo 01 Atualizado\",\n  \"email\": \"cliente01.updated@example.com\"\n}")
  .asString();
```

```php default
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://gmc-api.gomoney.me/api/customers/customerId', [
  'body' => '{
  "name": "Cliente Externo 01 Atualizado",
  "email": "cliente01.updated@example.com"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp default
using RestSharp;

var client = new RestClient("https://gmc-api.gomoney.me/api/customers/customerId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Cliente Externo 01 Atualizado\",\n  \"email\": \"cliente01.updated@example.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Cliente Externo 01 Atualizado",
  "email": "cliente01.updated@example.com"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://gmc-api.gomoney.me/api/customers/customerId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```