Setup
How do I set up custom actions for my payment processor?
Setting up custom actions for your payment processor in Chatref lets your AI agent complete account tasks directly in the chat - collecting user details, checking payment statuses, or triggering refunds. You'll define an action's input fields and the API endpoint it calls, then Chatref uses your uploaded knowledge to know when to fire each action.
What Are Custom Actions for Your Payment Processor?
Custom actions transform Chatref's AI agent from a question-answer bot into an active assistant that can talk to your payment processor's API. Instead of asking your team to look up an order, the agent can pull the status directly from Stripe, PayPal, Braintree, or your own internal system. The agent stays grounded in your own support docs, so it knows which action to use when a customer asks about a payment. It handles the data collection, calls the API, and returns the result in the conversation.
Common payment processor actions include:
- Checking an order or transaction status
- Issuing a partial or full refund
- Updating a payment method or billing address
- Cancelling a subscription or recurring payment
- Resending a receipt or invoice
These actions run securely via your configured endpoints, keeping sensitive data inside your own systems.
Prerequisites for Payment Processor Action Setup
Before creating a custom action in Chatref, make sure your payment processor's API documentation is included in your knowledge base. That helps the agent understand the action's purpose and when to invoke it. Upload a PDF of the integration guide, a help center article, or a text file that explains your refund policy, status check flows, and any business rules.
You'll also need:
- An active API key or access token for your payment processor, with the right permissions.
- The exact API endpoint URL, HTTP method, and expected request/response format.
- A list of the input fields the action requires (e.g., order ID, amount, currency, reason).
- A test mode or sandbox environment to validate the integration before going live.
Step-by-Step Action Setup in Chatref
Here's how to create and configure a custom action for your payment processor:
- Navigate to the Custom Actions page in your Chatref dashboard and click "Add Action".
- Name and describe the action - choose a clear name (e.g., "Check Order Status") and write a short description that helps the AI agent understand when to use it. Explain what the action does and what the user needs to provide.
- Define input fields - list each piece of information the agent must collect from the customer, like
order_id,email, orrefund_amount. Set each field's type (text, number, dropdown) and mark required ones. - Configure the API call - set the endpoint URL (e.g.,
https://api.example.com/v1/orders/{order_id}), select the HTTP method (GET, POST, etc.), add headers (such asAuthorization: Bearer YOUR_API_KEY), and build the request body using{{field_name}}placeholders for dynamic values. - Map the response - tell Chatref which part of the API response to display to the user, like the order status or a confirmation message. You can format the output with simple text templates.
- Test the action - use the built-in test tool to simulate a conversation, provide sample inputs, and verify the API call and response. Adjust field mappings until the action works as expected.
Once saved, the action is available immediately. When a user's question matches the knowledge base context and the action's description, the AI agent will guide the user through providing the necessary inputs and then call your API.
Best Practices for Payment Processor Custom Actions
Keep these points in mind to avoid common pitfalls:
- Start with a low-risk action - begin with a read-only query like "Check order status" before building a refund or cancellation action. This lets you validate the setup without affecting real transactions.
- Use precise descriptions - the action's description directly impacts the agent's ability to choose the right action. Write it as a natural-language rule: "Use this when a user asks about their payment status or provides an order number."
- Validate inputs thoroughly - set constraints on input fields so the agent asks for exactly what's needed. For example, require an order ID to match a pattern and a refund amount to be a positive number.
- Test in sandbox mode - always test payment actions against your processor's test environment first. Check both success and error responses so the agent can handle them gracefully.
- Monitor and refine - after going live, review conversations in the shared inbox. If the agent misinterprets an intent, add more clarifying documentation to your knowledge base or adjust the action description.
FAQ
What kind of custom actions can I set up for my payment processor? You can build any action that involves a request to your processor's API - status checks, refunds, payment method updates, subscription management, receipt resends, and more. As long as you can define the API endpoint, input fields, and response template, Chatref can turn it into a conversational action.
How do I create custom actions for my payment processor? From your Chatref dashboard, go to the Custom Actions section, create a new action, name it, define the inputs a user must provide, and configure the API endpoint with the correct method, headers, and body. Then map the response for display. Detailed steps are in the "Step-by-Step Action Setup" section above.
What are the best practices for setting up custom actions in payment processing? Start with non-destructive actions (like status checks) in a sandbox environment. Write clear, rule-based descriptions so the AI agent selects the right action. Validate all input fields, test edge cases, and monitor real conversations to fine-tune the agent's behaviour. Keep your knowledge base updated with payment-related policies and examples.
Put this into practice
Chatref answers your customers from your own content, day and night. Add it to your site and go live in minutes – free to start.