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

# Adicionar saldo em customer

POST https://gmc-api.gomoney.me/api/transactions/add-balance
Content-Type: application/json

Endpoint de adição de saldo em customer para a integração documentada.

Este endpoint exige:
- `Authorization: Bearer <accessToken>`
- `secret-key: btoa(clientKey:clientSecret)`
- `Origin` correspondente ao domínio liberado

O campo `customerIdentifier` é obrigatório e as taxas PIX seguem a hierarquia:
`customer -> user -> settings`.


Reference: https://docs.gomoney.me/en/api-reference/open-api-explorer/add-balance

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: gomoney-docs-postman-collection
  version: 1.0.0
paths:
  /transactions/add-balance:
    post:
      operationId: add-balance
      summary: Adicionar saldo em customer
      description: >
        Endpoint de adição de saldo em customer para a integração documentada.


        Este endpoint exige:

        - `Authorization: Bearer <accessToken>`

        - `secret-key: btoa(clientKey:clientSecret)`

        - `Origin` correspondente ao domínio liberado


        O campo `customerIdentifier` é obrigatório e as taxas PIX seguem a
        hierarquia:

        `customer -> user -> settings`.
      tags:
        - ''
      parameters:
        - name: Authorization
          in: header
          description: Token retornado pelo endpoint `/users/integration/login`.
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Adição de saldo em customer realizada com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddBalanceResponse'
        '400':
          description: >-
            Payload inválido, valor inconsistente ou `customerIdentifier`
            ausente/inválido.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Token, `secret-key` ou `Origin` inválidos para a integração.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Usuário sem permissão para operar a integração.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '503':
          description: Fluxo GMC indisponível no momento.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddBalanceRequest'
servers:
  - url: https://gmc-api.gomoney.me/api
    description: Base URL da API da plataforma
components:
  schemas:
    AddBalanceRequestCurrency:
      type: string
      enum:
        - BRL
        - USD
        - GMC
        - USDT
      title: AddBalanceRequestCurrency
    AddBalanceRequest:
      type: object
      properties:
        amount:
          type: number
          format: double
        customerIdentifier:
          type: string
          description: '`_id` ou `taxId` do customer.'
        currency:
          $ref: '#/components/schemas/AddBalanceRequestCurrency'
      required:
        - amount
        - customerIdentifier
        - currency
      title: AddBalanceRequest
    BalanceTransactionSummary:
      type: object
      properties:
        totalItems:
          type: integer
        completedItems:
          type: integer
        failedItems:
          type: integer
        totalTargetGmc:
          type: number
          format: double
      title: BalanceTransactionSummary
    BalanceTransactionItemsItemsFees:
      type: object
      properties:
        fixedBrl:
          type: number
          format: double
        percentageBrl:
          type: number
          format: double
        totalBrl:
          type: number
          format: double
        issueTaxBrl:
          type: number
          format: double
        issueTaxRate:
          type: number
          format: double
        fixedFeeSource:
          type: string
        percentageFeeSource:
          type: string
        issueTaxSource:
          type: string
      title: BalanceTransactionItemsItemsFees
    BalanceTransactionItemsItemsConversion:
      type: object
      properties:
        brlPerGmc:
          type: number
          format: double
        usdtBrlRate:
          type: number
          format: double
        sourceAmountBrl:
          type: number
          format: double
      title: BalanceTransactionItemsItemsConversion
    BalanceTransactionItemsItemsBlockchain:
      type: object
      properties:
        mintHash:
          type:
            - string
            - 'null'
        approveHash:
          type:
            - string
            - 'null'
        transferHash:
          type:
            - string
            - 'null'
      title: BalanceTransactionItemsItemsBlockchain
    BalanceTransactionItemsItems:
      type: object
      properties:
        customerIdentifier:
          type: string
        sourceAmount:
          type: number
          format: double
        sourceCurrency:
          type: string
        targetGmcAmount:
          type: string
        status:
          type: string
        error:
          type:
            - string
            - 'null'
        customerWalletAddress:
          type: string
        destinationWalletAddress:
          type: string
        fees:
          $ref: '#/components/schemas/BalanceTransactionItemsItemsFees'
        conversion:
          $ref: '#/components/schemas/BalanceTransactionItemsItemsConversion'
        blockchain:
          $ref: '#/components/schemas/BalanceTransactionItemsItemsBlockchain'
        processedAt:
          type: string
      title: BalanceTransactionItemsItems
    BalanceTransaction:
      type: object
      properties:
        _id:
          type: string
        user:
          type: string
        status:
          type: string
        summary:
          $ref: '#/components/schemas/BalanceTransactionSummary'
        items:
          type: array
          items:
            $ref: '#/components/schemas/BalanceTransactionItemsItems'
        createdAt:
          type: string
        updatedAt:
          type: string
      title: BalanceTransaction
    AddBalanceResponse:
      type: object
      properties:
        title:
          type: string
        balanceTransaction:
          $ref: '#/components/schemas/BalanceTransaction'
      title: AddBalanceResponse
    ApiError:
      type: object
      properties:
        statusCode:
          type: integer
        path:
          type: string
        code:
          type: string
        message:
          type: string
      title: ApiError
    UnauthorizedError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
      title: UnauthorizedError
  securitySchemes:
    accessTokenBearer:
      type: http
      scheme: bearer
      description: Token retornado pelo endpoint `/users/integration/login`.
    secretKeyHeader:
      type: apiKey
      in: header
      name: secret-key
      description: Chave Base64 no formato `btoa(clientKey:clientSecret)`.

