Skip to main content

Documentation Index

Fetch the complete documentation index at: https://lago-target-wallet.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Wallet traceability lets you follow the credit flow between inbound (top-up) and outbound (usage deduction) transactions. For a given inbound transaction, you can see which outbound transactions consumed its credits — and for a given outbound transaction, you can see which inbound transactions funded it.

Track how credits were consumed

For an inbound wallet transaction, you can see all outbound transactions that consumed credits from it.
  1. Go to a specific customer;
  2. Open the “Wallets” tab and click on a specific wallet;
  3. Click on an inbound wallet transaction;
  4. Go to the “Consumptions” tab; and
  5. See all outbound wallet transactions linked to this top-up and the amount consumed by each.

Track how credits were funded

For an outbound wallet transaction, you can see all inbound transactions that funded it.
  1. Go to a specific customer;
  2. Open the “Wallets” tab and click on a specific wallet;
  3. Click on an outbound wallet transaction;
  4. Go to the “Fundings” tab; and
  5. See all inbound wallet transactions that funded this deduction and the amount each provided.

Route events to a specific wallet

Overview

Events can target a specific wallet. When calculating usage or applying credits for such events, credits are drawn from the targeted wallet rather than following the standard wallet selection logic. If a target_wallet_code refers to a wallet that does not exist, no credits will be applied for that event.

Requirements

To use wallet-targeted events, two things must be configured:
  1. Update the charge to set: accepts_target_wallets: true
  2. Include target_wallet_code in the event payload
{
  "event": {
    "transaction_id": "...",
    "external_subscription_id": "...",
    "code": "...",
    "target_wallet_code": "my_wallet_code",
    "properties": { }
  }
}

Behavior

Charge accepts_target_walletsEvent target_wallet_codeResult
trueValid wallet codeCredits are drawn from the targeted wallet
trueInvalid / non-existent wallet codeNo credits are applied
trueNot providedStandard wallet selection logic is applied
falseAny valueStandard wallet selection logic is applied (target is ignored)
  • A charge with accepts_target_wallets: true does not require every event to carry a target_wallet_code. Events without a target fall back to the standard logic.
  • Ensure the target_wallet_code matches an existing wallet’s code on the customer, otherwise the event produces no credit application.