Criação de um novo vendedor
curl --request POST \
--url https://api.malga.io/v1/vendors \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"referenceId": "12345",
"identityType": "CNPJ",
"identity": "12.345.678/0001-99",
"mcc": "1234",
"name": "Empresa Exemplo Ltda",
"email": "contato@empresaexemplo.com",
"phoneNumber": "5511999999999",
"website": "https://www.empresaexemplo.com",
"address": {
"country": "BR",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"zipCode": "01001-000",
"street": "Avenida Paulista",
"streetNumber": "1000",
"complement": "Apto 101"
}
}
'const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
referenceId: '12345',
identityType: 'CNPJ',
identity: '12.345.678/0001-99',
mcc: '1234',
name: 'Empresa Exemplo Ltda',
email: 'contato@empresaexemplo.com',
phoneNumber: '5511999999999',
website: 'https://www.empresaexemplo.com',
address: {
country: 'BR',
state: 'SP',
city: 'São Paulo',
district: 'Centro',
zipCode: '01001-000',
street: 'Avenida Paulista',
streetNumber: '1000',
complement: 'Apto 101'
}
})
};
fetch('https://api.malga.io/v1/vendors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/vendors"
payload := strings.NewReader("{\n \"referenceId\": \"12345\",\n \"identityType\": \"CNPJ\",\n \"identity\": \"12.345.678/0001-99\",\n \"mcc\": \"1234\",\n \"name\": \"Empresa Exemplo Ltda\",\n \"email\": \"contato@empresaexemplo.com\",\n \"phoneNumber\": \"5511999999999\",\n \"website\": \"https://www.empresaexemplo.com\",\n \"address\": {\n \"country\": \"BR\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"zipCode\": \"01001-000\",\n \"street\": \"Avenida Paulista\",\n \"streetNumber\": \"1000\",\n \"complement\": \"Apto 101\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "db56bd6a-10d7-4039-9c68-fc4405a1a3e1",
"referenceId": "12345",
"identityType": "CNPJ",
"identity": "12.345.678/0001-99",
"mcc": "1234",
"name": "Empresa Exemplo Ltda",
"email": "contato@empresaexemplo.com",
"phoneNumber": "5511999999999",
"website": "https://www.empresaexemplo.com",
"address": {
"country": "BR",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"zipCode": "01001-000",
"street": "Avenida Paulista",
"streetNumber": "1000",
"complement": "Apto 101"
},
"updatedAt": "2024-06-26T12:34:56Z",
"createdAt": "2024-06-01T08:00:00Z"
}Vendors
Criação de um novo vendedor
POST
/
v1
/
vendors
Criação de um novo vendedor
curl --request POST \
--url https://api.malga.io/v1/vendors \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"referenceId": "12345",
"identityType": "CNPJ",
"identity": "12.345.678/0001-99",
"mcc": "1234",
"name": "Empresa Exemplo Ltda",
"email": "contato@empresaexemplo.com",
"phoneNumber": "5511999999999",
"website": "https://www.empresaexemplo.com",
"address": {
"country": "BR",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"zipCode": "01001-000",
"street": "Avenida Paulista",
"streetNumber": "1000",
"complement": "Apto 101"
}
}
'const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
referenceId: '12345',
identityType: 'CNPJ',
identity: '12.345.678/0001-99',
mcc: '1234',
name: 'Empresa Exemplo Ltda',
email: 'contato@empresaexemplo.com',
phoneNumber: '5511999999999',
website: 'https://www.empresaexemplo.com',
address: {
country: 'BR',
state: 'SP',
city: 'São Paulo',
district: 'Centro',
zipCode: '01001-000',
street: 'Avenida Paulista',
streetNumber: '1000',
complement: 'Apto 101'
}
})
};
fetch('https://api.malga.io/v1/vendors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/vendors"
payload := strings.NewReader("{\n \"referenceId\": \"12345\",\n \"identityType\": \"CNPJ\",\n \"identity\": \"12.345.678/0001-99\",\n \"mcc\": \"1234\",\n \"name\": \"Empresa Exemplo Ltda\",\n \"email\": \"contato@empresaexemplo.com\",\n \"phoneNumber\": \"5511999999999\",\n \"website\": \"https://www.empresaexemplo.com\",\n \"address\": {\n \"country\": \"BR\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"zipCode\": \"01001-000\",\n \"street\": \"Avenida Paulista\",\n \"streetNumber\": \"1000\",\n \"complement\": \"Apto 101\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "db56bd6a-10d7-4039-9c68-fc4405a1a3e1",
"referenceId": "12345",
"identityType": "CNPJ",
"identity": "12.345.678/0001-99",
"mcc": "1234",
"name": "Empresa Exemplo Ltda",
"email": "contato@empresaexemplo.com",
"phoneNumber": "5511999999999",
"website": "https://www.empresaexemplo.com",
"address": {
"country": "BR",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"zipCode": "01001-000",
"street": "Avenida Paulista",
"streetNumber": "1000",
"complement": "Apto 101"
},
"updatedAt": "2024-06-26T12:34:56Z",
"createdAt": "2024-06-01T08:00:00Z"
}Body
application/json
Response
Created
Was this page helpful?