Atualizar um vendedor
curl --request PATCH \
--url https://api.malga.io/v1/vendors/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"referenceId": "12345",
"name": "Empresa Exemplo Ltda"
}
'const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({referenceId: '12345', name: 'Empresa Exemplo Ltda'})
};
fetch('https://api.malga.io/v1/vendors/{id}', 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/{id}"
payload := strings.NewReader("{\n \"referenceId\": \"12345\",\n \"name\": \"Empresa Exemplo Ltda\"\n}")
req, _ := http.NewRequest("PATCH", 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": "889507cd-2043-4e28-b3b9-4793b09a3568",
"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"
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"declined_code": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"declined_code": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"declined_code": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Vendors
Atualizar um vendedor
PATCH
/
v1
/
vendors
/
{id}
Atualizar um vendedor
curl --request PATCH \
--url https://api.malga.io/v1/vendors/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"referenceId": "12345",
"name": "Empresa Exemplo Ltda"
}
'const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({referenceId: '12345', name: 'Empresa Exemplo Ltda'})
};
fetch('https://api.malga.io/v1/vendors/{id}', 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/{id}"
payload := strings.NewReader("{\n \"referenceId\": \"12345\",\n \"name\": \"Empresa Exemplo Ltda\"\n}")
req, _ := http.NewRequest("PATCH", 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": "889507cd-2043-4e28-b3b9-4793b09a3568",
"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"
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"declined_code": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"declined_code": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"declined_code": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Body
application/json
Response
Success
Was this page helpful?