Integration

Collecting Payment

1

Create tools

In VAPI, you’ll need to create the SendContextToProtegee and GetContextFromProtegee tools in order to let your agent interact with Protegee. Don’t worry, all this requires from you is to press a button.

You’ll want to grab your VAPI private api key. It will look like:

Once you have that, you can run the following curl command (but replace my_protegee_api_token and my_vapi_private_key with the correct keys)

You can also manually try out the endpoint by checking out: VAPI Create Tools

2

Setup forwarding phone number + Enable SendContextFromProtegee

On Assistant 1’s function page, make sure SendContextFromProtegee is selected from the dropdown and the forwarding phone number is set to Protegee’s number (you can this at settings).

3

Prompt your agent to call SendContextToProtegee tool + transfer the call

This lets Protegee know who to handle the payment for and how much. Something similar to:

Agent Instructions

  • Send the details to Protegee with the tool SendContextToProtegee, including all fields requested by SendContextToProtegee
  • Let the caller know you need to take a $25 deposit to confirm the appointment, and ask them to let you know when they’re ready with their credit card
  • Transfer the caller to Protegee at the saved transfer phone number. Just tell the caller to hang on one sec while you get the secure payment process ready.
  • 4

    Give it a shot

    If you have any issues, check out the debug page for more information.

    Checking on the status of the payment

    The following instructions are OPTIONAL. If you specified a number in the callback field, Protegee will transfer the caller back to this number once the payment process is complete. In order to continue the call, you’ll want to make a webhook to get details on how the call went. The following are instructions on how to do that.

    1

    Setup a callback agent

    If you’d like the caller to be transferred back from Protegee, make a second agent and enable GetContextFromProtegee on the agent’s Functions page.

    2

    Enable GetContextFromProtegee tool call for the agent

    On Assistant 1’s function page, make sure SendContextFromProtegee is selected from the dropdown and the forwarding phone number is set to Protegee’s number (you can this at settings).

    3

    Prompt your agent to check the status

    You can add something like this to Agent 2’s prompt.

    Agent Prompt

    After you greet the caller with the first message, immediately call the GetContextFromProtegee function and read back the response to the caller. Then ask if there’s anything else you can help with. If they wish to book an appointment, your goal is to gather necessary information from callers in a friendly and efficient manner like follows…

    4

    Try it out!

    If you have any issues, check out the debug page for more information.