Criar Ordem Lightning
curl --request POST \
--url https://api.example.com/api/v1/order/create/lightning \
--header 'Content-Type: application/json' \
--data '
{
"value": 123,
"email": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/order/create/lightning"
payload = {
"value": 123,
"email": "<string>",
"name": "<string>"
}
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({value: 123, email: '<string>', name: '<string>'})
};
fetch('https://api.example.com/api/v1/order/create/lightning', 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.example.com/api/v1/order/create/lightning",
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([
'value' => 123,
'email' => '<string>',
'name' => '<string>'
]),
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://api.example.com/api/v1/order/create/lightning"
payload := strings.NewReader("{\n \"value\": 123,\n \"email\": \"<string>\",\n \"name\": \"<string>\"\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://api.example.com/api/v1/order/create/lightning")
.header("Content-Type", "application/json")
.body("{\n \"value\": 123,\n \"email\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/order/create/lightning")
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 \"value\": 123,\n \"email\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"order": {
"id": "<string>",
"paymentLinkId": "<string>",
"value": 123,
"status": "<string>",
"invoice": "<string>",
"link": "<string>",
"createdAt": "<string>"
}
}Lightning
Criar Ordem Lightning
Crie uma nova ordem de pagamento Lightning Network
POST
/
api
/
v1
/
order
/
create
/
lightning
Criar Ordem Lightning
curl --request POST \
--url https://api.example.com/api/v1/order/create/lightning \
--header 'Content-Type: application/json' \
--data '
{
"value": 123,
"email": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/order/create/lightning"
payload = {
"value": 123,
"email": "<string>",
"name": "<string>"
}
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({value: 123, email: '<string>', name: '<string>'})
};
fetch('https://api.example.com/api/v1/order/create/lightning', 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.example.com/api/v1/order/create/lightning",
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([
'value' => 123,
'email' => '<string>',
'name' => '<string>'
]),
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://api.example.com/api/v1/order/create/lightning"
payload := strings.NewReader("{\n \"value\": 123,\n \"email\": \"<string>\",\n \"name\": \"<string>\"\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://api.example.com/api/v1/order/create/lightning")
.header("Content-Type", "application/json")
.body("{\n \"value\": 123,\n \"email\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/order/create/lightning")
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 \"value\": 123,\n \"email\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"order": {
"id": "<string>",
"paymentLinkId": "<string>",
"value": 123,
"status": "<string>",
"invoice": "<string>",
"link": "<string>",
"createdAt": "<string>"
}
}Criar ordem de pagamento Lightning Network
Este endpoint gera uma nova fatura (invoice) Lightning Network para o valor especificado, permitindo pagamentos rápidos e com baixas taxas em Bitcoin.Requisição
number
required
O valor do pagamento em BRL (será convertido para satoshis)
string
Email do cliente (opcional)
string
Nome do cliente (opcional)
Exemplo de requisição
curl -X POST "https://server.cryptouse.com.br/api/v1/order/create/lightning" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer seu_token_aqui" \
-d '{
"value": 50.00,
"email": "cliente@exemplo.com",
"name": "João Silva"
}'
Resposta
string
Mensagem de sucesso
object
Show Propriedades
Show Propriedades
Exemplo de resposta
{
"message": "Lightning invoice was successfully created",
"order": {
"id": "688a5e459b11ce1a1a85e32a",
"paymentLinkId": "98e56f6d-b600-48d2-a251-8c7b206958b2",
"value": 5000,
"status": "PENDING",
"invoice": "Inbc75800n1p5g5hj9pp58x8fx94hdc19zxpn3ecxc349mkje27v738a981ztczeqq2y0cmvsdquf9h8vmmfvdjjqsmj09c8gmm4wdjscqzysxqzjhsp54qv2q6",
"link": "https://cryptouse.com.br/order/lightning/98e56f6d-b600-48d2-a251-8c7b206958b2",
"createdAt": "2025-07-30T18:02:45.965Z"
}
}
{
"success": false,
"error": "OpenNode API error: 400 Bad Request"
}
O que é Lightning Network?
Lightning Network é uma solução de “segunda camada” construída sobre o Bitcoin que permite transações quase instantâneas e com taxas extremamente baixas. É ideal para:- Micropagamentos
- Transações de alto volume
- Pagamentos em tempo real
Pagamento via Lightning Network
Os usuários podem pagar uma fatura Lightning das seguintes formas:- Escaneando o QR code com uma carteira Lightning compatível
- Copiando e colando a string da fatura em sua carteira Lightning
- Clicando no link de pagamento em um dispositivo com uma carteira Lightning instalada
Tempo de expiração
As faturas Lightning Network expiram após 15 minutos se não forem pagas.Conversão de valor
O valor em BRL é convertido para satoshis (a menor unidade do Bitcoin) no momento da criação da fatura, utilizando a taxa de câmbio atual. O camposatoshis na resposta indica o valor exato a ser pago.