- 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
Update a wallet
This endpoint is used to update an existing wallet with prepaid credits.
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 name of the wallet.
The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
List of recurring transaction rules. Currently, we only allow one recurring rule per wallet.
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request PUT "$LAGO_URL/api/v1/wallets/:lago_id" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"wallet": {
"name": "Prepaid Credits",
"expiration_at": "2022-07-07T23:59:59Z"
}
}'
{
"wallet": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "hooli_1234",
"status": "active",
"currency": "USD",
"name": "Prepaid",
"rate_amount": "1.5",
"credits_balance": "28.0",
"balance_cents": 1000,
"consumed_credits": "2.0",
"created_at": "2022-04-29T08:59:51Z",
"expiration_at": "2023-11-07T05:31:56Z",
"last_balance_sync_at": "2022-04-29T08:59:51Z",
"last_consumed_credit_at": "2022-04-29T08:59:51Z",
"terminated_at": "2022-09-14T16:35:31Z",
"recurring_transaction_rules": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"rule_type": "interval",
"interval": "monthly",
"threshold_credits": "20.0",
"paid_credits": "20.0",
"granted_credits": "10.0",
"created_at": "2022-04-29T08:59:51Z"
}
],
"ongoing_balance_cents": 800,
"ongoing_usage_balance_cents": 200,
"credits_ongoing_balance": "8.0",
"credits_ongoing_usage_balance": "2.0"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
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.
Body
The name of the wallet.
The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
List of recurring transaction rules. Currently, we only allow one recurring rule per wallet.
A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule.
The rule type. Possible values are interval
or threshold
.
interval
, threshold
The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: weekly
, monthly
, quarterly
or yearly
. Required only when rule type is set to interval
.
weekly
, monthly
, quarterly
, yearly
The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to threshold
.
The number of paid credits. Required only if there is no granted credits.
The number of free granted credits. Required only if there is no paid credits.
Response
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.
Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer’s record within the Lago system.
The customer external unique identifier (provided by your own application)
The status of the wallet. Possible values are active
or terminated
.
active
, terminated
The currency of the wallet.
AED
, AFN
, ALL
, AMD
, ANG
, AOA
, ARS
, AUD
, AWG
, AZN
, BAM
, BBD
, BDT
, BGN
, BIF
, BMD
, BND
, BOB
, BRL
, BSD
, BWP
, BYN
, BZD
, CAD
, CDF
, CHF
, CLF
, CLP
, CNY
, COP
, CRC
, CVE
, CZK
, DJF
, DKK
, DOP
, DZD
, EGP
, ETB
, EUR
, FJD
, FKP
, GBP
, GEL
, GIP
, GMD
, GNF
, GTQ
, GYD
, HKD
, HNL
, HRK
, HTG
, HUF
, IDR
, ILS
, INR
, ISK
, JMD
, JPY
, KES
, KGS
, KHR
, KMF
, KRW
, KYD
, KZT
, LAK
, LBP
, LKR
, LRD
, LSL
, MAD
, MDL
, MGA
, MKD
, MMK
, MNT
, MOP
, MRO
, MUR
, MVR
, MWK
, MXN
, MYR
, MZN
, NAD
, NGN
, NIO
, NOK
, NPR
, NZD
, PAB
, PEN
, PGK
, PHP
, PKR
, PLN
, PYG
, QAR
, RON
, RSD
, RUB
, RWF
, SAR
, SBD
, SCR
, SEK
, SGD
, SHP
, SLL
, SOS
, SRD
, STD
, SZL
, THB
, TJS
, TOP
, TRY
, TTD
, TWD
, TZS
, UAH
, UGX
, USD
, UYU
, UZS
, VND
, VUV
, WST
, XAF
, XCD
, XOF
, XPF
, YER
, ZAR
, ZMW
The name of the wallet.
The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
The current wallet balance expressed in credits.
The current wallet balance expressed in cents.
The number of consumed credits.
The date of the wallet creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
The date and time that determines when the wallet will expire. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
The date and time of the last balance top-up. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
The date and time of the last credits consumption. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
The date of terminaison of the wallet. It follows the ISO 8601 datetime format and is expressed in Coordinated Universal Time (UTC).
List of recurring transaction rules. Currently, we only allow one recurring rule per wallet.
A unique identifier for the recurring transaction rule in the Lago application. Can be used to update a recurring transaction rule.
The rule type. Possible values are interval
or threshold
.
interval
, threshold
The interval used for recurring top-up. It represents the frequency at which automatic top-up occurs. The interval can be one of the following values: weekly
, monthly
, quarterly
or yearly
. Required only if rule type is set to interval
.
weekly
, monthly
, quarterly
, yearly
The threshold for recurring top-ups is the value at which an automatic top-up is triggered. For example, if this threshold is set at 10 credits, an automatic top-up will occur whenever the wallet balance falls to or below 10 credits. Required only when rule type is set to threshold
.
The number of paid credits. Required only if there is no granted credits.
The number of free granted credits. Required only if there is no paid credits.
The date of the metadata object creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the metadata object was created
The wallet ongoing balance expressed in cents.
The wallet ongoing usage balance expressed in cents.
The wallet ongoing balance expressed in credits.
The wallet ongoing usage balance expressed in credits.
Was this page helpful?
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request PUT "$LAGO_URL/api/v1/wallets/:lago_id" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"wallet": {
"name": "Prepaid Credits",
"expiration_at": "2022-07-07T23:59:59Z"
}
}'
{
"wallet": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "hooli_1234",
"status": "active",
"currency": "USD",
"name": "Prepaid",
"rate_amount": "1.5",
"credits_balance": "28.0",
"balance_cents": 1000,
"consumed_credits": "2.0",
"created_at": "2022-04-29T08:59:51Z",
"expiration_at": "2023-11-07T05:31:56Z",
"last_balance_sync_at": "2022-04-29T08:59:51Z",
"last_consumed_credit_at": "2022-04-29T08:59:51Z",
"terminated_at": "2022-09-14T16:35:31Z",
"recurring_transaction_rules": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"rule_type": "interval",
"interval": "monthly",
"threshold_credits": "20.0",
"paid_credits": "20.0",
"granted_credits": "10.0",
"created_at": "2022-04-29T08:59:51Z"
}
],
"ongoing_balance_cents": 800,
"ongoing_usage_balance_cents": 200,
"credits_ongoing_balance": "8.0",
"credits_ongoing_usage_balance": "2.0"
}
}