- Documentation
- API References
- Integrations
- Templates
- Blog
- FAQ
- GitHub
- Getting started
Add-ons
Analytics
Billable metrics
Coupons
Credit notes
Customer usage
Customers
Events
Fees
Invoices
Organizations
Plans
Resources
Subscriptions
Taxes
Wallets
Webhook endpoints
Webhooks
API Reference
Top-up a wallet
This endpoint is used to top-up an active wallet.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
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.
The number of paid credits.
The number of free granted credits.
The number of voided credits.
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",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10.0",
"credit_amount": "100.0",
"settled_at": "2022-04-29T08:59:51Z",
"created_at": "2022-04-29T08:59:51Z"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
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.
The number of paid credits.
The number of free granted credits.
The number of voided credits.
Response
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.
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.
The status of the wallet transaction. Possible values are pending
or settled
.
pending
, settled
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
The type of transaction. Possible values are inbound
(increasing the balance) or outbound
(decreasing the balance).
inbound
, outbound
The amount of credits based on the rate and the currency.
The number of credits used in the wallet transaction.
The date when wallet transaction is settled, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
The date of the wallet transaction creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
Was this page helpful?
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",
"transaction_status": "purchased",
"transaction_type": "inbound",
"amount": "10.0",
"credit_amount": "100.0",
"settled_at": "2022-04-29T08:59:51Z",
"created_at": "2022-04-29T08:59:51Z"
}
]
}