Saldo do usuário:

O Saldo em carteira do usuário pode ser obtido do seguinte modo:

Endpoint GET /api/v2/me/balance

Exemplo com cURL:

$ curl -X GET \
  'https://www.melhorenvio.com.br/api/v2/me/balance?pretty' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjNjYmQzNTBjYzI0YmI5NzdjMDRkNTRmYzg1NThhOTE4ZjNkZDBmMDBkMTFhYzg2ZmI0OTViMDBiNzQxODEwZDlhMWM2ZWVlNTRkMTdhZDkxIn0.eyJhdWQiOiIxIiwianRpIjoiM2NiZDM1MGNjMjRiYjk3N2MwNGQ1NGZjODU1OGE5MThmM2RkMGYwMGQxMWFjODZmYjQ5NWIwMGI3NDE4MTBkOWExYzZlZWU1NGQxN2FkOTEiLCJpYXQiOjE1MDY1MjMzODYsIm5iZiI6MTUwNjUyMzM4NiwiZXhwIjoxNTM4MDU5Mzg2LCJzdWIiOiIxNmIyMWVhNS00NmVjLTQ0Y2MtYjdmNS1hMDJmZmY3YjljMjgiLCJzY29wZXMiOlsiY2FydC1yZWFkIiwiY2FydC13cml0ZSIsImNvbXBhbmllcy1yZWFkIiwiY29tcGFuaWVzLXdyaXRlIiwiY291cG9ucy1yZWFkIiwibm90aWZpY2F0aW9ucy1yZWFkIiwiY291cG9ucy13cml0ZSIsIm9yZGVycy1yZWFkIiwicHVyY2hhc2VzLXJlYWQiLCJzaGlwcGluZy1jYWxjdWxhdGUiLCJzaGlwcGluZy1jYW5jZWwiLCJzaGlwcGluZy1jaGVja291dCIsInNoaXBwaW5nLWNvbXBhbmllcyIsInNoaXBwaW5nLWdlbmVyYXRlIiwic2hpcHBpbmctcHJldmlldyIsInNoaXBwaW5nLXByaW50Iiwic2hpcHBpbmctdHJhY2tpbmciLCJ3ZWJob29rcy1yZWFkIiwid2ViaG9va3Mtd3JpdGUiLCJ0cmFuc2FjdGlvbnMtcmVhZCIsInVzZXJzLXJlYWQiLCJ1c2Vycy13cml0ZSJdfQ.GpVYhn4ZLjvtBsNq_sLullUV5E-zb3t009IuKkeRHgDGiDlnt_Lslv7elg6ou2nD_t0u2REIv3umZsLhYxUhHak732DSek84YJ14ehF4OCwFDYY8j1qOHB91YpXIUe6BzrDSD58IC3sknmoV7Cln2oLWwsooHTmowVFceCW5BNzavoT-wawUGxfOKb-el0exgtfx9gs-ppEdfSYfRvRvvfGMDqcbqaoIZxOE1hf9LK1qIbuOjLUO0lPwXCmhIe8q-fKfb-DvGXhz9aTCZ2K4khaseDGkjXOQyB_abOqfzktcFOfqcXuInv53-UoPQNZhzfTPqu2ATe73AlVsbS9Y1w_F40cVgHfhlOujcqccpQiErM6mZvDkx7EIIcEXM7wmX4kDZzWBm5ZEf1Y4WX0lSR-zOK0jm-rOZ6MWKeko5-GcQaeqho9Q3I4o-RViVznBCBW1OnGy7K2jNlB0juL6ZL2YKgKhjxmhe-_dNSQ7BMvJpzhQsKcOkJXS70RBJvx17Dl0vHMuCbW-K1KT1HrPasMVB3psHNNE1wtPI1IeAogcd9eTtvD2Easy7hS0YUqf7KCXk7h2qJdGHpgbjwALGq4U6JvpDeyqWHmS5_d8v92dtJ5Lz4wFc-JYsueNU5tqJiz03ORnRCZCkYZu52pc5kiW7-fo-UVfxSDdizf76Fk' \
  -H 'content-type: application/json'

Nota: O Parâmetro pretty pode ser passado para imprimir o JSON de modo que se possa visualizar a informação na fase de desenvolvimento, não sendo recomendado para produção por aumentar o tamanho da resposta enviada ao cliente.

Resposta:

{
  "balance": 154.48, // saldo disponível
  "reserved": 0, // saldo reservado
  "debts": 0 // dívida de postagens conferidas
}

A adição de crédito pode ser realizada do seguinte modo:

