Credits
Create a credit
Create a credit
POST
/
api
/
credits
/
Authorization
Body
curl --request POST \
--url https://api.uselotus.io/api/credits/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 123,
"amount_paid": 123,
"amount_paid_currency_code": "<string>",
"currency_code": "<string>",
"customer_id": "<string>",
"description": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}'
{
"amount": 123,
"amount_paid": 123,
"amount_paid_currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"amount_remaining": 123,
"credit_id": "<string>",
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"customer": {
"customer_id": "<string>",
"customer_name": "<string>",
"email": "jsmith@example.com"
},
"description": "<string>",
"drawdowns": [
{
"amount": 123,
"applied_at": "2023-11-07T05:31:56Z",
"credit_id": "<string>",
"description": "<string>"
}
],
"effective_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "active"
}
Creates a credit.
lotus.create_credit(
customer_id='cust_0569173ee6654369',
amount=120.00,
currency_code='USD',
)
lotus.create_credit(
customer_id='cust_0569173ee6654369',
amount=1000.00,
currency_code='USD',
description="Prepurchased credit",
expires_at="2024-01-01T00:00:00Z",
amount_paid=500.00,
amount_paid_currency_code='USD',
)
Authorizations
Authorization
string
headerrequiredToken-based authentication with required prefix "Token"
Body
amount
number
requiredamount_paid
number
amount_paid_currency_code
string
currency_code
string
requiredcustomer_id
string | null
requiredThe id provided when creating the customer, we suggest matching with your internal customer id in your backend
description
string | null
effective_at
string
expires_at
string | null
Response
201 - application/json
amount
number
requiredamount_paid
number
requiredamount_paid_currency
object
requiredamount_remaining
number
requiredcredit_id
string
requiredcurrency
object
requiredcustomer
object
requireddescription
string | null
requireddrawdowns
object[]
requiredeffective_at
string
requiredexpires_at
string | null
requiredstatus
enum<string>
requiredactive
- Activeinactive
- Inactive
Available options:
active
, inactive
curl --request POST \
--url https://api.uselotus.io/api/credits/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 123,
"amount_paid": 123,
"amount_paid_currency_code": "<string>",
"currency_code": "<string>",
"customer_id": "<string>",
"description": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}'
{
"amount": 123,
"amount_paid": 123,
"amount_paid_currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"amount_remaining": 123,
"credit_id": "<string>",
"currency": {
"code": "<string>",
"name": "<string>",
"symbol": "<string>"
},
"customer": {
"customer_id": "<string>",
"customer_name": "<string>",
"email": "jsmith@example.com"
},
"description": "<string>",
"drawdowns": [
{
"amount": 123,
"applied_at": "2023-11-07T05:31:56Z",
"credit_id": "<string>",
"description": "<string>"
}
],
"effective_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "active"
}