Pular para o conteúdo principal
POST
/
api
/
v1
/
brcode
/
Gerar BR Code
curl --request POST \
  --url https://spi.sandbox.lerian.net/api/v1/brcode/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "kind": "<string>",
  "merchantCity": "<string>",
  "merchantName": "<string>",
  "pixKey": "<string>",
  "amount": "<string>",
  "arrangementType": "<string>",
  "merchantCategoryCode": "<string>",
  "txId": "<string>"
}
'
import requests

url = "https://spi.sandbox.lerian.net/api/v1/brcode/"

payload = {
"kind": "<string>",
"merchantCity": "<string>",
"merchantName": "<string>",
"pixKey": "<string>",
"amount": "<string>",
"arrangementType": "<string>",
"merchantCategoryCode": "<string>",
"txId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
kind: '<string>',
merchantCity: '<string>',
merchantName: '<string>',
pixKey: '<string>',
amount: '<string>',
arrangementType: '<string>',
merchantCategoryCode: '<string>',
txId: '<string>'
})
};

fetch('https://spi.sandbox.lerian.net/api/v1/brcode/', 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://spi.sandbox.lerian.net/api/v1/brcode/",
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([
'kind' => '<string>',
'merchantCity' => '<string>',
'merchantName' => '<string>',
'pixKey' => '<string>',
'amount' => '<string>',
'arrangementType' => '<string>',
'merchantCategoryCode' => '<string>',
'txId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://spi.sandbox.lerian.net/api/v1/brcode/"

payload := strings.NewReader("{\n \"kind\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"pixKey\": \"<string>\",\n \"amount\": \"<string>\",\n \"arrangementType\": \"<string>\",\n \"merchantCategoryCode\": \"<string>\",\n \"txId\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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://spi.sandbox.lerian.net/api/v1/brcode/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"pixKey\": \"<string>\",\n \"amount\": \"<string>\",\n \"arrangementType\": \"<string>\",\n \"merchantCategoryCode\": \"<string>\",\n \"txId\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://spi.sandbox.lerian.net/api/v1/brcode/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"pixKey\": \"<string>\",\n \"amount\": \"<string>\",\n \"arrangementType\": \"<string>\",\n \"merchantCategoryCode\": \"<string>\",\n \"txId\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "createdAt": "<string>",
  "id": "<string>",
  "kind": "<string>",
  "merchantCity": "<string>",
  "merchantName": "<string>",
  "pixKey": "<string>",
  "status": "<string>",
  "updatedAt": "<string>",
  "amount": "<string>",
  "copyPaste": "<string>",
  "payloadUrl": "<string>",
  "qrPngBase64": "<string>",
  "qrPngContentType": "<string>",
  "raw": "<string>",
  "txId": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Cabeçalhos

Idempotency-Key
string

Idempotency key, max 255 characters

Corpo

application/json
kind
string
obrigatório

BR Code kind: STATIC (reusable, no expiry) or DYNAMIC (single-use, resolved via payload URL). Empty defaults to STATIC.

Exemplo:

"STATIC"

merchantCity
string
obrigatório

Merchant city encoded into the EMV payload (EMV field 60).

Exemplo:

"São Paulo"

merchantName
string
obrigatório

Merchant legal/trade name encoded into the EMV payload (EMV field 59).

Exemplo:

"Lerian Studio"

pixKey
string
obrigatório

Pix key identifying the receiver (CPF/CNPJ, phone, email, or random EVP key).

Exemplo:

"12345678901"

amount
string

Transaction amount in BRL as a decimal string, scale 2 (e.g. "100.00"). Empty leaves the amount open for the payer to set.

Exemplo:

"100.00"

arrangementType
string

Pix arrangement type governing MCC/key/amount constraints (e.g. direct_participant). Empty applies the default arrangement.

Exemplo:

"direct_participant"

merchantCategoryCode
string

ISO 18245 four-digit Merchant Category Code; 0000 indicates no specific category.

Exemplo:

"0000"

txId
string

Merchant transaction identifier (EMV field 62.05). Empty for static codes that omit a transaction reference.

Exemplo:

"txid-abc-123"

Resposta

Created

createdAt
string
obrigatório

Creation timestamp in RFC3339 UTC.

Exemplo:

"2025-03-07T14:30:00Z"

id
string
obrigatório

Server-assigned payload identifier (UUID).

Exemplo:

"550e8400-e29b-41d4-a716-446655440000"

kind
string
obrigatório

BR Code kind: STATIC (reusable) or DYNAMIC (single-use).

Exemplo:

"STATIC"

merchantCity
string
obrigatório

Merchant city from the EMV payload (EMV field 60).

Exemplo:

"São Paulo"

merchantName
string
obrigatório

Merchant legal/trade name from the EMV payload (EMV field 59).

Exemplo:

"Lerian Studio"

pixKey
string
obrigatório

Pix key identifying the receiver (CPF/CNPJ, phone, email, or random EVP key).

Exemplo:

"12345678901"

status
string
obrigatório

Lifecycle status of the payload (e.g. ACTIVE).

Exemplo:

"ACTIVE"

updatedAt
string
obrigatório

Last-update timestamp in RFC3339 UTC.

Exemplo:

"2025-03-07T14:30:00Z"

amount
string

Transaction amount in BRL as a decimal string, scale 2 (empty when the amount is open).

Exemplo:

"100.00"

copyPaste
string

Pix copy-and-paste string (the raw EMV payload); empty when unavailable.

Exemplo:

"00020126580014br.gov.bcb.pix..."

payloadUrl
string

Resolvable payload location URL for dynamic codes (empty for static codes).

Exemplo:

"https://pix.example.com/qr/v2/550e8400"

qrPngBase64
string

QR code image rendered from the raw payload, base64-encoded PNG (only populated on generation responses).

Exemplo:

"iVBORw0KGgoAAAANSUhEUgAA..."

qrPngContentType
string

MIME content type of qrPngBase64 (image/png) when an image is present.

Exemplo:

"image/png"

raw
string

Raw EMV BR Code string; same value as copyPaste, retained for compatibility.

Exemplo:

"00020126580014br.gov.bcb.pix..."

txId
string

Merchant transaction identifier (EMV field 62.05); empty when not present.

Exemplo:

"txid-abc-123"