Skip to content

Linked card Beta ​

With a linked card, an agent pays a merchant checkout with a card the user has linked in the FluxA Wallet. The agent never sees the real card number. Each purchase uses a CARD_USD mandate that is limited to one merchant and a maximum amount, and the user approves it on one of their linked cards.

Availability

Linked cards are enabled per account. If they aren't available, commands return Linked cards are not available for this wallet. The user can check the Agent Cards page in the wallet.

For cards funded from the wallet balance, see Agent cards instead.

Flow ​

bash
# 1. Does the user have a linked card?
fluxa-wallet linked-card list

# 2. Is there already a mandate that can pay this merchant and amount (cents)?
fluxa-wallet linked-card mandates --host www.amazon.com --amount 3000

# 3. If not, create one ($30.00 at Amazon) and send the user the approvalUrl
fluxa-wallet mandate-create --currency CARD_USD --desc "Buy a USB-C cable on Amazon, up to $30" \
  --amount 3000 --merchant-name Amazon --merchant-url https://www.amazon.com --merchant-country US

# 4. Wait until it's ready
fluxa-wallet linked-card subcard --mandate mand_xxx      # repeat until "isReady": true

# 5. Pay the merchant checkout
fluxa-wallet headless-checkout --mandate mand_xxx --attempt wpa_xxx --billing @billing.json

Confirm the merchant, product and amount with the user before steps 3 and 5. Never ask the user for card numbers: cards are linked only in the wallet.

mandate-create --currency CARD_USD ​

FlagRequiredDescription
--descYesWhat is being bought. Shown to the user. Max 255 bytes, single line
--amountYesMaximum amount in US cents (3000 = $30.00)
--merchant-nameYes*Merchant name, max 40 bytes (e.g. Amazon)
--merchant-urlYes*Merchant's HTTPS site
--merchant-countryYes*2-letter country code
--transaction-refNoYour order reference, max 50 bytes
--ext—*Instead of the merchant flags: JSON or @file.json with { "merchant": { "name", "url", "country_code" }, "transaction_reference_id"? }
--secondsNoValidity, default 28800 (8 hours)

The response contains mandateId and approvalUrl. The user opens the link, picks a linked card and completes card verification. If approval fails because the merchant isn't recognised, check the merchant name, URL and country.

linked-card list ​

bash
fluxa-wallet linked-card list [--limit 20] [--cursor <nextCursor>]

Lists the user's linked cards: id, brand, last4, expMonth, expYear, status, plus nextCursor for paging.

linked-card mandates ​

UsageShows
linked-card mandatesAll of this agent's CARD_USD mandates with status and remaining amount
linked-card mandates --card <id>Mandates approved on one linked card
linked-card mandates --host <host> --amount <cents>Only approved mandates that can pay that amount at that merchant right now

linked-card subcard ​

bash
fluxa-wallet linked-card subcard --mandate mand_xxx

Shows the payment credential issued under a mandate. The fields to use:

FieldMeaning
isReadytrue when the mandate is approved and can pay. Wait for this before headless-checkout
approvalUrlSet while the user still needs to approve
remainingAmountCents left under this mandate
validUntilWhen the mandate expires
merchantThe merchant the mandate is limited to

If the readiness check can't complete, isReady stays false; retry shortly.

headless-checkout ​

bash
fluxa-wallet headless-checkout --mandate mand_xxx --attempt wpa_xxx --billing @billing.json
FlagRequiredDescription
--mandateYesA ready CARD_USD mandate
--attemptYesThe payment attempt ID (wpa_…) from the merchant's checkout
--billingNoJSON or @file: firstName, lastName, address1, address2, city, state, country, zip, phone, email

The result contains attempt.attemptId, attempt.status and attempt.actionUrl. If actionUrl is present, give it to the user to complete 3-D Secure, then confirm the order with the merchant.

Errors ​

ErrorWhat to do
Linked cards are not available for this walletNot enabled for this account. Don't retry
card_mandate_not_activeThe mandate isn't approved, is disabled, or has expired. Send the user approvalUrl from the error, or create a new mandate
card_execution_mode_mismatchThat mandate isn't a linked-card mandate. Pick one from linked-card mandates
invalid_attempt_idPass the wpa_… ID from the merchant checkout
Invalid CARD_USD mandate: <field> …Fix the flag named in the message

Released under the MIT License.