---
updatedAt: 2026-06-18T14:03:31.000Z
agentTools:
  projectIndex: https://docs.melhorenvio.com.br/llms.txt
---

# Inserir saldo na carteira do usuário

<div style={{ textAlign: "justify" }}>

Este método insere crédito na conta do usuário via gateway.

**Parâmetros:**

* `gateway`: yapay-transparente;
* `slug`: pix ou boleto;
* `value`: Valor a inserir.

**Retorno:** A resposta incluirá um link para o QR Code (pix) ou PDF (boleto).

**Opcionais:**

* Boleto PJ: Informe `company_name` e `cnpj`. Se omitidos, o boleto usará os dados de Pessoa Física (PF) cadastrados.
* Redirecionamento: Informe `redirect_url` para retornar o usuário ao final do pagamento.

**Finger Print**

Este parâmetro visa conferir mais segurança as transações pela API do Melhor Envio.

No momento, ainda não é exigido, mas é altamente recomendado que você implemente este recurso, pois pode se tornar obrigatório futuramente.

Para mais informações de como utilizar esse recurso, acesse: [https://intermediador.dev.yapay.com.br/#/transacao-fingerprint](https://intermediador.dev.yapay.com.br/#/transacao-fingerprint)

</div>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-melhor-envio-sandbox",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://sandbox.melhorenvio.com.br/",
      "description": "Ambiente de Sandbox (Testes)"
    },
    {
      "url": "https://melhorenvio.com.br/",
      "description": "Ambiente de Produção (Real)"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/api/v2/me/balance": {
      "post": {
        "summary": "Inserir saldo na carteira do usuário",
        "description": "",
        "operationId": "inserir-saldo-na-carteira-do-usuario",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer token"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "description": "É obrigatório que seja adicionado o cabeçalho HTTP User-Agent com o nome da sua aplicação junto a um email de contato/suporte.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Aplicação (email para contato técnico)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "gateway",
                  "value",
                  "slug"
                ],
                "properties": {
                  "gateway": {
                    "type": "string",
                    "description": "Ex: yapay-transparente"
                  },
                  "value": {
                    "type": "string",
                    "description": "Valor. Ex: 10.50"
                  },
                  "slug": {
                    "type": "string",
                    "description": "Ex: pix | boleto"
                  },
                  "redirect_url": {
                    "type": "string",
                    "description": "https://seuenderecoderetorno.me"
                  },
                  "finger_print": {
                    "type": "string",
                    "description": "Finger Print"
                  },
                  "company_name": {
                    "type": "string",
                    "description": "Nome Empresa"
                  },
                  "cnpj": {
                    "type": "string",
                    "description": "CNPJ Empresa"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"payment\": {\n    \"id\": \"c7793ea8-ee50-45a0-9f0c-809ff34c17c8\",\n    \"protocol\": \"PAY-2022032545\",\n    \"value\": 1000,\n    \"status\": \"pending\",\n    \"redirect\": \"https://sandbox.melhorenvio.com.br\",\n    \"response\": null,\n    \"authorized_at\": null,\n    \"unauthorized_at\": null,\n    \"canceled_at\": null,\n    \"chargeback_at\": null,\n    \"created_at\": \"2022-03-30 18:06:55\",\n    \"updated_at\": \"2022-03-30 18:06:55\",\n    \"link\": null,\n    \"payment_gateway_id\": null,\n    \"gateway\": {\n      \"id\": 2,\n      \"slug\": \"mercado-pago\",\n      \"name\": \"Mercado Pago\",\n      \"status\": \"available\",\n      \"min_value\": 1,\n      \"picture\": \"https://melhorenvio.s3.sa-east-1.amazonaws.com/payment-gateways/mercado-pago.png\",\n      \"website\": \"https://www.mercadopago.com.br\"\n    },\n    \"method\": null,\n    \"transaction\": {\n      \"id\": \"a9f49db7-2dd5-4e79-bd06-3a90829e359d\",\n      \"protocol\": \"TRN-20220357461\",\n      \"value\": 1000,\n      \"type\": \"credit\",\n      \"status\": \"pending\",\n      \"description\": null,\n      \"authorized_at\": null,\n      \"unauthorized_at\": null,\n      \"reserved_at\": null,\n      \"canceled_at\": null,\n      \"created_at\": \"2022-03-30 18:06:55\",\n      \"description_internal\": null,\n      \"reason\": {\n        \"id\": 6,\n        \"label\": \"Inserção de crédito\",\n        \"description\": \"\"\n      }\n    },\n    \"user\": {\n      \"id\": \"779f4d62-c5b4-41e3-b0b0-ae2eb1509825\",\n      \"protocol\": 3477,\n      \"firstname\": \"Magno\",\n      \"lastname\": \"xxxxxxxxx\",\n      \"email\": \"x@melhorenvio.com\",\n      \"picture\": null,\n      \"thumbnail\": null,\n      \"document\": \"xxxxxxxxxxx\",\n      \"birthdate\": \"xxxx-xx-xx 00:00:00\",\n      \"email_confirmed_at\": \"2021-06-22 12:17:00\",\n      \"email_alternative\": null,\n      \"access_at\": \"2021-09-01 12:31:29\",\n      \"created_at\": \"2021-06-22 12:17:00\",\n      \"updated_at\": \"2021-06-22 12:17:38\"\n    }\n  },\n  \"redirect\": \"https://sandbox.melhorenvio.com.br/checkout/notify/2\",\n  \"message\": \"\",\n  \"digitable\": null\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "payment": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "c7793ea8-ee50-45a0-9f0c-809ff34c17c8"
                        },
                        "protocol": {
                          "type": "string",
                          "example": "PAY-2022032545"
                        },
                        "value": {
                          "type": "integer",
                          "example": 1000,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "pending"
                        },
                        "redirect": {
                          "type": "string",
                          "example": "https://sandbox.melhorenvio.com.br"
                        },
                        "response": {},
                        "authorized_at": {},
                        "unauthorized_at": {},
                        "canceled_at": {},
                        "chargeback_at": {},
                        "created_at": {
                          "type": "string",
                          "example": "2022-03-30 18:06:55"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2022-03-30 18:06:55"
                        },
                        "link": {},
                        "payment_gateway_id": {},
                        "gateway": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "example": 2,
                              "default": 0
                            },
                            "slug": {
                              "type": "string",
                              "example": "mercado-pago"
                            },
                            "name": {
                              "type": "string",
                              "example": "Mercado Pago"
                            },
                            "status": {
                              "type": "string",
                              "example": "available"
                            },
                            "min_value": {
                              "type": "integer",
                              "example": 1,
                              "default": 0
                            },
                            "picture": {
                              "type": "string",
                              "example": "https://melhorenvio.s3.sa-east-1.amazonaws.com/payment-gateways/mercado-pago.png"
                            },
                            "website": {
                              "type": "string",
                              "example": "https://www.mercadopago.com.br"
                            }
                          }
                        },
                        "method": {},
                        "transaction": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "a9f49db7-2dd5-4e79-bd06-3a90829e359d"
                            },
                            "protocol": {
                              "type": "string",
                              "example": "TRN-20220357461"
                            },
                            "value": {
                              "type": "integer",
                              "example": 1000,
                              "default": 0
                            },
                            "type": {
                              "type": "string",
                              "example": "credit"
                            },
                            "status": {
                              "type": "string",
                              "example": "pending"
                            },
                            "description": {},
                            "authorized_at": {},
                            "unauthorized_at": {},
                            "reserved_at": {},
                            "canceled_at": {},
                            "created_at": {
                              "type": "string",
                              "example": "2022-03-30 18:06:55"
                            },
                            "description_internal": {},
                            "reason": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "integer",
                                  "example": 6,
                                  "default": 0
                                },
                                "label": {
                                  "type": "string",
                                  "example": "Inserção de crédito"
                                },
                                "description": {
                                  "type": "string",
                                  "example": ""
                                }
                              }
                            }
                          }
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "779f4d62-c5b4-41e3-b0b0-ae2eb1509825"
                            },
                            "protocol": {
                              "type": "integer",
                              "example": 3477,
                              "default": 0
                            },
                            "firstname": {
                              "type": "string",
                              "example": "Magno"
                            },
                            "lastname": {
                              "type": "string",
                              "example": "xxxxxxxxx"
                            },
                            "email": {
                              "type": "string",
                              "example": "x@melhorenvio.com"
                            },
                            "picture": {},
                            "thumbnail": {},
                            "document": {
                              "type": "string",
                              "example": "xxxxxxxxxxx"
                            },
                            "birthdate": {
                              "type": "string",
                              "example": "xxxx-xx-xx 00:00:00"
                            },
                            "email_confirmed_at": {
                              "type": "string",
                              "example": "2021-06-22 12:17:00"
                            },
                            "email_alternative": {},
                            "access_at": {
                              "type": "string",
                              "example": "2021-09-01 12:31:29"
                            },
                            "created_at": {
                              "type": "string",
                              "example": "2021-06-22 12:17:00"
                            },
                            "updated_at": {
                              "type": "string",
                              "example": "2021-06-22 12:17:38"
                            }
                          }
                        }
                      }
                    },
                    "redirect": {
                      "type": "string",
                      "example": "https://sandbox.melhorenvio.com.br/checkout/notify/2"
                    },
                    "message": {
                      "type": "string",
                      "example": ""
                    },
                    "digitable": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"message\": \"Unauthenticated.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Unauthenticated."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```