> 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.

# Criar customer

POST https://gmc-api.gomoney.me/api/customers
Content-Type: application/json

Cria um novo customer vinculado ao usuário autenticado e gera automaticamente
uma wallet para esse customer.

Este endpoint exige:
- `Authorization: Bearer <accessToken>`
- `secret-key: btoa(clientKey:clientSecret)`


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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: gomoney-docs-postman-collection
  version: 1.0.0
paths:
  /customers:
    post:
      operationId: create-customer
      summary: Criar customer
      description: >
        Cria um novo customer vinculado ao usuário autenticado e gera
        automaticamente

        uma wallet para esse customer.


        Este endpoint exige:

        - `Authorization: Bearer <accessToken>`

        - `secret-key: btoa(clientKey:clientSecret)`
      tags:
        - customers
      parameters:
        - name: Authorization
          in: header
          description: Token retornado pelo endpoint `/auth/login`.
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Customer criado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          description: Corpo inválido ou campos obrigatórios ausentes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Token ou secret-key inválidos.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
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:
    CreateCustomerRequest:
      type: object
      properties:
        taxId:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
      required:
        - taxId
        - name
        - email
      title: CreateCustomerRequest
    CurrencyBalance:
      type: object
      properties:
        currency:
          type: string
        amount:
          type: number
          format: double
      title: CurrencyBalance
    CustomerWallet:
      type: object
      properties:
        address:
          type: string
          description: Endereço público da wallet do customer.
      title: CustomerWallet
    TaxRate:
      type: object
      properties:
        pixTax:
          type: number
          format: double
        pixTaxPercentage:
          type: number
          format: double
      title: TaxRate
    Customer:
      type: object
      properties:
        _id:
          type: string
        userId:
          type: string
        taxId:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
        deleted:
          type: boolean
        balance:
          $ref: '#/components/schemas/CurrencyBalance'
        wallet:
          $ref: '#/components/schemas/CustomerWallet'
        taxRate:
          $ref: '#/components/schemas/TaxRate'
          description: >-
            Taxa administrativa aplicada por hierarquia `customer -> user ->
            settings`.
      title: Customer
    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
  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",
  "userId": "66f0b1b5c1f7b7dc0ce20001",
  "taxId": "39053344705",
  "name": "Cliente Externo 01",
  "email": "cliente01@example.com",
  "deleted": false,
  "balance": {
    "currency": "BRL",
    "amount": 0
  },
  "wallet": {
    "address": "0x2222222222222222222222222222222222222222"
  }
}
```

**SDK Code**

```python success
import requests

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

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

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

print(response.json())
```

```javascript success
const url = 'https://gmc-api.gomoney.me/api/customers';
const options = {
  method: 'POST',
  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"

	req, _ := http.NewRequest("POST", 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")

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

request = Net::HTTP::Post.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.post("https://gmc-api.gomoney.me/api/customers")
  .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('POST', 'https://gmc-api.gomoney.me/api/customers', [
  '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");
var request = new RestRequest(Method.POST);
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")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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
{
  "taxId": "39053344705",
  "name": "Cliente Externo 01",
  "email": "cliente01@example.com"
}
```

**Response**

```json
{
  "_id": "66f0b1b5c1f7b7dc0ce30001",
  "userId": "66f0b1b5c1f7b7dc0ce20001",
  "taxId": "39053344705",
  "name": "Cliente Externo 01",
  "email": "cliente01@example.com",
  "deleted": false,
  "balance": {
    "currency": "BRL",
    "amount": 0
  },
  "wallet": {
    "address": "0x2222222222222222222222222222222222222222"
  }
}
```

**SDK Code**

```python default
import requests

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

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

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

print(response.json())
```

```javascript default
const url = 'https://gmc-api.gomoney.me/api/customers';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"taxId":"39053344705","name":"Cliente Externo 01","email":"cliente01@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"

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

	req, _ := http.NewRequest("POST", 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")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"taxId\": \"39053344705\",\n  \"name\": \"Cliente Externo 01\",\n  \"email\": \"cliente01@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.post("https://gmc-api.gomoney.me/api/customers")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"taxId\": \"39053344705\",\n  \"name\": \"Cliente Externo 01\",\n  \"email\": \"cliente01@example.com\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://gmc-api.gomoney.me/api/customers', [
  'body' => '{
  "taxId": "39053344705",
  "name": "Cliente Externo 01",
  "email": "cliente01@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");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"taxId\": \"39053344705\",\n  \"name\": \"Cliente Externo 01\",\n  \"email\": \"cliente01@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 = [
  "taxId": "39053344705",
  "name": "Cliente Externo 01",
  "email": "cliente01@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")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```