OpheliaDocs
Search docs⌘K
DashboardCreate an account
Payments

Card inline

Collect the card in your own form and send it with the booking. No payment_collection field is needed.

The payment object

Every vertical takes the same paymentobject. The customer stays in your app: your form collects the card and your backend sends it to Ophelia, which types it into the provider's real checkout.

json
"payment": {
"card_number": "4111111111111111",
"exp_month": "12",
"exp_year": "2027",
"cvv": "123",
"name_on_card": "Jane Smith",
"address_line1": "123 Market St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94103",
"country": "US"
}

Field rules

All values are strings. Dining and hotels need only the card itself; fitness and entertainment also need the billing address.

FieldRule
card_number
Digits only.
exp_month
"01" to "12".
exp_year
Four digits, "2027".
postal_code
The card’s billing ZIP. The provider checks it, so a mismatch is a decline.
address_line1
With city, state and country: required for fitness and entertainment.

4111111111111111 is a placeholder that a real provider declines (card_declined). To try the flow, use the practice venues and their test cards.

Dining

Send metadata.payment on POST /v1/bookings when the slot's terms.card_required is true; a slot that says false books without one. Without a needed card, OpenTable fails with missing_card and Resy with card_required. The card is only entered when the venue's form asks for it to hold the table, and Ophelia never charges it. See Restaurant terms.

curl
curl -X POST "https://api.opheliaos.com/v1/bookings" \
-H "Authorization: Bearer YOUR_LIVE_KEY" \
-H "Idempotency-Key: dining-001" \
-H "Content-Type: application/json" \
-d '{
"vertical": "dining",
"venue_id": "ven_12345678",
"availability_id": "avail_3b8f02aa",
"datetime": "2026-11-15T19:00:00-05:00",
"party_size": 2,
"customer": { "name": "Jane Smith", "phone_number": "+15555555555", "email": "jane.smith.diner@gmail.com" },
"metadata": {
"payment": {
"card_number": "4111111111111111",
"exp_month": "12", "exp_year": "2027", "cvv": "123",
"name_on_card": "Jane Smith", "postal_code": "10014"
}
}
}'
# → "status": "requires_action", next_action.type "otp" (the diner gets an SMS code)

Fitness

Send metadata.payment on POST /v1/bookings. Mindbody charges it up front and needs the full billing address: without state or country the booking fails with missing_billing_fields. metadata.password is optional; without it Mindbody sends the member a code.

curl
curl -X POST "https://api.opheliaos.com/v1/bookings" \
-H "Authorization: Bearer YOUR_LIVE_KEY" \
-H "Idempotency-Key: fitness-001" \
-H "Content-Type: application/json" \
-d '{
"vertical": "fitness",
"venue_id": "ven_87654321",
"datetime": "2026-11-15T18:00:00",
"customer": { "name": "Jane Smith", "phone_number": "+15555555555", "email": "jane.smith.member@gmail.com" },
"metadata": {
"payment": {
"card_number": "4111111111111111",
"exp_month": "12", "exp_year": "2027", "cvv": "123",
"name_on_card": "Jane Smith",
"address_line1": "123 Market St", "city": "San Francisco",
"state": "CA", "postal_code": "94103", "country": "US"
}
}
}'

Entertainment

StubHub guest checkout asks for a verification code first (otp), then for the card (payment). Send the card up front in metadata.payment and the card step is answered from it, or send a top-level payment to /continue when the card step comes back. A re-prompt for a corrected card still comes back to you, so always branch on next_action.type.

curl
curl -X POST "https://api.opheliaos.com/v1/bookings/bkg_11223344/continue" \
-H "Authorization: Bearer YOUR_LIVE_KEY" \
-H "Content-Type: application/json" \
-d '{
"payment": {
"card_number": "4111111111111111",
"exp_month": "12", "exp_year": "2027", "cvv": "123",
"name_on_card": "Jane Smith",
"address_line1": "123 Market St", "city": "San Francisco",
"state": "CA", "postal_code": "94103", "country": "US"
}
}'

Hotels

A card in metadata.payment on POST /v1/bookings places the reservation and charges the full total in that call; add metadata.confirm: false to stop before the charge. Without one, the booking returns next_action.type: "payment": send the flat card fields to /continue, with "confirm": true to place it in the same call. See Hotels.

curl
curl -X POST "https://api.opheliaos.com/v1/bookings/bkg_55667788/continue" \
-H "Authorization: Bearer YOUR_LIVE_KEY" \
-H "Content-Type: application/json" \
-d '{
"card_number": "4111111111111111",
"exp_month": "12", "exp_year": "2027", "cvv": "123",
"name_on_card": "Jane Smith", "postal_code": "94103",
"confirm": true
}'

Flights

Flights take their own card shape, card on /continue, and nothing is bought until confirm: true. See Flights.

Security

Card data is encrypted in transit, sent only to the provider to complete the booking, and removed from the stored booking, from logs and from every response.

Rather not handle card numbers? Send a payment link, or use AgentCard.