Criar novo cliente
curl --request POST \
--url https://besimplo.com/api/v1/customers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"name": "João Silva",
"external_code": "01953808-3a3a-712f-99ce-f6943c8141db",
"identifier": "123.456.789-00",
"email": "joao.silva@exemplo.com",
"phone": "+5511999998888"
}
}
'import requests
url = "https://besimplo.com/api/v1/customers"
payload = { "customer": {
"name": "João Silva",
"external_code": "01953808-3a3a-712f-99ce-f6943c8141db",
"identifier": "123.456.789-00",
"email": "joao.silva@exemplo.com",
"phone": "+5511999998888"
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
name: 'João Silva',
external_code: '01953808-3a3a-712f-99ce-f6943c8141db',
identifier: '123.456.789-00',
email: 'joao.silva@exemplo.com',
phone: '+5511999998888'
}
})
};
fetch('https://besimplo.com/api/v1/customers', 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://besimplo.com/api/v1/customers",
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([
'customer' => [
'name' => 'João Silva',
'external_code' => '01953808-3a3a-712f-99ce-f6943c8141db',
'identifier' => '123.456.789-00',
'email' => 'joao.silva@exemplo.com',
'phone' => '+5511999998888'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://besimplo.com/api/v1/customers"
payload := strings.NewReader("{\n \"customer\": {\n \"name\": \"João Silva\",\n \"external_code\": \"01953808-3a3a-712f-99ce-f6943c8141db\",\n \"identifier\": \"123.456.789-00\",\n \"email\": \"joao.silva@exemplo.com\",\n \"phone\": \"+5511999998888\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://besimplo.com/api/v1/customers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"name\": \"João Silva\",\n \"external_code\": \"01953808-3a3a-712f-99ce-f6943c8141db\",\n \"identifier\": \"123.456.789-00\",\n \"email\": \"joao.silva@exemplo.com\",\n \"phone\": \"+5511999998888\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://besimplo.com/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"name\": \"João Silva\",\n \"external_code\": \"01953808-3a3a-712f-99ce-f6943c8141db\",\n \"identifier\": \"123.456.789-00\",\n \"email\": \"joao.silva@exemplo.com\",\n \"phone\": \"+5511999998888\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cus_01h455vb4pex5vsknk084sn02q",
"object": "customer",
"live_mode": true,
"created": 1680893993,
"name": "João Silva",
"external_code": "01953808-3a3a-712f-99ce-f6943c8141db",
"identifier": "123.456.789-00",
"email": "joao.silva@exemplo.com",
"phone": "+5511999998888",
"description": "individual",
"address": {
"zip_code": "12345012",
"street": "Alguma Rua",
"number": "9934",
"district": "D'algum Bairro",
"city": "Campinas",
"state": "SP",
"complement": "Apt. 123"
}
}
Clientes
Criar novo cliente
Criar novo cliente na sua conta
POST
/
api
/
v1
/
customers
Criar novo cliente
curl --request POST \
--url https://besimplo.com/api/v1/customers \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"name": "João Silva",
"external_code": "01953808-3a3a-712f-99ce-f6943c8141db",
"identifier": "123.456.789-00",
"email": "joao.silva@exemplo.com",
"phone": "+5511999998888"
}
}
'import requests
url = "https://besimplo.com/api/v1/customers"
payload = { "customer": {
"name": "João Silva",
"external_code": "01953808-3a3a-712f-99ce-f6943c8141db",
"identifier": "123.456.789-00",
"email": "joao.silva@exemplo.com",
"phone": "+5511999998888"
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
name: 'João Silva',
external_code: '01953808-3a3a-712f-99ce-f6943c8141db',
identifier: '123.456.789-00',
email: 'joao.silva@exemplo.com',
phone: '+5511999998888'
}
})
};
fetch('https://besimplo.com/api/v1/customers', 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://besimplo.com/api/v1/customers",
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([
'customer' => [
'name' => 'João Silva',
'external_code' => '01953808-3a3a-712f-99ce-f6943c8141db',
'identifier' => '123.456.789-00',
'email' => 'joao.silva@exemplo.com',
'phone' => '+5511999998888'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://besimplo.com/api/v1/customers"
payload := strings.NewReader("{\n \"customer\": {\n \"name\": \"João Silva\",\n \"external_code\": \"01953808-3a3a-712f-99ce-f6943c8141db\",\n \"identifier\": \"123.456.789-00\",\n \"email\": \"joao.silva@exemplo.com\",\n \"phone\": \"+5511999998888\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://besimplo.com/api/v1/customers")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"name\": \"João Silva\",\n \"external_code\": \"01953808-3a3a-712f-99ce-f6943c8141db\",\n \"identifier\": \"123.456.789-00\",\n \"email\": \"joao.silva@exemplo.com\",\n \"phone\": \"+5511999998888\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://besimplo.com/api/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"name\": \"João Silva\",\n \"external_code\": \"01953808-3a3a-712f-99ce-f6943c8141db\",\n \"identifier\": \"123.456.789-00\",\n \"email\": \"joao.silva@exemplo.com\",\n \"phone\": \"+5511999998888\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cus_01h455vb4pex5vsknk084sn02q",
"object": "customer",
"live_mode": true,
"created": 1680893993,
"name": "João Silva",
"external_code": "01953808-3a3a-712f-99ce-f6943c8141db",
"identifier": "123.456.789-00",
"email": "joao.silva@exemplo.com",
"phone": "+5511999998888",
"description": "individual",
"address": {
"zip_code": "12345012",
"street": "Alguma Rua",
"number": "9934",
"district": "D'algum Bairro",
"city": "Campinas",
"state": "SP",
"complement": "Apt. 123"
}
}
Authorizations
Response
Operação realizada com sucesso

