Cadastrar Carteira
Descrição: Cria uma nova carteira para um usuário comercial específico.
Endpoint
POST/api/v1/integration/wallets
Regras
| Atributos | Descrição | Tipo | Obrigatório | Validações |
|---|---|---|---|---|
| name | Nome da carteira | String | Sim | Até 255 caracteres. |
| description | Descrição da carteira | String | Não | Até 255 caracteres. |
| owner_id | Identificador do usuário dono | String | Sim | - |
Exemplo de Requisição
- cURL
- Java
- JavaScript
- Python
curl -X POST \
-H "Authorization: {SUA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "Carteira Spot Soja",
"description": "Operações de venda de soja spot",
"owner_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}' \
"https://api.merx.tech/api/v1/integration/wallets"
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String body = "{\"name\": \"Carteira Spot Soja\", \"description\": \"Operações de venda de soja spot\", \"owner_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.merx.tech/api/v1/integration/wallets"))
.header("Authorization", "{SUA_API_KEY}")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient client = HttpClient.newHttpClient();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
const response = await fetch(
'https://api.merx.tech/api/v1/integration/wallets',
{
method: 'POST',
headers: {
'Authorization': '{SUA_API_KEY}',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Carteira Spot Soja',
description: 'Operações de venda de soja spot',
owner_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
}),
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://api.merx.tech/api/v1/integration/wallets"
headers = {
"Authorization": "{SUA_API_KEY}",
"Content-Type": "application/json"
}
payload = {
"name": "Carteira Spot Soja",
"description": "Operações de venda de soja spot",
"owner_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Parâmetros
Parâmetros de Cabeçalho
| Nome | Descrição | Tipo | Obrigatório |
|---|---|---|---|
| Authorization | Chave de API obtida via support-api@merx.tech | String | Sim |
| Content-Type | application/json | String | Sim |
Parâmetros do Corpo
| Nome | Descrição | Tipo | Obrigatório |
|---|---|---|---|
| name | Nome da carteira | String | Sim |
| description | Descrição da carteira | String | Não |
| owner_id | Identificador do usuário dono | String | Sim |
Respostas
- 200 - OK
{
"id": "string"
}
- 400 - Bad Request
{
"messages": ["message.entidade.campo-inválido"]
}
401 - Unauthorized
404 - NotFound