Cadastrar usuário
curl --request POST \
--url https://v4pay-api.vercel.app/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"name": "Maria Oliveira",
"email": "maria@empresa.com.br",
"password": "senhaForte123",
"cnpj": "12345678000195"
}
'import requests
url = "https://v4pay-api.vercel.app/auth/register"
payload = {
"name": "Maria Oliveira",
"email": "maria@empresa.com.br",
"password": "senhaForte123",
"cnpj": "12345678000195"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Maria Oliveira',
email: 'maria@empresa.com.br',
password: 'senhaForte123',
cnpj: '12345678000195'
})
};
fetch('https://v4pay-api.vercel.app/auth/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_URL => "https://v4pay-api.vercel.app/auth/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' => 'Maria Oliveira',
'email' => 'maria@empresa.com.br',
'password' => 'senhaForte123',
'cnpj' => '12345678000195'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://v4pay-api.vercel.app/auth/register"
payload := strings.NewReader("{\n \"name\": \"Maria Oliveira\",\n \"email\": \"maria@empresa.com.br\",\n \"password\": \"senhaForte123\",\n \"cnpj\": \"12345678000195\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://v4pay-api.vercel.app/auth/register")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Maria Oliveira\",\n \"email\": \"maria@empresa.com.br\",\n \"password\": \"senhaForte123\",\n \"cnpj\": \"12345678000195\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/auth/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Maria Oliveira\",\n \"email\": \"maria@empresa.com.br\",\n \"password\": \"senhaForte123\",\n \"cnpj\": \"12345678000195\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"user": {
"is_admin": true,
"production_status": "sandbox",
"production_requested_at": "2023-11-07T05:31:56Z",
"production_reviewed_at": "2023-11-07T05:31:56Z",
"production_reject_reason": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Maria Oliveira",
"email": "maria@empresa.com.br",
"cnpj": "12345678000195",
"company": "Enriquece AI",
"cpf": "52998224725",
"phone": "11954958486",
"notify_payment_email": true,
"receipt_email": true,
"created_at": "2023-11-07T05:31:56Z"
},
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Conta (auth)
Cadastrar usuário
Cria um usuário do gateway. A senha é armazenada com hash bcrypt.
POST
/
auth
/
register
Cadastrar usuário
curl --request POST \
--url https://v4pay-api.vercel.app/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"name": "Maria Oliveira",
"email": "maria@empresa.com.br",
"password": "senhaForte123",
"cnpj": "12345678000195"
}
'import requests
url = "https://v4pay-api.vercel.app/auth/register"
payload = {
"name": "Maria Oliveira",
"email": "maria@empresa.com.br",
"password": "senhaForte123",
"cnpj": "12345678000195"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Maria Oliveira',
email: 'maria@empresa.com.br',
password: 'senhaForte123',
cnpj: '12345678000195'
})
};
fetch('https://v4pay-api.vercel.app/auth/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_URL => "https://v4pay-api.vercel.app/auth/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' => 'Maria Oliveira',
'email' => 'maria@empresa.com.br',
'password' => 'senhaForte123',
'cnpj' => '12345678000195'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://v4pay-api.vercel.app/auth/register"
payload := strings.NewReader("{\n \"name\": \"Maria Oliveira\",\n \"email\": \"maria@empresa.com.br\",\n \"password\": \"senhaForte123\",\n \"cnpj\": \"12345678000195\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://v4pay-api.vercel.app/auth/register")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Maria Oliveira\",\n \"email\": \"maria@empresa.com.br\",\n \"password\": \"senhaForte123\",\n \"cnpj\": \"12345678000195\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/auth/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Maria Oliveira\",\n \"email\": \"maria@empresa.com.br\",\n \"password\": \"senhaForte123\",\n \"cnpj\": \"12345678000195\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"user": {
"is_admin": true,
"production_status": "sandbox",
"production_requested_at": "2023-11-07T05:31:56Z",
"production_reviewed_at": "2023-11-07T05:31:56Z",
"production_reject_reason": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Maria Oliveira",
"email": "maria@empresa.com.br",
"cnpj": "12345678000195",
"company": "Enriquece AI",
"cpf": "52998224725",
"phone": "11954958486",
"notify_payment_email": true,
"receipt_email": true,
"created_at": "2023-11-07T05:31:56Z"
},
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Body
application/json
Response
Usuário criado com sucesso.
Show child attributes
Show child attributes