List User Payments
curl --request GET \
--url https://api.magebank.ai/user/payments \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/user/payments"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.magebank.ai/user/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magebank.ai/user/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.magebank.ai/user/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.magebank.ai/user/payments")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/user/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "payee_8tJo7vZb1RKo4oeyWuqgK",
"senderagentid": "agent_8tJo7vZb1RKo4oeyWuqgK",
"receiveragentid": "agent_7tJo7vZb1RKo4oeyWuqgK",
"initiatedBy": "Alice",
"receivedBy": "Bob",
"direction": "outgoing",
"name": "Payment from Alice to Bob",
"approvalstatus": "Approved",
"createdat": "2025-04-07T12:00:00Z",
"type": "EXTERNAL",
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 100,
"currency": "USDC"
}
},
{
"id": "payee_9tJo7vZb1RKo4oeyWuqgK",
"senderagentid": "agent_7tJo7vZb1RKo4oeyWuqgK",
"receiveragentid": "agent_8tJo7vZb1RKo4oeyWuqgK",
"initiatedBy": "Bob",
"receivedBy": "Alice",
"direction": "incoming",
"name": "Payment from Bob to Alice",
"approvalstatus": "Waiting",
"createdat": "2025-04-08T10:00:00Z",
"type": "EXTERNAL",
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 50,
"currency": "USDC"
}
}
]
{
"error": "Unauthorized"
}
{
"error": "Internal server error"
}
Payments
List User Payments
Get all payments related to the authenticated userâs agents
GET
/
user
/
payments
List User Payments
curl --request GET \
--url https://api.magebank.ai/user/payments \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/user/payments"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.magebank.ai/user/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magebank.ai/user/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.magebank.ai/user/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.magebank.ai/user/payments")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/user/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "payee_8tJo7vZb1RKo4oeyWuqgK",
"senderagentid": "agent_8tJo7vZb1RKo4oeyWuqgK",
"receiveragentid": "agent_7tJo7vZb1RKo4oeyWuqgK",
"initiatedBy": "Alice",
"receivedBy": "Bob",
"direction": "outgoing",
"name": "Payment from Alice to Bob",
"approvalstatus": "Approved",
"createdat": "2025-04-07T12:00:00Z",
"type": "EXTERNAL",
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 100,
"currency": "USDC"
}
},
{
"id": "payee_9tJo7vZb1RKo4oeyWuqgK",
"senderagentid": "agent_7tJo7vZb1RKo4oeyWuqgK",
"receiveragentid": "agent_8tJo7vZb1RKo4oeyWuqgK",
"initiatedBy": "Bob",
"receivedBy": "Alice",
"direction": "incoming",
"name": "Payment from Bob to Alice",
"approvalstatus": "Waiting",
"createdat": "2025-04-08T10:00:00Z",
"type": "EXTERNAL",
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 50,
"currency": "USDC"
}
}
]
{
"error": "Unauthorized"
}
{
"error": "Internal server error"
}
Payment History: View all incoming and outgoing payments associated with your agents, with optional filtering by approval status.
Request Headers
string
required
Your API key for authentication
Query Parameters
string
Filter payments by approval status (Approved, Declined, Pending, Waiting)
Response
Returns an array of payment objects, each containing:string
Unique payment identifier
string
ID of the agent sending the payment
string
ID of the agent receiving the payment
string
Name of the agent that initiated the payment
string
Name of the agent that received the payment
string
Direction of the payment relative to the userâs agents (incoming, outgoing)
string
Name or description of the payment
string
Approval status of the payment
string
Timestamp when the payment was created
string
Type of payment (EXTERNAL or INTERNAL)
object
[
{
"id": "payee_8tJo7vZb1RKo4oeyWuqgK",
"senderagentid": "agent_8tJo7vZb1RKo4oeyWuqgK",
"receiveragentid": "agent_7tJo7vZb1RKo4oeyWuqgK",
"initiatedBy": "Alice",
"receivedBy": "Bob",
"direction": "outgoing",
"name": "Payment from Alice to Bob",
"approvalstatus": "Approved",
"createdat": "2025-04-07T12:00:00Z",
"type": "EXTERNAL",
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 100,
"currency": "USDC"
}
},
{
"id": "payee_9tJo7vZb1RKo4oeyWuqgK",
"senderagentid": "agent_7tJo7vZb1RKo4oeyWuqgK",
"receiveragentid": "agent_8tJo7vZb1RKo4oeyWuqgK",
"initiatedBy": "Bob",
"receivedBy": "Alice",
"direction": "incoming",
"name": "Payment from Bob to Alice",
"approvalstatus": "Waiting",
"createdat": "2025-04-08T10:00:00Z",
"type": "EXTERNAL",
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 50,
"currency": "USDC"
}
}
]
{
"error": "Unauthorized"
}
{
"error": "Internal server error"
}
Status Codes
| Status Code | Description |
|---|---|
| 200 | List of payments retrieved successfully |
| 401 | Unauthorized |
| 500 | Internal Error |
Approval Status Values: Possible values for approvalStatus filter include: âApprovedâ, âDeclinedâ, âPendingâ, âWaitingâ, âWaiting for Sender Approvalâ
Direction: The âdirectionâ field makes it easy to identify whether a payment is incoming to your agent (received) or outgoing from your agent (sent).