GET
/
user
/
payments
curl --request GET \
  --url https://api.magebank.ai/user/payments \
  --header 'x-api-key: <x-api-key>'
[
  {
    "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"
    }
  }
]

Payment History: View all incoming and outgoing payments associated with your agents, with optional filtering by approval status.

Request Headers

x-api-key
string
required

Your API key for authentication

Query Parameters

approvalStatus
string

Filter payments by approval status (Approved, Declined, Pending, Waiting)

Response

Returns an array of payment objects, each containing:

id
string

Unique payment identifier

senderagentid
string

ID of the agent sending the payment

receiveragentid
string

ID of the agent receiving the payment

initiatedBy
string

Name of the agent that initiated the payment

receivedBy
string

Name of the agent that received the payment

direction
string

Direction of the payment relative to the user’s agents (incoming, outgoing)

name
string

Name or description of the payment

approvalstatus
string

Approval status of the payment

createdat
string

Timestamp when the payment was created

type
string

Type of payment (EXTERNAL or INTERNAL)

paymentdetails
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"
    }
  }
]

Status Codes

Status CodeDescription
200List of payments retrieved successfully
401Unauthorized
500Internal 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).