Skip to main content

Create wallet

Route

POST
/api/v1/wallets

Usage

LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request POST "$LAGO_URL/api/v1/wallets" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"wallet": {
"name": "wallet_name",
"rate_amount": "1.5",
"paid_credits": "20.0",
"granted_credits": "10.0",
"currency": "USD",
"expiration_date": "2022-07-07",
"external_customer_id": "12345"
}
}'

Arguments

{
"wallet": {
"name": "wallet_name",
"rate_amount": "1.5",
"paid_credits": "20.0",
"granted_credits": "10.0",
"currency":"USD",
"expiration_date": "2022-07-07",
"external_customer_id": "12345"
}
}
AttributesTypeDescription
nameString      OptionalWallet name
rate_amountString      RequiredRate between credits and the amount in given currency
paid_creditsString      Optional (This field is required only if there is no granted credits)Paid credits.
granted_creditsString      Optional (This field is required only if there is no paid credits)Granted (free) credits.
currencyString      RequiredCurrency.
expiration_dateString      OptionalDate that determines when the wallet will expire.
external_customer_idString      RequiredExternal customer ID.

Responses

The wallet was created

Returns a wallet object.