authorize step: the card is ready as soon as you create it, and fill is its only operation. it’s unrelated to capabilities.single_use_card on the wallet’s payment methods, which reports whether an enrolled card can pay.
Before you start
- create a vault and a KERNEL wallet in it. the wallet must be
connected, but it doesn’t need any cards of its own. - get the card details from your card issuer in your backend, not in the agent’s context.
- a scoped api key needs
vaults:writeto create and delete the card, andvaults:useandbrowsers:useto fill it.
Create a single-use card
create acard item under the wallet with spec.single_use_card set to the card’s details:
KERNEL records
amount, currency, and merchant_name but doesn’t enforce them. any spending limit is up to the card’s issuer.
an invalid request returns
400, and error messages never include the values you sent. single_use_card can’t be combined with payment_method_id, and only card items accept it, not payment_request items. if the wallet isn’t connected, creation returns 409.
state.sourceissingle_use_card, which tells it apart from a purchase funded by one of the wallet’s cards. a single-use card has nopayment_method_idorfunding_status.state.masksholds the card’sbrandandlast4.state.domainsholds the registrable domain ofmerchant_url.spec.single_use_cardreturns onlyreference. the card details are write-only: KERNEL stores them encrypted and never returns or logs them.
Fill the checkout
attach the vault when you create the browser, then invokefill with the browser’s browser_id, the exact current top-level page_url, and field bindings. single-use cards support these fields:
request only the fields the checkout shows. requesting a billing field you didn’t supply returns
field_unavailable before anything is written.
fill works on any https page whose registrable domain matches merchant_url’s, including its subdomains. a card created with https://www.example.com/checkout fills on https://checkout.example.com/pay. stores on a shared hosting platform stay separate: a card for a.myshopify.com can’t fill b.myshopify.com. a page on any other domain returns 403 with destination_denied, and KERNEL refuses http pages.
Delete the card after checkout
delete the card as soon as the checkout is submitted. deleting the card, its wallet, or its vault deletes the stored card details immediately.Expiry and deletion
expires_at defaults to 2 hours after creation. a value you set must be in the future and at most 24 hours after creation. neither can be later than the end of the card’s expiry month.
from expires_at, reads report the card’s status as expired, and fill returns 409 without writing anything. KERNEL deletes the stored card details shortly after expires_at. to remove them sooner, delete the card.
Retries and updates
creating a card is idempotent per key:
compute
expires_at once and reuse the same request when you retry. use a new key for each card.
single-use cards can’t be updated; PATCH returns 409. to change anything, delete the card and create a new one under a new key. authorize and confirm_transaction aren’t available for single-use cards.
Reference
- fill browser fields: selectors, payment frames, and fill outcomes.
- pay with card: create a KERNEL wallet and pay with a user’s own card.
- vault items api: request fields and validation.