Upload Documento Pessoal
curl --request POST \
--url https://gateway.3xpay.co/sub-accounts/document \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--header 'api_secret: <api-key>' \
--form file='@example-file'import requests
url = "https://gateway.3xpay.co/sub-accounts/document"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"api_key": "<api-key>",
"api_secret": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {api_key: '<api-key>', api_secret: '<api-key>'}};
options.body = form;
fetch('https://gateway.3xpay.co/sub-accounts/document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.3xpay.co/sub-accounts/document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----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--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"api_key: <api-key>",
"api_secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.3xpay.co/sub-accounts/document"
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("api_key", "<api-key>")
req.Header.Add("api_secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.3xpay.co/sub-accounts/document")
.header("api_key", "<api-key>")
.header("api_secret", "<api-key>")
.body("-----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--")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.3xpay.co/sub-accounts/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["api_secret"] = '<api-key>'
request.body = "-----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--"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Documento enviado com sucesso.",
"data": {
"filename": "rg_frente.jpg",
"document_type": "RG_FRONT",
"document_format": "JPG"
}
}Sub-accounts API
Upload Documento Pessoal
Faz upload de documentos pessoais da subconta (RG, CNH, Selfie)
POST
/
sub-accounts
/
document
Upload Documento Pessoal
curl --request POST \
--url https://gateway.3xpay.co/sub-accounts/document \
--header 'Content-Type: multipart/form-data' \
--header 'api_key: <api-key>' \
--header 'api_secret: <api-key>' \
--form file='@example-file'import requests
url = "https://gateway.3xpay.co/sub-accounts/document"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"api_key": "<api-key>",
"api_secret": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {api_key: '<api-key>', api_secret: '<api-key>'}};
options.body = form;
fetch('https://gateway.3xpay.co/sub-accounts/document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.3xpay.co/sub-accounts/document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----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--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"api_key: <api-key>",
"api_secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.3xpay.co/sub-accounts/document"
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("api_key", "<api-key>")
req.Header.Add("api_secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.3xpay.co/sub-accounts/document")
.header("api_key", "<api-key>")
.header("api_secret", "<api-key>")
.body("-----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--")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.3xpay.co/sub-accounts/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["api_secret"] = '<api-key>'
request.body = "-----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--"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Documento enviado com sucesso.",
"data": {
"filename": "rg_frente.jpg",
"document_type": "RG_FRONT",
"document_format": "JPG"
}
}Upload de Documento Pessoal
Faz upload de documentos pessoais da subconta (RG, CNH, Selfie).Headers
string
required
Chave de API da subconta
string
required
Secret de API da subconta
string
required
multipart/form-data
Body (Form Data)
string
required
Tipo do documento (RG_FRONT, RG_BACK, CNH_FRONT, CNH_BACK, SELFIE)
File
required
Arquivo JPG, JPEG, PNG, GIF, WEBP ou PDF (máximo 10MB)
Tipos de Documento Aceitos
RG_FRONT
RG_FRONT
RG Frente - Documento de identidade (lado da foto)
RG_BACK
RG_BACK
RG Verso - Documento de identidade (lado dos dados)
CNH_FRONT
CNH_FRONT
CNH Frente - Carteira de habilitação (lado da foto)
CNH_BACK
CNH_BACK
CNH Verso - Carteira de habilitação (lado dos dados)
SELFIE
SELFIE
Selfie do sócio para verificação facial
Resposta de Sucesso (201)
{
"status": "success",
"message": "Documento enviado com sucesso.",
"data": {
"filename": "rg_frente.jpg",
"document_type": "RG_FRONT",
"document_format": "JPG"
}
}
Validações
- ✅ Tamanho máximo: 10MB
- ✅ Tipo obrigatório: Deve especificar o tipo do documento
- ✅ Arquivo obrigatório: Deve enviar um arquivo
- ✅ Autenticação: Usa credenciais da própria subconta
Possíveis Erros
400 - Bad Request
400 - Bad Request
{
"message": "Tipo de documento inválido.",
"statusCode": 400
}
401 - Unauthorized
401 - Unauthorized
{
"message": "Api Key não encontrada.",
"statusCode": 401
}
413 - Payload Too Large
413 - Payload Too Large
{
"message": "Arquivo muito grande. Máximo 10MB.",
"statusCode": 413
}
Body
multipart/form-data