OpheliaDocs
Search docs⌘K
DashboardCreate an account
Payments

Link wallet

Pay with a card from the person's Stripe Link wallet. They approve each purchase in Link, and Link issues a one-time card for that booking only.

Where it works

Send payment_collection: "link_wallet" on any v1 booking that takes a card, on a v1 flight, or on a v3 booking at commit. It works with live and test keys. Link's own limits apply: US and Canadian Link accounts only, and at most 500 USD per purchase.

After the person approves, the booking runs with Link's card and Link's billing address, exactly as it would with a card you sent. The venue's own steps still apply. For example, a restaurant can still text a code after the card goes in, so keep branching on next_action.type.

Before you start

  • An Ophelia API key. Use a v1 key for v1 bookings and flights. For v3, the key needs the v3:book scope.
  • The person's Link access token. Run Link's sign-in with your own OAuth client and ask for the payment_methods.agentic scope (Stripe: Link Agent Wallet). The token looks like liwltoken_…. Ophelia never runs Link's sign-in and never keeps a refresh token, so you send a token on each booking.
  • At least 35 minutes left on the token. Link's access tokens last an hour, and the booking reads Link with the token for up to 32 minutes while it waits for the approval.
  • A way to show the person a link, for Link's approval page.

Integrate on v1

1.Create the booking

Send payment_collection: "link_wallet" and link_wallet, and no card. The amount the person approves is also the one-time card's cap. Ophelia takes it from metadata.amount_cents (with metadata.currency, default usd), else the price the slot was offered at. A restaurant's card hold has no price, so send amount_cents there: the most the venue could charge under its terms, such as the no-show fee.

curl
curl -X POST "https://api.opheliaos.com/v1/bookings" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: YOUR_UUID" \
-d '{
"vertical": "dining",
"venue_id": "ven_...",
"availability_id": "avail_...",
"datetime": "2026-12-04T19:00:00-08:00",
"party_size": 2,
"customer": {
"name": "First Last",
"email": "jane.smith.diner@gmail.com",
"phone_number": "+1XXXXXXXXXX"
},
"payment_collection": "link_wallet",
"link_wallet": { "access_token": "liwltoken_...", "test": false },
"metadata": { "amount_cents": 5000, "currency": "usd" }
}'

Ophelia asks Link for the person's approval before the booking row exists. If Link refuses, nothing is created and the call answers with the code (see Errors).

2.Send the person to Link

The booking comes back requires_action. next_action.urlis Link's approval page. Show it to the person. Nothing runs until they approve. If their Link settings approve the purchase on their own, the booking skips this step and runs at once.

Response
json
{
"id": "bkg_...",
"object": "booking",
"status": "requires_action",
"next_action": {
"type": "payment",
"message": "Open this link to approve the payment in Link. The booking is made once it is approved.",
"url": "https://app.link.com/...",
"expires_at": "2026-11-23T18:32:00Z"
}
}

The booking.requires_action webhook carries the same next_action, so you can send the link from a webhook handler.

3.Read the outcome

Link sends no callback to you. Ophelia reads the approval for you, so read GET /v1/bookings/{booking_id} every few seconds, or wait for the booking.confirmed and booking.failed webhooks. Once the person approves, the booking moves to processing and then on like any card booking. If they decline, or the approval lapses, it fails with a link_wallet_* code and nothing was attempted at the venue.

curl
curl "https://api.opheliaos.com/v1/bookings/bkg_..." \
-H "Authorization: Bearer YOUR_KEY"

Cancelling a booking that is still waiting (POST /v1/bookings/{booking_id}/cancel) also cancels the request in Link, so the person can no longer approve it.

Flights

A flight takes the same two fields. The cap is the flight's max_total, and Link's 500 USD limit is the one flights meet most often: a max_total over it is refused before anything runs. Everything else is as on the Flights page.

Integrate on v3

On POST /v3/bookings, send payment_collection: "link_wallet" and link_wallet at max_commitment: "commit". authorize.max_total and authorize.currency are required on every vertical: they are the amount the person approves and the card's cap. Without them the call is 422 max_total_required.

json
{
"site": "https://shop.example.com",
"max_commitment": "commit",
"payment_collection": "link_wallet",
"link_wallet": { "access_token": "liwltoken_...", "test": false },
"authorize": { "max_total": 80, "currency": "USD" }
// ...and the rest of the order, as for any v3 booking. No card.
}

The answer is 202 requires_action with challenge_type: "link_wallet_approval", pay_url (Link's approval page, for the person) and pay_expires_at. Nothing is driven until they approve. Read the outcome on GET /v3/bookings/{booking_id}. An abandon cancels the request in Link. See v3 payment for the rest of the order flow.

Timing and limits

WhatValue
Approval window
32 minutes from create, at next_action.expires_at (v1) or pay_expires_at (v3): Link's 30 minutes plus time for its last answer.
Token
At least 35 minutes left when you create the booking.
Amount
At most 500 USD per purchase (Link's limit). Other currencies are left to Link to refuse.
Card lifetime
For a dated booking, the one-time card stays open until a week after the date, so a no-show fee charged on the day still goes through.
Accounts
US and Canadian Link accounts only (Link's limit).

On v3 the wait is held in memory: an Ophelia restart while the person has not yet approved ends the booking link_wallet_expired, with nothing attempted. On v1 the wait survives a restart.

Errors

CodeWhere it showsWhat to do
field: link_wallet.access_token or field: link_wallet: the collection without a token, or a token without the collection.
HTTP 400 at create.
Send both, or neither.
card_with_link_wallet
HTTP 400 at create.
Send a card or the Link wallet, not both.
amount_required
HTTP 400 at create (v1).
Send metadata.amount_cents.
max_total_required
HTTP 422 at create (v3).
Send authorize.max_total and authorize.currency.
link_wallet_amount_over_limit
HTTP 400 at create (v1), 409 (v3). Nothing is created.
The amount is over 500 USD. Pay another way.
link_wallet_unauthorized
At create, or as the booking's error_code.
Link refused the token. Get a fresh one, or have the person sign in to Link again.
link_wallet_error
HTTP 502 at create, or as the booking's error_code.
Link failed, or approved but issued a card without its CVV. Nothing was attempted. Try again.
link_wallet_unavailable
HTTP 503 at create.
Link payments are off. Pay another way, or contact support.
link_wallet_declined
Booking error_code.
The person declined in Link. Nothing was attempted.
link_wallet_expired
Booking error_code.
The approval window passed. Start a new booking.
link_wallet_action_required
Booking error_code.
Link needs the person to fix something in their wallet; error_message says what. Start a new booking once it is resolved.
link_wallet_canceled
Booking error_code.
The request was cancelled in Link. Start a new booking.

Every link_wallet_* failure means nothing was attempted at the venue and nothing was charged. Once the card is in, failures are the ones any card booking can have, such as card_declined. See Errors for every code.

Testing

Send "test": true in link_walletto use Link's test mode: the approval screen is real, and the card it issues charges nothing. The token must come from a sign-in in Link's test mode.

A test-mode card still books for real. Link's test mode only stops the charge; the venue still gets the booking. To run the whole loop with nothing booked, use a test key on a practice venue in "Ophelia Test City" (see Testing) with "test": true.

Security

The person's token can ask their wallet for cards, so keep it server side and send it only to Ophelia. Ophelia keeps it encrypted with the booking while the approval is pending, removes it when the card arrives, and never passes it to the browser that books. It is never logged or returned in a response. The one-time card is capped at the approved amount and good for this booking only.