Get LSPS1 order
curl --request POST \
--url http://localhost:8000/api/v1/lsps1/get_order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"access_token": "ord_live_3rCkP9dG7mN4"
}
'import requests
url = "http://localhost:8000/api/v1/lsps1/get_order"
payload = {
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"access_token": "ord_live_3rCkP9dG7mN4"
}
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({
order_id: '550e8400-e29b-41d4-a716-446655440000',
access_token: 'ord_live_3rCkP9dG7mN4'
})
};
fetch('http://localhost:8000/api/v1/lsps1/get_order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/lsps1/get_order",
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([
'order_id' => '550e8400-e29b-41d4-a716-446655440000',
'access_token' => 'ord_live_3rCkP9dG7mN4'
]),
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 := "http://localhost:8000/api/v1/lsps1/get_order"
payload := strings.NewReader("{\n \"order_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"access_token\": \"ord_live_3rCkP9dG7mN4\"\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("http://localhost:8000/api/v1/lsps1/get_order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"access_token\": \"ord_live_3rCkP9dG7mN4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/lsps1/get_order")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"access_token\": \"ord_live_3rCkP9dG7mN4\"\n}"
response = http.request(request)
puts response.read_body{
"order_id": "<string>",
"client_pubkey": "<string>",
"lsp_balance_sat": 123,
"client_balance_sat": 123,
"required_channel_confirmations": 123,
"funding_confirms_within_blocks": 123,
"channel_expiry_blocks": 123,
"announce_channel": true,
"payment": {
"bolt11": {
"expires_at": "2023-11-07T05:31:56Z",
"fee_total_sat": 123,
"order_total_sat": 123,
"invoice": "<string>"
},
"onchain": {
"expires_at": "2023-11-07T05:31:56Z",
"fee_total_sat": 123,
"order_total_sat": 123,
"address": "<string>",
"min_fee_for_0conf": 123,
"min_onchain_payment_confirmations": 123,
"refund_onchain_address": "<string>",
"payment_status": "<string>",
"payment_difference": 123,
"last_payment_check": 123
}
},
"token": "",
"created_at": "2023-11-07T05:31:56Z",
"channel": {
"channel_id": "<string>",
"temporary_channel_id": "<string>",
"funded_at": "2023-11-07T05:31:56Z",
"funding_outpoint": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"asset_id": "<string>",
"lsp_asset_amount": 123,
"client_asset_amount": 123,
"rfq_id": "<string>",
"asset_price_sat": 123,
"failure_reason": "<string>",
"access_token": "<string>"
}{
"error_code": "LSPS1_INVALID_PARAMS",
"message": "Invalid order access token",
"details": {
"code": -32602,
"property": "access_token",
"message": "Invalid order access token"
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error": "missing_api_key"
}{
"error_code": "LSPS1_ORDER_NOT_FOUND",
"message": "Order Not found",
"details": {
"code": 101
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"detail": [
{
"loc": [
"body",
"rfq_id"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"error_code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"details": {
"retry_after": 60
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "INTERNAL_ERROR",
"message": "Internal Server Error",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}lsps1
Get LSPS1 order
Fetch the current LSPS1 order state. Clients must provide the per-order access_token returned at creation time. This endpoint is safe to poll.
POST
/
api
/
v1
/
lsps1
/
get_order
Get LSPS1 order
curl --request POST \
--url http://localhost:8000/api/v1/lsps1/get_order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"access_token": "ord_live_3rCkP9dG7mN4"
}
'import requests
url = "http://localhost:8000/api/v1/lsps1/get_order"
payload = {
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"access_token": "ord_live_3rCkP9dG7mN4"
}
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({
order_id: '550e8400-e29b-41d4-a716-446655440000',
access_token: 'ord_live_3rCkP9dG7mN4'
})
};
fetch('http://localhost:8000/api/v1/lsps1/get_order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/lsps1/get_order",
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([
'order_id' => '550e8400-e29b-41d4-a716-446655440000',
'access_token' => 'ord_live_3rCkP9dG7mN4'
]),
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 := "http://localhost:8000/api/v1/lsps1/get_order"
payload := strings.NewReader("{\n \"order_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"access_token\": \"ord_live_3rCkP9dG7mN4\"\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("http://localhost:8000/api/v1/lsps1/get_order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"access_token\": \"ord_live_3rCkP9dG7mN4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/lsps1/get_order")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"access_token\": \"ord_live_3rCkP9dG7mN4\"\n}"
response = http.request(request)
puts response.read_body{
"order_id": "<string>",
"client_pubkey": "<string>",
"lsp_balance_sat": 123,
"client_balance_sat": 123,
"required_channel_confirmations": 123,
"funding_confirms_within_blocks": 123,
"channel_expiry_blocks": 123,
"announce_channel": true,
"payment": {
"bolt11": {
"expires_at": "2023-11-07T05:31:56Z",
"fee_total_sat": 123,
"order_total_sat": 123,
"invoice": "<string>"
},
"onchain": {
"expires_at": "2023-11-07T05:31:56Z",
"fee_total_sat": 123,
"order_total_sat": 123,
"address": "<string>",
"min_fee_for_0conf": 123,
"min_onchain_payment_confirmations": 123,
"refund_onchain_address": "<string>",
"payment_status": "<string>",
"payment_difference": 123,
"last_payment_check": 123
}
},
"token": "",
"created_at": "2023-11-07T05:31:56Z",
"channel": {
"channel_id": "<string>",
"temporary_channel_id": "<string>",
"funded_at": "2023-11-07T05:31:56Z",
"funding_outpoint": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
},
"asset_id": "<string>",
"lsp_asset_amount": 123,
"client_asset_amount": 123,
"rfq_id": "<string>",
"asset_price_sat": 123,
"failure_reason": "<string>",
"access_token": "<string>"
}{
"error_code": "LSPS1_INVALID_PARAMS",
"message": "Invalid order access token",
"details": {
"code": -32602,
"property": "access_token",
"message": "Invalid order access token"
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error": "missing_api_key"
}{
"error_code": "LSPS1_ORDER_NOT_FOUND",
"message": "Order Not found",
"details": {
"code": 101
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"detail": [
{
"loc": [
"body",
"rfq_id"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"error_code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"details": {
"retry_after": 60
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "INTERNAL_ERROR",
"message": "Internal Server Error",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}Authorizations
Pass a Kaleido API key such as kld_live_c_....
Response
Successful Response
Available options:
CREATED, CHANNEL_OPENING, COMPLETED, FAILED, PENDING_RATE_DECISION Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I