curl --request POST \
--url https://api.lbpay.example.com/v1/beneficiaries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"relationshipType": "THIRD_PARTY",
"entity": {
"type": "INDIVIDUAL",
"firstName": "Maria",
"lastName": "Silva",
"birthDate": "1990-01-15",
"identificationDocument": {
"type": "CPF",
"value": "12345678901",
"countryCode": "BR"
},
"address": {
"line1": "Rua das Flores 250",
"city": "Belo Horizonte",
"state": "MG",
"postalCode": "30130-110",
"country": "BRA"
}
},
"paymentInstructions": [
{
"rail": "PIX_KEY",
"asset": "BRL",
"dictKeyType": "CPF",
"dictKey": "12345678901"
}
]
}
'import requests
url = "https://api.lbpay.example.com/v1/beneficiaries"
payload = {
"relationshipType": "THIRD_PARTY",
"entity": {
"type": "INDIVIDUAL",
"firstName": "Maria",
"lastName": "Silva",
"birthDate": "1990-01-15",
"identificationDocument": {
"type": "CPF",
"value": "12345678901",
"countryCode": "BR"
},
"address": {
"line1": "Rua das Flores 250",
"city": "Belo Horizonte",
"state": "MG",
"postalCode": "30130-110",
"country": "BRA"
}
},
"paymentInstructions": [
{
"rail": "PIX_KEY",
"asset": "BRL",
"dictKeyType": "CPF",
"dictKey": "12345678901"
}
]
}
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({
relationshipType: 'THIRD_PARTY',
entity: {
type: 'INDIVIDUAL',
firstName: 'Maria',
lastName: 'Silva',
birthDate: '1990-01-15',
identificationDocument: {type: 'CPF', value: '12345678901', countryCode: 'BR'},
address: {
line1: 'Rua das Flores 250',
city: 'Belo Horizonte',
state: 'MG',
postalCode: '30130-110',
country: 'BRA'
}
},
paymentInstructions: [{rail: 'PIX_KEY', asset: 'BRL', dictKeyType: 'CPF', dictKey: '12345678901'}]
})
};
fetch('https://api.lbpay.example.com/v1/beneficiaries', 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.lbpay.example.com/v1/beneficiaries",
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([
'relationshipType' => 'THIRD_PARTY',
'entity' => [
'type' => 'INDIVIDUAL',
'firstName' => 'Maria',
'lastName' => 'Silva',
'birthDate' => '1990-01-15',
'identificationDocument' => [
'type' => 'CPF',
'value' => '12345678901',
'countryCode' => 'BR'
],
'address' => [
'line1' => 'Rua das Flores 250',
'city' => 'Belo Horizonte',
'state' => 'MG',
'postalCode' => '30130-110',
'country' => 'BRA'
]
],
'paymentInstructions' => [
[
'rail' => 'PIX_KEY',
'asset' => 'BRL',
'dictKeyType' => 'CPF',
'dictKey' => '12345678901'
]
]
]),
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.lbpay.example.com/v1/beneficiaries"
payload := strings.NewReader("{\n \"relationshipType\": \"THIRD_PARTY\",\n \"entity\": {\n \"type\": \"INDIVIDUAL\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Silva\",\n \"birthDate\": \"1990-01-15\",\n \"identificationDocument\": {\n \"type\": \"CPF\",\n \"value\": \"12345678901\",\n \"countryCode\": \"BR\"\n },\n \"address\": {\n \"line1\": \"Rua das Flores 250\",\n \"city\": \"Belo Horizonte\",\n \"state\": \"MG\",\n \"postalCode\": \"30130-110\",\n \"country\": \"BRA\"\n }\n },\n \"paymentInstructions\": [\n {\n \"rail\": \"PIX_KEY\",\n \"asset\": \"BRL\",\n \"dictKeyType\": \"CPF\",\n \"dictKey\": \"12345678901\"\n }\n ]\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.lbpay.example.com/v1/beneficiaries")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"relationshipType\": \"THIRD_PARTY\",\n \"entity\": {\n \"type\": \"INDIVIDUAL\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Silva\",\n \"birthDate\": \"1990-01-15\",\n \"identificationDocument\": {\n \"type\": \"CPF\",\n \"value\": \"12345678901\",\n \"countryCode\": \"BR\"\n },\n \"address\": {\n \"line1\": \"Rua das Flores 250\",\n \"city\": \"Belo Horizonte\",\n \"state\": \"MG\",\n \"postalCode\": \"30130-110\",\n \"country\": \"BRA\"\n }\n },\n \"paymentInstructions\": [\n {\n \"rail\": \"PIX_KEY\",\n \"asset\": \"BRL\",\n \"dictKeyType\": \"CPF\",\n \"dictKey\": \"12345678901\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lbpay.example.com/v1/beneficiaries")
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 \"relationshipType\": \"THIRD_PARTY\",\n \"entity\": {\n \"type\": \"INDIVIDUAL\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Silva\",\n \"birthDate\": \"1990-01-15\",\n \"identificationDocument\": {\n \"type\": \"CPF\",\n \"value\": \"12345678901\",\n \"countryCode\": \"BR\"\n },\n \"address\": {\n \"line1\": \"Rua das Flores 250\",\n \"city\": \"Belo Horizonte\",\n \"state\": \"MG\",\n \"postalCode\": \"30130-110\",\n \"country\": \"BRA\"\n }\n },\n \"paymentInstructions\": [\n {\n \"rail\": \"PIX_KEY\",\n \"asset\": \"BRL\",\n \"dictKeyType\": \"CPF\",\n \"dictKey\": \"12345678901\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"relationshipType": "SELF_OWNED",
"entity": {
"type": "INDIVIDUAL",
"identificationDocument": {
"type": "<string>",
"value": "<string>",
"countryCode": "<string>"
},
"address": {
"line1": "Rua das Flores 250",
"city": "Belo Horizonte",
"state": "MG",
"postalCode": "30130-110",
"country": "BRA"
},
"firstName": "<string>",
"lastName": "<string>",
"businessName": "<string>",
"email": "jsmith@example.com",
"birthDate": "2023-12-25"
},
"beneficiaryId": "<string>",
"status": "ACTIVE",
"paymentInstructions": [
{
"rail": "<string>",
"asset": "<string>",
"paymentInstructionId": "<string>",
"status": "SCREENING",
"dictKeyType": "CPF",
"dictKey": "<string>",
"bankAccount": {},
"createdAt": "2023-11-07T05:31:56Z",
"screenedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "QUOTE_EXPIRED",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "QUOTE_EXPIRED",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "QUOTE_EXPIRED",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Cadastrar beneficiário
Cria o beneficiário e suas chaves Pix. Cada instrução entra em SCREENING e passa a APPROVED ou REJECTED de forma automática; o resultado é notificado por beneficiary.status_changed. A LB Pay não cadastra o beneficiário como cliente próprio.
curl --request POST \
--url https://api.lbpay.example.com/v1/beneficiaries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"relationshipType": "THIRD_PARTY",
"entity": {
"type": "INDIVIDUAL",
"firstName": "Maria",
"lastName": "Silva",
"birthDate": "1990-01-15",
"identificationDocument": {
"type": "CPF",
"value": "12345678901",
"countryCode": "BR"
},
"address": {
"line1": "Rua das Flores 250",
"city": "Belo Horizonte",
"state": "MG",
"postalCode": "30130-110",
"country": "BRA"
}
},
"paymentInstructions": [
{
"rail": "PIX_KEY",
"asset": "BRL",
"dictKeyType": "CPF",
"dictKey": "12345678901"
}
]
}
'import requests
url = "https://api.lbpay.example.com/v1/beneficiaries"
payload = {
"relationshipType": "THIRD_PARTY",
"entity": {
"type": "INDIVIDUAL",
"firstName": "Maria",
"lastName": "Silva",
"birthDate": "1990-01-15",
"identificationDocument": {
"type": "CPF",
"value": "12345678901",
"countryCode": "BR"
},
"address": {
"line1": "Rua das Flores 250",
"city": "Belo Horizonte",
"state": "MG",
"postalCode": "30130-110",
"country": "BRA"
}
},
"paymentInstructions": [
{
"rail": "PIX_KEY",
"asset": "BRL",
"dictKeyType": "CPF",
"dictKey": "12345678901"
}
]
}
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({
relationshipType: 'THIRD_PARTY',
entity: {
type: 'INDIVIDUAL',
firstName: 'Maria',
lastName: 'Silva',
birthDate: '1990-01-15',
identificationDocument: {type: 'CPF', value: '12345678901', countryCode: 'BR'},
address: {
line1: 'Rua das Flores 250',
city: 'Belo Horizonte',
state: 'MG',
postalCode: '30130-110',
country: 'BRA'
}
},
paymentInstructions: [{rail: 'PIX_KEY', asset: 'BRL', dictKeyType: 'CPF', dictKey: '12345678901'}]
})
};
fetch('https://api.lbpay.example.com/v1/beneficiaries', 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.lbpay.example.com/v1/beneficiaries",
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([
'relationshipType' => 'THIRD_PARTY',
'entity' => [
'type' => 'INDIVIDUAL',
'firstName' => 'Maria',
'lastName' => 'Silva',
'birthDate' => '1990-01-15',
'identificationDocument' => [
'type' => 'CPF',
'value' => '12345678901',
'countryCode' => 'BR'
],
'address' => [
'line1' => 'Rua das Flores 250',
'city' => 'Belo Horizonte',
'state' => 'MG',
'postalCode' => '30130-110',
'country' => 'BRA'
]
],
'paymentInstructions' => [
[
'rail' => 'PIX_KEY',
'asset' => 'BRL',
'dictKeyType' => 'CPF',
'dictKey' => '12345678901'
]
]
]),
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.lbpay.example.com/v1/beneficiaries"
payload := strings.NewReader("{\n \"relationshipType\": \"THIRD_PARTY\",\n \"entity\": {\n \"type\": \"INDIVIDUAL\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Silva\",\n \"birthDate\": \"1990-01-15\",\n \"identificationDocument\": {\n \"type\": \"CPF\",\n \"value\": \"12345678901\",\n \"countryCode\": \"BR\"\n },\n \"address\": {\n \"line1\": \"Rua das Flores 250\",\n \"city\": \"Belo Horizonte\",\n \"state\": \"MG\",\n \"postalCode\": \"30130-110\",\n \"country\": \"BRA\"\n }\n },\n \"paymentInstructions\": [\n {\n \"rail\": \"PIX_KEY\",\n \"asset\": \"BRL\",\n \"dictKeyType\": \"CPF\",\n \"dictKey\": \"12345678901\"\n }\n ]\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.lbpay.example.com/v1/beneficiaries")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"relationshipType\": \"THIRD_PARTY\",\n \"entity\": {\n \"type\": \"INDIVIDUAL\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Silva\",\n \"birthDate\": \"1990-01-15\",\n \"identificationDocument\": {\n \"type\": \"CPF\",\n \"value\": \"12345678901\",\n \"countryCode\": \"BR\"\n },\n \"address\": {\n \"line1\": \"Rua das Flores 250\",\n \"city\": \"Belo Horizonte\",\n \"state\": \"MG\",\n \"postalCode\": \"30130-110\",\n \"country\": \"BRA\"\n }\n },\n \"paymentInstructions\": [\n {\n \"rail\": \"PIX_KEY\",\n \"asset\": \"BRL\",\n \"dictKeyType\": \"CPF\",\n \"dictKey\": \"12345678901\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lbpay.example.com/v1/beneficiaries")
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 \"relationshipType\": \"THIRD_PARTY\",\n \"entity\": {\n \"type\": \"INDIVIDUAL\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Silva\",\n \"birthDate\": \"1990-01-15\",\n \"identificationDocument\": {\n \"type\": \"CPF\",\n \"value\": \"12345678901\",\n \"countryCode\": \"BR\"\n },\n \"address\": {\n \"line1\": \"Rua das Flores 250\",\n \"city\": \"Belo Horizonte\",\n \"state\": \"MG\",\n \"postalCode\": \"30130-110\",\n \"country\": \"BRA\"\n }\n },\n \"paymentInstructions\": [\n {\n \"rail\": \"PIX_KEY\",\n \"asset\": \"BRL\",\n \"dictKeyType\": \"CPF\",\n \"dictKey\": \"12345678901\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"relationshipType": "SELF_OWNED",
"entity": {
"type": "INDIVIDUAL",
"identificationDocument": {
"type": "<string>",
"value": "<string>",
"countryCode": "<string>"
},
"address": {
"line1": "Rua das Flores 250",
"city": "Belo Horizonte",
"state": "MG",
"postalCode": "30130-110",
"country": "BRA"
},
"firstName": "<string>",
"lastName": "<string>",
"businessName": "<string>",
"email": "jsmith@example.com",
"birthDate": "2023-12-25"
},
"beneficiaryId": "<string>",
"status": "ACTIVE",
"paymentInstructions": [
{
"rail": "<string>",
"asset": "<string>",
"paymentInstructionId": "<string>",
"status": "SCREENING",
"dictKeyType": "CPF",
"dictKey": "<string>",
"bankAccount": {},
"createdAt": "2023-11-07T05:31:56Z",
"screenedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": "QUOTE_EXPIRED",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "QUOTE_EXPIRED",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "QUOTE_EXPIRED",
"message": "<string>",
"requestId": "<string>",
"retryable": true,
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Autorizações
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Cabeçalhos
Unique key to prevent duplicate creation or execution.
8 - 128Corpo
Titularidade da conta de destino. SELF_OWNED: o beneficiário é a mesma pessoa que o remetente (conta própria no Brasil). THIRD_PARTY: o beneficiário é outra pessoa ou empresa. No withdrawal, SELF_OWNED exige senderRelationship = SELF e THIRD_PARTY não aceita SELF.
SELF_OWNED, THIRD_PARTY INDIVIDUAL exige firstName e lastName; BUSINESS exige businessName. Endereço obrigatório para a triagem.
Show child attributes
Show child attributes
Ao menos uma instrução APPROVED é necessária para criar um withdrawal para este beneficiário.
Show child attributes
Show child attributes
Resposta
Beneficiário criado; instruções em SCREENING
Titularidade da conta de destino. SELF_OWNED: o beneficiário é a mesma pessoa que o remetente (conta própria no Brasil). THIRD_PARTY: o beneficiário é outra pessoa ou empresa. No withdrawal, SELF_OWNED exige senderRelationship = SELF e THIRD_PARTY não aceita SELF.
SELF_OWNED, THIRD_PARTY INDIVIDUAL exige firstName e lastName; BUSINESS exige businessName. Endereço obrigatório para a triagem.
Show child attributes
Show child attributes
Situação do cadastro. Pode receber se ACTIVE e com ao menos uma instrução APPROVED.
ACTIVE, BLOCKED, INACTIVE Ao menos uma instrução APPROVED é necessária para criar um withdrawal para este beneficiário.
Show child attributes
Show child attributes

