POST
/
wallets
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": "Prepaid",
      "rate_amount": "1.5",
      "paid_credits": "20.0",
      "granted_credits": "10.0",
      "currency": "USD",
      "expiration_at": "2022-07-07",
      "external_customer_id": "hooli_1234"
    }
  }'
{
  "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",
        "trigger": "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

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
wallet
object

Response

200 - application/json
wallet
object
required