```

## Examples

### success



**Request**

```json
{
  "amount": 1500.75,
  "customerIdentifier": "a3f1c9d2e4b5678901234567",
  "currency": "GMC"
}
```

**Response**

```json
{
  "title": "Success",
  "balanceTransaction": {
    "_id": "a3f1c9d2e4b5678901234568",
    "user": "b4e2d3f4a5c6789012345678",
    "status": "COMPLETED",
    "summary": {
      "totalItems": 1,
      "completedItems": 1,
      "failedItems": 0,
      "totalTargetGmc": 1500.75
    },
    "items": [
      {
        "customerIdentifier": "a3f1c9d2e4b5678901234567",
        "sourceAmount": 1500.75,
        "sourceCurrency": "GMC",
        "targetGmcAmount": "1500.75",
        "status": "COMPLETED",
        "error": null,
        "customerWalletAddress": "0xAbC1234dEf567890aBcD1234567890EfABcDeF12",
        "destinationWalletAddress": "0xDeF4567aBc8901234dEfABcD567890aBcDeF1234",
        "fees": {
          "fixedBrl": 2.5,
          "percentageBrl": 0.75,
          "totalBrl": 3.25,
          "issueTaxBrl": 0.5,
          "issueTaxRate": 0.033,
          "fixedFeeSource": "customer",
          "percentageFeeSource": "user",
          "issueTaxSource": "settings"
        },
        "conversion": {
          "brlPerGmc": 0.95,
          "usdtBrlRate": 5.25,
          "sourceAmountBrl": 1425.71
        },
        "blockchain": {
          "mintHash": null,
          "approveHash": null,
          "transferHash": null
        },
        "processedAt": "1688006400"
      }
    ],
    "createdAt": "1688006400",
    "updatedAt": "1688006400"
  }
}
```

**SDK Code**

```python success
import requests

url = "https://gmc-api.gomoney.me/api/transactions/add-balance"

payload = {
    "amount": 1500.75,
    "customerIdentifier": "a3f1c9d2e4b5678901234567",
    "currency": "GMC"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript success
const url = 'https://gmc-api.gomoney.me/api/transactions/add-balance';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"amount":1500.75,"customerIdentifier":"a3f1c9d2e4b5678901234567","currency":"GMC"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://gmc-api.gomoney.me/api/transactions/add-balance"

	payload := strings.NewReader("{\n  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\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 success
require 'uri'
require 'net/http'

url = URI("https://gmc-api.gomoney.me/api/transactions/add-balance")

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  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\n}"

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/transactions/add-balance")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://gmc-api.gomoney.me/api/transactions/add-balance', [
  'body' => '{
  "amount": 1500.75,
  "customerIdentifier": "a3f1c9d2e4b5678901234567",
  "currency": "GMC"
}',
  '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/transactions/add-balance");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift success
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 1500.75,
  "customerIdentifier": "a3f1c9d2e4b5678901234567",
  "currency": "GMC"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://gmc-api.gomoney.me/api/transactions/add-balance")! 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()
```

### default



**Request**

```json
{
  "amount": 1500.75,
  "customerIdentifier": "a3f1c9d2e4b5678901234567",
  "currency": "GMC"
}
```

**Response**

```json
{
  "title": "Success",
  "balanceTransaction": {
    "_id": "a3f1c9d2e4b5678901234568",
    "user": "b4e2d3f4a5c6789012345678",
    "status": "COMPLETED",
    "summary": {
      "totalItems": 1,
      "completedItems": 1,
      "failedItems": 0,
      "totalTargetGmc": 1500.75
    },
    "items": [
      {
        "customerIdentifier": "a3f1c9d2e4b5678901234567",
        "sourceAmount": 1500.75,
        "sourceCurrency": "GMC",
        "targetGmcAmount": "1500.75",
        "status": "COMPLETED",
        "error": null,
        "customerWalletAddress": "0xAbC1234dEf567890aBcD1234567890EfABcDeF12",
        "destinationWalletAddress": "0xDeF4567aBc8901234dEfABcD567890aBcDeF1234",
        "fees": {
          "fixedBrl": 2.5,
          "percentageBrl": 0.75,
          "totalBrl": 3.25,
          "issueTaxBrl": 0.5,
          "issueTaxRate": 0.033,
          "fixedFeeSource": "customer",
          "percentageFeeSource": "user",
          "issueTaxSource": "settings"
        },
        "conversion": {
          "brlPerGmc": 0.95,
          "usdtBrlRate": 5.25,
          "sourceAmountBrl": 1425.71
        },
        "blockchain": {
          "mintHash": null,
          "approveHash": null,
          "transferHash": null
        },
        "processedAt": "1688006400"
      }
    ],
    "createdAt": "1688006400",
    "updatedAt": "1688006400"
  }
}
```

**SDK Code**

```python default
import requests

url = "https://gmc-api.gomoney.me/api/transactions/add-balance"

payload = {
    "amount": 1500.75,
    "customerIdentifier": "a3f1c9d2e4b5678901234567",
    "currency": "GMC"
}
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/transactions/add-balance';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"amount":1500.75,"customerIdentifier":"a3f1c9d2e4b5678901234567","currency":"GMC"}'
};

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/transactions/add-balance"

	payload := strings.NewReader("{\n  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\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/transactions/add-balance")

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  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\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/transactions/add-balance")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://gmc-api.gomoney.me/api/transactions/add-balance', [
  'body' => '{
  "amount": 1500.75,
  "customerIdentifier": "a3f1c9d2e4b5678901234567",
  "currency": "GMC"
}',
  '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/transactions/add-balance");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 1500.75,\n  \"customerIdentifier\": \"a3f1c9d2e4b5678901234567\",\n  \"currency\": \"GMC\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 1500.75,
  "customerIdentifier": "a3f1c9d2e4b5678901234567",
  "currency": "GMC"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://gmc-api.gomoney.me/api/transactions/add-balance")! 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()
```