Skip to main content

Custom Voice Platform Integration

Add PCI-compliant voice payments to any voice agent platform — Outbox AI, Bland, or any custom Twilio-based system. This guide covers the universal integration pattern that works with any platform capable of HTTP tool calls and call transfers.

How It Works

1

Agent triggers payment collection

During a call, your voice agent calls the Maven API to create a payment session with the amount and caller’s phone number.
2

Maven returns a transfer number

Maven creates a session and returns a phone number (and SIP URI) to transfer the caller to.
3

Agent transfers the caller

Your agent transfers the live call to Maven’s secure payment line.
The transfer must preserve the original caller’s phone number. Maven matches sessions by caller ID. If your platform replaces the caller ID with its own trunk number during transfer, the session will silently fail to connect. See Caller ID Preservation below.
4

Payment collected

Maven collects the card details over voice, processes the payment, and sends a webhook with the result. The caller is optionally transferred back to your agent via the callback number.

Prerequisites

  1. A Maven account with an API key (mvn_test_ for test mode, mvn_live_ for production)
  2. An app with a payment gateway connected (Stripe, Authorize.net, Braintree, Shift4, or Fiserv)
  3. A voice agent platform that supports HTTP tool calls and call transfers

Step 1 — Create a Payment Session

When your agent decides to collect a payment, call the Maven API:
Response (HTTP 201):

HTTP 201 Compatibility

Some platforms (e.g. Outbox AI) only accept HTTP 200 as a success response. If your platform wraps non-200 responses as errors, add ?response_status=200 to force a 200 response:
The response body is identical — only the status code changes.

Step 2 — Transfer the Call

After creating the session, transfer the caller to the phone_number (PSTN) or sip_uri (SIP) returned in the response. Use a cold transfer — Maven handles the entire payment conversation.

PSTN Transfer

Transfer to the phone_number field. This works on any platform that supports standard call transfers.

SIP Transfer

Transfer to the sip_uri field. SIP transfers are more reliable for caller ID preservation because you can pass identifying headers:
  • X-Session-Id — The session UUID (highest priority match, skips caller ID lookup entirely)
  • X-Caller — The original caller’s phone number (useful if the platform can’t preserve caller ID natively)
If your platform supports SIP headers, pass X-Session-Id on the transfer. This is the most reliable matching method — it doesn’t depend on caller ID at all.

Step 3 — Get the Result

Maven sends a webhook to your app’s webhook URL when the session completes. You can also poll the session status:

Caller ID Preservation

This is the most common integration pitfall. Maven matches inbound calls to pending sessions by the caller’s phone number. If the caller ID doesn’t match, the session won’t connect.

How matching works

When Maven receives a transferred call, it checks these fields in priority order:
  1. X-Session-Id SIP header (direct UUID match — most reliable)
  2. X-Caller SIP header (phone number override)
  3. SIP To URI (if it contains the session ID or phone number)
  4. From field (the caller ID on the inbound leg)

Common pitfalls

Diagnosing caller ID issues

If sessions are created but calls don’t connect, verify the session exists for the expected caller:
If this returns the session, the issue is that the transferred call’s From doesn’t match +14155551234. Check your platform’s transfer settings.

Tool Configuration

Most voice agent platforms let you define HTTP tools. Here’s how to configure them:

collect_payment tool

Parameters:
The project, gateway, and mode fields should be hardcoded in the URL or request body rather than exposed to the LLM. Use the URL format:
with a fixed body that includes "project": "your-app-slug", "gateway": "stripe", "mode": "charge".

get_session tool

Use this after the caller returns from the payment line to check the result.

cancel_session tool

Example Agent Prompt

Add something like this to your voice agent’s system prompt:
If your agent has trouble chaining the create and transfer steps, add explicit instructions like “You MUST call transfer immediately after collect_payment succeeds — do not wait or ask for confirmation.”

Troubleshooting

Next

Webhooks

Get notified when sessions complete.

API Reference

Explore the full API.

Voice Settings

Configure TTS voice and language.

Testing

Test payments with test cards.