Example: Check Payment Status (Mercado Pago)
This article shows how to create a Custom Tool in Frontline that checks a customer's payment status using the Mercado Pago API. This setup allows your AI Agent to confirm if a payment has been received, is pending, or failed — directly from the conversation.
⚙️ What you’ll need
Before creating the tool, make sure you have:
A Mercado Pago account with API access.
A Test or Production Access Token (Bearer token).
An External Reference or Email to identify the payment.
Tip: You can find your access tokens in your Mercado Pago developer dashboard under Credentials.
🚀 Step-by-step setup
1) Create the Custom Tool
Go to Platform → Tools → Create Tool.
Tool name: Check Payment Status.
When to use: e.g., use this tool when a customer asks if their payment went through.
Select Custom Tool as the Tool type.
(See screenshot: Edit Custom Tool – selecting Custom Tool.)
2) Configure the API connection
API Request
Method:
GETURL:
https://api.mercadopago.com/v1/payments/search?external_reference={external_reference}You can also filter by email or other fields if preferred:
https://api.mercadopago.com/v1/payments/search?email={email}HTTP Headers
Key | Value |
|
|
|
|
Data inputs
Format | Name | Example |
Text |
| |
Text |
|
|
3) Test the tool
Click Test Response to send a test request.
A successful response (
200 OK) will return a JSON object with a list of payments.
Example response:
{ "results": [ { "status": "approved", "transaction_amount": 1500.0, "payment_method_id": "visa", "date_approved": "2025-06-18T10:42:00.000-03:00" } ] }4) Interpret the result
Frontline will receive the JSON response and your Agent can use it to inform the user. For example:
“Your payment was approved on June 18 at 10:42. Thank you!”
You can also route different responses based on payment status (e.g., approved, pending, rejected).
✅ Best practices
Always use secure tokens and avoid exposing them in the UI or logs.
Use Test credentials while setting up to avoid triggering real charges.
Filter by both
external_referenceandemailfor higher accuracy.Log responses in your CRM or database for traceability.
🔍 Troubleshooting
Issue | Possible cause |
401 Unauthorized | Invalid or expired token. Generate a new one from Mercado Pago dashboard. |
404 No results | No payments found for that reference or email. |
400 Bad Request | Incorrect query format. Check parameters and encoding. |
Example setup in Frontline
(See screenshot: “Connect your API – Mercado Pago GET example” showing Authorization header and data inputs.)
Still have questions?
Reach out through the Help button in Frontline or contact your CSM for assist
