LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/wallet_transactions" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"wallet_transaction": {
"wallet_id": "wallet_1234",
"paid_credits": "20.0",
"granted_credits": "10.0"
}
}'
{
"wallet_transactions": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_wallet_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"status": "settled",
"source": "manual",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10.0",
"credit_amount": "100.0",
"created_at": "2022-04-29T08:59:51Z",
"name": "Tokens for models 'high-fidelity-boost'",
"invoice_requires_successful_payment": false,
"metadata": [
{
"key": "example key",
"value": "example value"
},
{
"key": "another key",
"value": "another value"
}
],
"settled_at": "2022-04-29T08:59:51Z",
"failed_at": "2022-04-29T08:59:51Z"
}
]
}This endpoint is used to top-up an active wallet.
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/wallet_transactions" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"wallet_transaction": {
"wallet_id": "wallet_1234",
"paid_credits": "20.0",
"granted_credits": "10.0"
}
}'
{
"wallet_transactions": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_wallet_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"status": "settled",
"source": "manual",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10.0",
"credit_amount": "100.0",
"created_at": "2022-04-29T08:59:51Z",
"name": "Tokens for models 'high-fidelity-boost'",
"invoice_requires_successful_payment": false,
"metadata": [
{
"key": "example key",
"value": "example value"
},
{
"key": "another key",
"value": "another value"
}
],
"settled_at": "2022-04-29T08:59:51Z",
"failed_at": "2022-04-29T08:59:51Z"
}
]
}LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/wallet_transactions" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"wallet_transaction": {
"wallet_id": "wallet_1234",
"paid_credits": "20.0",
"granted_credits": "10.0"
}
}'
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Wallet transaction payload
Show child attributes
Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet's record within the Lago system.
"1a901a90-1a90-1a90-1a90-1a901a901a90"
The name of the wallet transaction. It will appear on the invoice as the label for the fee. If not set, the label on the invoice will fallback to either Prepaid credits - {{wallet_name}} if the wallet name is set, or Prepaid credits.
Note that this name will apply to all transactions (paid_credits, granted_credits and voided_credits) created by this action.
"Tokens for models 'high-fidelity-boost'"
The number of paid credits.
"20.0"
The number of free granted credits.
"10.0"
The number of voided credits.
"5.0"
A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
false
When true, allows topping up the wallet with transactions that exceed the paid top-up limits. Defaults to false.
false
This optional field allows you to store a list of key-value pairs that hold additional information or custom attributes related to the data.
[
{
"key": "example key",
"value": "example value"
},
{
"key": "another key",
"value": "another value"
}
]Wallet transaction created
Show child attributes
Unique identifier assigned to the wallet transaction within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet transaction's record within the Lago system.
"1a901a90-1a90-1a90-1a90-1a901a901a90"
Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the wallet's record within the Lago system.
"1a901a90-1a90-1a90-1a90-1a901a901a90"
The status of the wallet transaction. Possible values are pending, settled or failed.
pending, settled, failed "settled"
The source field represents the origin or trigger of the wallet transaction. Possible values are manual, interval, threshold
manual, interval, threshold "manual"
The transaction status of the wallet transaction. Possible values are purchased (with pending or settled status), granted (without invoice_id), voided or invoiced.
purchased, granted, voided, invoiced "purchased"
The type of transaction. Possible values are inbound (increasing the balance) or outbound (decreasing the balance).
inbound, outbound "inbound"
The amount of credits based on the rate and the currency.
"10.0"
The number of credits used in the wallet transaction.
"100.0"
The date of the wallet transaction creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
"2022-04-29T08:59:51Z"
The name of the wallet transaction. It will appear on the invoice as the label for the fee. If not set, the label on the invoice will fallback to either Prepaid credits - {{wallet_name}} if the wallet name is set, or Prepaid credits.
"Tokens for models 'high-fidelity-boost'"
A boolean setting that, when set to true, delays issuing an invoice for a wallet top-up until a successful payment is made; if false, the invoice is issued immediately upon wallet top-up, regardless of the payment status. Default value of false.
false
This field allows you to store a list of key-value pairs that hold additional information or custom attributes related to the data.
[
{
"key": "example key",
"value": "example value"
},
{
"key": "another key",
"value": "another value"
}
]The date when wallet transaction is settled, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
"2022-04-29T08:59:51Z"
The date when the wallet transaction failed, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
"2022-04-29T08:59:51Z"
Was this page helpful?