Register a new company
curl --request POST \
--url http://localhost:7701/api/v1/company/register \
--header 'Content-Type: application/json' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"name": "Acme Corp",
"gateway_ids": [
1,
2
],
"email": "finance@acme.com",
"document": "12345678000195",
"document_type": "cnpj",
"type": "corporation",
"bank_account": {
"holder_name": "Acme Corp",
"holder_type": "company",
"holder_document": "12345678000195",
"bank": "341",
"branch_number": "0001",
"account_number": "12345678",
"account_check_digit": "9",
"type": "checking"
}
}
'import requests
url = "http://localhost:7701/api/v1/company/register"
payload = {
"name": "Acme Corp",
"gateway_ids": [1, 2],
"email": "finance@acme.com",
"document": "12345678000195",
"document_type": "cnpj",
"type": "corporation",
"bank_account": {
"holder_name": "Acme Corp",
"holder_type": "company",
"holder_document": "12345678000195",
"bank": "341",
"branch_number": "0001",
"account_number": "12345678",
"account_check_digit": "9",
"type": "checking"
}
}
headers = {
"x-client-id": "<x-client-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-client-id': '<x-client-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp',
gateway_ids: [1, 2],
email: 'finance@acme.com',
document: '12345678000195',
document_type: 'cnpj',
type: 'corporation',
bank_account: {
holder_name: 'Acme Corp',
holder_type: 'company',
holder_document: '12345678000195',
bank: '341',
branch_number: '0001',
account_number: '12345678',
account_check_digit: '9',
type: 'checking'
}
})
};
fetch('http://localhost:7701/api/v1/company/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/company/register",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corp',
'gateway_ids' => [
1,
2
],
'email' => 'finance@acme.com',
'document' => '12345678000195',
'document_type' => 'cnpj',
'type' => 'corporation',
'bank_account' => [
'holder_name' => 'Acme Corp',
'holder_type' => 'company',
'holder_document' => '12345678000195',
'bank' => '341',
'branch_number' => '0001',
'account_number' => '12345678',
'account_check_digit' => '9',
'type' => 'checking'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/company/register"
payload := strings.NewReader("{\n \"name\": \"Acme Corp\",\n \"gateway_ids\": [\n 1,\n 2\n ],\n \"email\": \"finance@acme.com\",\n \"document\": \"12345678000195\",\n \"document_type\": \"cnpj\",\n \"type\": \"corporation\",\n \"bank_account\": {\n \"holder_name\": \"Acme Corp\",\n \"holder_type\": \"company\",\n \"holder_document\": \"12345678000195\",\n \"bank\": \"341\",\n \"branch_number\": \"0001\",\n \"account_number\": \"12345678\",\n \"account_check_digit\": \"9\",\n \"type\": \"checking\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
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))
}HttpResponse<String> response = Unirest.post("http://localhost:7701/api/v1/company/register")
.header("x-client-id", "<x-client-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp\",\n \"gateway_ids\": [\n 1,\n 2\n ],\n \"email\": \"finance@acme.com\",\n \"document\": \"12345678000195\",\n \"document_type\": \"cnpj\",\n \"type\": \"corporation\",\n \"bank_account\": {\n \"holder_name\": \"Acme Corp\",\n \"holder_type\": \"company\",\n \"holder_document\": \"12345678000195\",\n \"bank\": \"341\",\n \"branch_number\": \"0001\",\n \"account_number\": \"12345678\",\n \"account_check_digit\": \"9\",\n \"type\": \"checking\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/company/register")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corp\",\n \"gateway_ids\": [\n 1,\n 2\n ],\n \"email\": \"finance@acme.com\",\n \"document\": \"12345678000195\",\n \"document_type\": \"cnpj\",\n \"type\": \"corporation\",\n \"bank_account\": {\n \"holder_name\": \"Acme Corp\",\n \"holder_type\": \"company\",\n \"holder_document\": \"12345678000195\",\n \"bank\": \"341\",\n \"branch_number\": \"0001\",\n \"account_number\": \"12345678\",\n \"account_check_digit\": \"9\",\n \"type\": \"checking\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Company registered successfully!",
"credentials": {
"client_id": "client_a1b2c3d4e5f6g7h8",
"api_key": "sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"warning": "Save your api_key safely, it won't be showed again."
}
}Company
Register a new company
Creates a company account and returns a client_id and api_key for API authentication.
POST
/
api
/
v1
/
company
/
register
Register a new company
curl --request POST \
--url http://localhost:7701/api/v1/company/register \
--header 'Content-Type: application/json' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"name": "Acme Corp",
"gateway_ids": [
1,
2
],
"email": "finance@acme.com",
"document": "12345678000195",
"document_type": "cnpj",
"type": "corporation",
"bank_account": {
"holder_name": "Acme Corp",
"holder_type": "company",
"holder_document": "12345678000195",
"bank": "341",
"branch_number": "0001",
"account_number": "12345678",
"account_check_digit": "9",
"type": "checking"
}
}
'import requests
url = "http://localhost:7701/api/v1/company/register"
payload = {
"name": "Acme Corp",
"gateway_ids": [1, 2],
"email": "finance@acme.com",
"document": "12345678000195",
"document_type": "cnpj",
"type": "corporation",
"bank_account": {
"holder_name": "Acme Corp",
"holder_type": "company",
"holder_document": "12345678000195",
"bank": "341",
"branch_number": "0001",
"account_number": "12345678",
"account_check_digit": "9",
"type": "checking"
}
}
headers = {
"x-client-id": "<x-client-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-client-id': '<x-client-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp',
gateway_ids: [1, 2],
email: 'finance@acme.com',
document: '12345678000195',
document_type: 'cnpj',
type: 'corporation',
bank_account: {
holder_name: 'Acme Corp',
holder_type: 'company',
holder_document: '12345678000195',
bank: '341',
branch_number: '0001',
account_number: '12345678',
account_check_digit: '9',
type: 'checking'
}
})
};
fetch('http://localhost:7701/api/v1/company/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/company/register",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corp',
'gateway_ids' => [
1,
2
],
'email' => 'finance@acme.com',
'document' => '12345678000195',
'document_type' => 'cnpj',
'type' => 'corporation',
'bank_account' => [
'holder_name' => 'Acme Corp',
'holder_type' => 'company',
'holder_document' => '12345678000195',
'bank' => '341',
'branch_number' => '0001',
'account_number' => '12345678',
'account_check_digit' => '9',
'type' => 'checking'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/company/register"
payload := strings.NewReader("{\n \"name\": \"Acme Corp\",\n \"gateway_ids\": [\n 1,\n 2\n ],\n \"email\": \"finance@acme.com\",\n \"document\": \"12345678000195\",\n \"document_type\": \"cnpj\",\n \"type\": \"corporation\",\n \"bank_account\": {\n \"holder_name\": \"Acme Corp\",\n \"holder_type\": \"company\",\n \"holder_document\": \"12345678000195\",\n \"bank\": \"341\",\n \"branch_number\": \"0001\",\n \"account_number\": \"12345678\",\n \"account_check_digit\": \"9\",\n \"type\": \"checking\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
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))
}HttpResponse<String> response = Unirest.post("http://localhost:7701/api/v1/company/register")
.header("x-client-id", "<x-client-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp\",\n \"gateway_ids\": [\n 1,\n 2\n ],\n \"email\": \"finance@acme.com\",\n \"document\": \"12345678000195\",\n \"document_type\": \"cnpj\",\n \"type\": \"corporation\",\n \"bank_account\": {\n \"holder_name\": \"Acme Corp\",\n \"holder_type\": \"company\",\n \"holder_document\": \"12345678000195\",\n \"bank\": \"341\",\n \"branch_number\": \"0001\",\n \"account_number\": \"12345678\",\n \"account_check_digit\": \"9\",\n \"type\": \"checking\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/company/register")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corp\",\n \"gateway_ids\": [\n 1,\n 2\n ],\n \"email\": \"finance@acme.com\",\n \"document\": \"12345678000195\",\n \"document_type\": \"cnpj\",\n \"type\": \"corporation\",\n \"bank_account\": {\n \"holder_name\": \"Acme Corp\",\n \"holder_type\": \"company\",\n \"holder_document\": \"12345678000195\",\n \"bank\": \"341\",\n \"branch_number\": \"0001\",\n \"account_number\": \"12345678\",\n \"account_check_digit\": \"9\",\n \"type\": \"checking\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Company registered successfully!",
"credentials": {
"client_id": "client_a1b2c3d4e5f6g7h8",
"api_key": "sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"warning": "Save your api_key safely, it won't be showed again."
}
}Headers
Client identifier for the company in the request.
Example:
"client_abc123"
Body
application/json
Example:
"Acme Corp"
Example:
[1, 2]
Example:
"finance@acme.com"
Example:
"12345678000195"
Available options:
cpf, cnpj Example:
"cnpj"
Available options:
individual, corporation Example:
"corporation"
Required when gateway_ids is provided
Show child attributes
Show child attributes