Get Payment
curl --request GET \
--url https://api.magebank.ai/payments/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/payments/{id}"
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/payments/{id}', 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/payments/{id}",
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/payments/{id}"
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/payments/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/payments/{id}")
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_wDG5cavUCoK53uvFzTvkey",
"name": "Vendor XYZ Payment",
"type": "EXTERNAL",
"senderagentid": "agent_eC6ZezevNsqxvoKmQrUuoU",
"receiveragentid": "agent_k77NTwxp2Ym3JCmVsKtXQA",
"status": "New",
"approvalstatus": "Waiting for Sender Approval",
"approvalrequired": true,
"contactdetails": {
"email": "[email protected]",
"phoneNumber": "+1234567890"
},
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 6,
"currency": "USDC"
},
"tags": ["vendor", "regular"],
"createdat": "2025-04-17T10:28:18Z",
"approvedat": null
}
{
"error": "Payment not found"
}
{
"error": "Internal server error"
}
Payments
Get Payment
Fetch details of a specific payment
GET
/
payments
/
{id}
Get Payment
curl --request GET \
--url https://api.magebank.ai/payments/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/payments/{id}"
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/payments/{id}', 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/payments/{id}",
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/payments/{id}"
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/payments/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/payments/{id}")
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_wDG5cavUCoK53uvFzTvkey",
"name": "Vendor XYZ Payment",
"type": "EXTERNAL",
"senderagentid": "agent_eC6ZezevNsqxvoKmQrUuoU",
"receiveragentid": "agent_k77NTwxp2Ym3JCmVsKtXQA",
"status": "New",
"approvalstatus": "Waiting for Sender Approval",
"approvalrequired": true,
"contactdetails": {
"email": "[email protected]",
"phoneNumber": "+1234567890"
},
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 6,
"currency": "USDC"
},
"tags": ["vendor", "regular"],
"createdat": "2025-04-17T10:28:18Z",
"approvedat": null
}
{
"error": "Payment not found"
}
{
"error": "Internal server error"
}
Payment Details: Retrieves detailed information about a specific payment based on its ID. Converts short ID format to UUID format internally before querying the database.
Path Parameters
string
required
Payment ID (can be a short ID like payee_xxx)
Request Headers
string
required
Your API key for authentication
Response
string
Unique payment identifier
string
Name or description of the payment
string
Type of payment (EXTERNAL or INTERNAL)
string
ID of the agent sending the payment
string
ID of the agent receiving the payment
string
Current status of the payment
string
Approval status of the payment
boolean
Whether this payment requires approval
object
array
Tags or categories for the payment
string
Timestamp when the payment was created
string
Timestamp when the payment was approved
{
"id": "payee_wDG5cavUCoK53uvFzTvkey",
"name": "Vendor XYZ Payment",
"type": "EXTERNAL",
"senderagentid": "agent_eC6ZezevNsqxvoKmQrUuoU",
"receiveragentid": "agent_k77NTwxp2Ym3JCmVsKtXQA",
"status": "New",
"approvalstatus": "Waiting for Sender Approval",
"approvalrequired": true,
"contactdetails": {
"email": "[email protected]",
"phoneNumber": "+1234567890"
},
"paymentdetails": {
"method": "CRYPTO_ADDRESS",
"amount": 6,
"currency": "USDC"
},
"tags": ["vendor", "regular"],
"createdat": "2025-04-17T10:28:18Z",
"approvedat": null
}
{
"error": "Payment not found"
}
{
"error": "Internal server error"
}
Status Codes
| Status Code | Description |
|---|---|
| 200 | Payment details retrieved successfully |
| 404 | Not Found - Payment not found |
| 500 | Internal Server Error |
Payment Types: Use “EXTERNAL” for payments to recipients outside your agent network and “INTERNAL” for payments between your own agents.
Approval Flow: The
approvedat field will be null if the payment has not yet been approved or declined.