cURL
curl --request POST \
--url https://api.uselotus.io/api/credits/{credit_id}/update/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.uselotus.io/api/credits/{credit_id}/update/"
payload = {
"description": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', expires_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.uselotus.io/api/credits/{credit_id}/update/', 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.uselotus.io/api/credits/{credit_id}/update/",
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([
'description' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.uselotus.io/api/credits/{credit_id}/update/"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.uselotus.io/api/credits/{credit_id}/update/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselotus.io/api/credits/{credit_id}/update/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"credit_id": "<string>",
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"amount": 5000000000,
"amount_remaining": 5000000000,
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"description": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "active",
"amount_paid": 0,
"amount_paid_currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"drawdowns": [
{
"credit_id": "<string>",
"amount": -5000000000,
"applied_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}
]
}Credits
Update credit
POST
/
api
/
credits
/
{credit_id}
/
update
/
cURL
curl --request POST \
--url https://api.uselotus.io/api/credits/{credit_id}/update/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.uselotus.io/api/credits/{credit_id}/update/"
payload = {
"description": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', expires_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.uselotus.io/api/credits/{credit_id}/update/', 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.uselotus.io/api/credits/{credit_id}/update/",
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([
'description' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.uselotus.io/api/credits/{credit_id}/update/"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.uselotus.io/api/credits/{credit_id}/update/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselotus.io/api/credits/{credit_id}/update/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"credit_id": "<string>",
"customer": {
"customer_name": "<string>",
"email": "jsmith@example.com",
"customer_id": "<string>"
},
"amount": 5000000000,
"amount_remaining": 5000000000,
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"description": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "active",
"amount_paid": 0,
"amount_paid_currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"drawdowns": [
{
"credit_id": "<string>",
"amount": -5000000000,
"applied_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}
]
}This can be used to alter the description or expiration date of a credit. If the credit expiry is in the past, this will throw an error. If the targeted credit is no longer active, this will throw an error.
lotus.update_credit(
credit_id='credit_0569173ee6654369',
description='New description',
expires_at='2027-01-01T00:00:00Z'
)
await lotus.updateCredit({
credit_id: "credit_0569173ee6654369",
description: "New description",
expires_at: "2027-01-01T00:00:00Z",
});
Authorizations
knoxTokenAuthOrganizationApiKeyAuth
Token-based authentication with required prefix "Token"
Path Parameters
The ID of the credit to retrieve or update.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
200 - application/json
Show child attributes
Show child attributes
Required range:
0 <= x < 10000000000Required range:
0 <= x < 10000000000Show child attributes
Show child attributes
active- Activeinactive- Inactive
Available options:
active, inactive Required range:
-10000000000 < x < 10000000000Show child attributes
Show child attributes
Show child attributes
Show child attributes