Documentation Index
Fetch the complete documentation index at: https://docs.trymaven.com/llms.txt
Use this file to discover all available pages before exploring further.
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
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.
Maven returns a transfer number
Maven creates a session and returns a phone number (and SIP URI) to transfer the caller to.
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
- A Maven account with an API key (
mvn_test_for test mode,mvn_live_for production) - An app with a payment gateway connected (Stripe, Authorize.net, Braintree, Shift4, or Fiserv)
- 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:| Field | Description |
|---|---|
project | Your app slug from the Maven Dashboard |
caller | The customer’s phone number in E.164 format. Must match the caller ID on the transferred call. |
amount | Payment amount in dollars (e.g. 150.00) |
gateway | stripe, authorizenet, braintree, shift4, or fiserv |
mode | charge (process immediately) or tokenize (save card only) |
description | Optional — what the payment is for |
callback | Optional — phone number or SIP URI to transfer the caller back to after payment |
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:
Step 2 — Transfer the Call
After creating the session, transfer the caller to thephone_number (PSTN) or sip_uri (SIP) returned in the response. Use a cold transfer — Maven handles the entire payment conversation.
PSTN Transfer
Transfer to thephone_number field. This works on any platform that supports standard call transfers.
SIP Transfer
Transfer to thesip_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)
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:X-Session-IdSIP header (direct UUID match — most reliable)X-CallerSIP header (phone number override)- SIP
ToURI (if it contains the session ID or phone number) Fromfield (the caller ID on the inbound leg)
Common pitfalls
| Platform behavior | Result | Fix |
|---|---|---|
| Platform replaces caller ID with its own trunk number | Session doesn’t match | Use SIP transfer with X-Session-Id header |
| Platform uses agent’s number as caller ID | Session doesn’t match | Configure transfer to use customer’s number as displayed caller ID |
| Platform strips SIP headers | Falls back to From field matching | Ensure PSTN caller ID is preserved |
Diagnosing caller ID issues
If sessions are created but calls don’t connect, verify the session exists for the expected caller: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
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.trymaven.com/v1/sessions?response_status=200 |
| Headers | Authorization: Bearer YOUR_API_KEY, Content-Type: application/json |
The with a fixed body that includes
project, gateway, and mode fields should be hardcoded in the URL or request body rather than exposed to the LLM. Use the URL format:"project": "your-app-slug", "gateway": "stripe", "mode": "charge".get_session tool
| Setting | Value |
|---|---|
| Method | GET |
| URL | https://api.trymaven.com/v1/sessions?caller={phone_number} |
| Headers | Authorization: Bearer YOUR_API_KEY |
cancel_session tool
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.trymaven.com/v1/sessions/{session_id}/cancel |
| Headers | Authorization: Bearer YOUR_API_KEY |
Example Agent Prompt
Add something like this to your voice agent’s system prompt:Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
Tool call returns error with 201 in the message | Platform doesn’t accept HTTP 201 | Add ?response_status=200 to the URL |
| Session created but call doesn’t connect | Caller ID mismatch | See Caller ID Preservation |
| Agent creates session but doesn’t transfer | LLM not chaining tool calls | Add explicit transfer instructions to agent prompt |
| Transfer connects but “no session found” | Session expired (5 min TTL) | Create the session immediately before transferring, not at the start of the call |
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.
