Upload Documento Empresa
curl --request POST \
--url https://gateway.3xpay.co/sub-accounts/document/company \
--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/company"
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/company', 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/company",
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/company"
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/company")
.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/company")
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 Empresa
Faz upload de documentos empresariais da subconta (Comprovante de Endereço, CNPJ, Contrato Social)
POST
/
sub-accounts
/
document
/
company
Upload Documento Empresa
curl --request POST \
--url https://gateway.3xpay.co/sub-accounts/document/company \
--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/company"
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/company', 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/company",
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/company"
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/company")
.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/company")
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 Empresa
Faz upload de documentos da empresa (Contrato Social).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 (PROOF_OF_RESIDENCE, CNPJ, SOCIAL_CONTRACT)
File
required
Arquivo JPG, JPEG, PNG, GIF, WEBP ou PDF (máximo 10MB)
Tipos de Documento Empresarial Aceitos
PROOF_OF_RESIDENCE
PROOF_OF_RESIDENCE
Comprovante de Endereço
CNPJ
CNPJ
CNPJ da empresa
SOCIAL_CONTRACT
SOCIAL_CONTRACT
Contrato Social da empresa
Resposta de Sucesso (201)
{
"status": "success",
"message": "Documento da empresa enviado com sucesso.",
"data": {
"filename": "contrato-social.pdf",
"document_type": "SOCIAL_CONTRACT",
"document_format": "PDF"
}
}
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