Endpoint GET /api/v2/me/balance

Payload:

{
  "gateway": 'mercado-pago', // moip, mercado-pago
  "redirect": "url", // url de redirecionamento após retorno do meio de pagamento (opcional)
  "value": 10.50 // valor que será adicionado como saldo em carteira
}

Exemplo com cURL:

Nesse exemplo, caso autorizado pelo meio de pagamento, será adicionado R$ 10,50 via Mercado Pago.

$ curl -X POST \
  'https://www.melhorenvio.com.br/api/v2/me/balance' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjNjYmQzNTBjYzI0YmI5NzdjMDRkNTRmYzg1NThhOTE4ZjNkZDBmMDBkMTFhYzg2ZmI0OTViMDBiNzQxODEwZDlhMWM2ZWVlNTRkMTdhZDkxIn0.eyJhdWQiOiIxIiwianRpIjoiM2NiZDM1MGNjMjRiYjk3N2MwNGQ1NGZjODU1OGE5MThmM2RkMGYwMGQxMWFjODZmYjQ5NWIwMGI3NDE4MTBkOWExYzZlZWU1NGQxN2FkOTEiLCJpYXQiOjE1MDY1MjMzODYsIm5iZiI6MTUwNjUyMzM4NiwiZXhwIjoxNTM4MDU5Mzg2LCJzdWIiOiIxNmIyMWVhNS00NmVjLTQ0Y2MtYjdmNS1hMDJmZmY3YjljMjgiLCJzY29wZXMiOlsiY2FydC1yZWFkIiwiY2FydC13cml0ZSIsImNvbXBhbmllcy1yZWFkIiwiY29tcGFuaWVzLXdyaXRlIiwiY291cG9ucy1yZWFkIiwibm90aWZpY2F0aW9ucy1yZWFkIiwiY291cG9ucy13cml0ZSIsIm9yZGVycy1yZWFkIiwicHVyY2hhc2VzLXJlYWQiLCJzaGlwcGluZy1jYWxjdWxhdGUiLCJzaGlwcGluZy1jYW5jZWwiLCJzaGlwcGluZy1jaGVja291dCIsInNoaXBwaW5nLWNvbXBhbmllcyIsInNoaXBwaW5nLWdlbmVyYXRlIiwic2hpcHBpbmctcHJldmlldyIsInNoaXBwaW5nLXByaW50Iiwic2hpcHBpbmctdHJhY2tpbmciLCJ3ZWJob29rcy1yZWFkIiwid2ViaG9va3Mtd3JpdGUiLCJ0cmFuc2FjdGlvbnMtcmVhZCIsInVzZXJzLXJlYWQiLCJ1c2Vycy13cml0ZSJdfQ.GpVYhn4ZLjvtBsNq_sLullUV5E-zb3t009IuKkeRHgDGiDlnt_Lslv7elg6ou2nD_t0u2REIv3umZsLhYxUhHak732DSek84YJ14ehF4OCwFDYY8j1qOHB91YpXIUe6BzrDSD58IC3sknmoV7Cln2oLWwsooHTmowVFceCW5BNzavoT-wawUGxfOKb-el0exgtfx9gs-ppEdfSYfRvRvvfGMDqcbqaoIZxOE1hf9LK1qIbuOjLUO0lPwXCmhIe8q-fKfb-DvGXhz9aTCZ2K4khaseDGkjXOQyB_abOqfzktcFOfqcXuInv53-UoPQNZhzfTPqu2ATe73AlVsbS9Y1w_F40cVgHfhlOujcqccpQiErM6mZvDkx7EIIcEXM7wmX4kDZzWBm5ZEf1Y4WX0lSR-zOK0jm-rOZ6MWKeko5-GcQaeqho9Q3I4o-RViVznBCBW1OnGy7K2jNlB0juL6ZL2YKgKhjxmhe-_dNSQ7BMvJpzhQsKcOkJXS70RBJvx17Dl0vHMuCbW-K1KT1HrPasMVB3psHNNE1wtPI1IeAogcd9eTtvD2Easy7hS0YUqf7KCXk7h2qJdGHpgbjwALGq4U6JvpDeyqWHmS5_d8v92dtJ5Lz4wFc-JYsueNU5tqJiz03ORnRCZCkYZu52pc5kiW7-fo-UVfxSDdizf76Fk' \
  -H 'content-type: application/json'
  -d '{
    "gateway": 'mercado-pago',
    "redirect": "url",
    "value": 10.50
  }'

results matching ""

    No results matching ""