Criar cliente
curl --request POST \
--url https://api.korbit.com.br/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"email": "jsmith@example.com",
"externalId": "<string>",
"name": "<string>",
"phone": "<string>"
}
'import requests
url = "https://api.korbit.com.br/v1/customers"
payload = {
"email": "jsmith@example.com",
"externalId": "<string>",
"name": "<string>",
"phone": "<string>"
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'jsmith@example.com',
externalId: '<string>',
name: '<string>',
phone: '<string>'
})
};
fetch('https://api.korbit.com.br/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://api.korbit.com.br/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([
'email' => 'jsmith@example.com',
'externalId' => '<string>',
'name' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-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://api.korbit.com.br/v1/customers"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.korbit.com.br/v1/customers")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korbit.com.br/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"address": {
"city": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"number": "<string>",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"environment": "live",
"externalId": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone": "<string>",
"taxId": {
"number": "<string>",
"type": "CPF"
},
"updatedAt": "2023-11-07T05:31:56Z",
"stats": {
"activePlan": {
"billingInterval": "MONTH",
"intervalCount": 6,
"productName": "<string>"
},
"activeSubscriptions": 1,
"hasHadSubscription": true,
"lastPaidAt": "2023-11-07T05:31:56Z",
"paidAmountMinor": 4503599627370495,
"paymentsCount": 1
}
}{
"address": {
"city": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"number": "<string>",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"environment": "live",
"externalId": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone": "<string>",
"taxId": {
"number": "<string>",
"type": "CPF"
},
"updatedAt": "2023-11-07T05:31:56Z",
"stats": {
"activePlan": {
"billingInterval": "MONTH",
"intervalCount": 6,
"productName": "<string>"
},
"activeSubscriptions": 1,
"hasHadSubscription": true,
"lastPaidAt": "2023-11-07T05:31:56Z",
"paidAmountMinor": 4503599627370495,
"paymentsCount": 1
}
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}Clientes e Pedidos
Criar cliente
Cadastra um cliente na sua base Korbit. O e-mail é o identificador natural: duplicado retorna 409 CUSTOMER_EMAIL_TAKEN. Compradores que já pagaram por link também aparecem aqui automaticamente.
POST
/
v1
/
customers
Criar cliente
curl --request POST \
--url https://api.korbit.com.br/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"email": "jsmith@example.com",
"externalId": "<string>",
"name": "<string>",
"phone": "<string>"
}
'import requests
url = "https://api.korbit.com.br/v1/customers"
payload = {
"email": "jsmith@example.com",
"externalId": "<string>",
"name": "<string>",
"phone": "<string>"
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'jsmith@example.com',
externalId: '<string>',
name: '<string>',
phone: '<string>'
})
};
fetch('https://api.korbit.com.br/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://api.korbit.com.br/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([
'email' => 'jsmith@example.com',
'externalId' => '<string>',
'name' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-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://api.korbit.com.br/v1/customers"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.korbit.com.br/v1/customers")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korbit.com.br/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"phone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"address": {
"city": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"number": "<string>",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"environment": "live",
"externalId": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone": "<string>",
"taxId": {
"number": "<string>",
"type": "CPF"
},
"updatedAt": "2023-11-07T05:31:56Z",
"stats": {
"activePlan": {
"billingInterval": "MONTH",
"intervalCount": 6,
"productName": "<string>"
},
"activeSubscriptions": 1,
"hasHadSubscription": true,
"lastPaidAt": "2023-11-07T05:31:56Z",
"paidAmountMinor": 4503599627370495,
"paymentsCount": 1
}
}{
"address": {
"city": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"number": "<string>",
"state": "<string>",
"street": "<string>",
"zipcode": "<string>"
},
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"environment": "live",
"externalId": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone": "<string>",
"taxId": {
"number": "<string>",
"type": "CPF"
},
"updatedAt": "2023-11-07T05:31:56Z",
"stats": {
"activePlan": {
"billingInterval": "MONTH",
"intervalCount": 6,
"productName": "<string>"
},
"activeSubscriptions": 1,
"hasHadSubscription": true,
"lastPaidAt": "2023-11-07T05:31:56Z",
"paidAmountMinor": 4503599627370495,
"paymentsCount": 1
}
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
1 - 255Body
application/json
E-mail único na sua base — usado no portal do cliente e nas cobranças recorrentes.
Required string length:
3 - 320Seu identificador interno do cliente para sincronização com sua base.
Required string length:
1 - 128Nome completo do cliente.
Required string length:
1 - 200Telefone do cliente (formato E.164 recomendado).
Required string length:
5 - 32Response
Default Response
Show child attributes
Show child attributes
Maximum string length:
320Available options:
live, test Maximum string length:
128Maximum string length:
200Maximum string length:
32Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?