Skip to main content
Add card-on-file payments to an OpenAI Realtime agent two ways. In your agent keeps the caller on your bridge; your code calls Ringup’s tools to recognize the caller and charge the saved card, with no transfer. Recommended on Realtime: it needs nothing from the carrier leg, so it sidesteps the SIP REFER interop that hosted transfer depends on. Hosted transfers the call to a Ringup payment line at payment time. Either way a recognized caller never reads a card aloud, so no card data touches your bridge.

Prerequisites

  • A running OpenAI Realtime agent reachable over the phone (Twilio media streams, the SIP connector, or your own SIP trunk).
  • The telephony account that owns the inbound call leg, and a Ringup API key.

Set up

Keep the caller on your bridge and call Ringup’s tools straight from your handler with plain HTTP. No transfer, no payment line, and no dependence on the carrier leg honoring a SIP REFER.
1

Recognize the caller at the greeting

Call identify at the greeting, not at payment. Pass caller_phone, which your telephony resolved when the call connected. For a returning caller it returns their name, so your agent greets them by name and skips questions it can already answer. An unknown caller comes back known: false, an ordinary first call. See Recognize at the start of the call.
2

Open a Checkout Session when the order is confirmed

POST to create_checkout with the merchant and the caller. Ringup resolves the total (from the merchant’s order when you pass order_id), applies the merchant’s payment policy, and returns cards: the caller’s cards chargeable at this merchant. On payment_required: "none" say nothing about payment and finish the call.
3

Charge the card the caller picked

Read one card from cards back by brand and last four with the amount. After the caller agrees, POST to charge with the session and that card’s instrument_id. Ringup charges it off-session on the merchant’s own processor. A decline is a 402 in the standard error envelope, carrying the sentence your agent can speak.
4

Text a link when there is no card to offer

When cards is empty (or the charge declined), POST to send_link. The session is the only input, and Ringup texts a secure pay link. Check sent: false means a duplicate send returned the same link without texting again. See Send Link.
5

Register your webhook endpoint

In the Ringup dashboard, under Webhooks, add your HTTPS endpoint and copy the signing secret. Your code verifies the signature and handles checkout.succeeded. See Webhooks.
6

Test it, then go live

Use your rk_test_ key and call your agent from your own phone. On your first call you are texted a link and pay with the test card 4111 1111 1111 1111 (any future expiry, any CVC); on the next call you are recognized and pay on the saved Visa ending 1111. Expect the confirmation read back and a test-mode checkout.succeeded. Swap in your rk_live_ key to go live.
Before you go live: add the Connect button to your dashboard. Wiring the payment tools into your agent does not, by itself, let any charge settle. Each merchant must first connect their own payment processor, from a button you embed on your merchant-facing dashboard:
That is your publishable key, not your secret one. Ship it alongside this integration so a merchant can connect the moment they are ready; until they do, the payment layer stays inaudible on their calls, so going live early is safe. Button options and the connect flow: Payment providers.

Next steps

Testing

Test mode, the test card, and the flow to run a full payment.

Webhooks

Reconcile every payment from one signed event on your server.