Upload de documento
curl --request POST \
--url https://api.malga.io/v1/sellers/documents \
--header 'Content-Type: multipart/form-data' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--form file='@example-file'const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.malga.io/v1/sellers/documents', 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/sellers/documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "SELFIE",
"status": "uploaded",
"expiresAt": "2026-04-15T18:00:00.000Z"
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Sellers
Upload de documento
Faz upload de um documento (imagem ou PDF) para posterior associação a um seller. O arquivo fica armazenado temporariamente por 7 dias. Após esse prazo, o documento expira e não pode mais ser utilizado.
Tipos aceitos: SELFIE, CNH_FULL, CNH_FRONT, CNH_BACK, RG_FRONT, RG_BACK
Formatos aceitos:
- SELFIE e CNH_FULL: PNG, JPEG, BMP, WebP, HEIC, HEIF, PDF
- CNH_FRONT, CNH_BACK, RG_FRONT, RG_BACK: PNG, JPEG, BMP, WebP, HEIC, HEIF (sem PDF)
Tamanho máximo: 3MB
POST
/
v1
/
sellers
/
documents
Upload de documento
curl --request POST \
--url https://api.malga.io/v1/sellers/documents \
--header 'Content-Type: multipart/form-data' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--form file='@example-file'const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.malga.io/v1/sellers/documents', 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/sellers/documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "SELFIE",
"status": "uploaded",
"expiresAt": "2026-04-15T18:00:00.000Z"
}{
"error": {
"type": "api_error",
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Body
multipart/form-data
Response
Documento enviado com sucesso
Identificador do documento
Tipo do documento
Available options:
SELFIE, CNH_FULL, CNH_FRONT, CNH_BACK, RG_FRONT, RG_BACK Status do documento:
uploaded: documento enviado, aguardando associação com sellerattached: documento associado a um seller, aguardando envio ao provedorsent: documento enviado ao provedor com sucesso
Available options:
uploaded, attached, sent Data de expiração do documento (7 dias após upload)
Related topics
Abr 08, 2026 - Upload de documentos para SellersMais releasesTabela tipos de países e documentos de cadastro de CustomerListar documentosWas this page helpful?