Mutations
Endpoint: POST /cashramp/bot/graphql
Auth: Authorization: Bearer {api_key} (agent API key)
Accept Withdrawal
Agent accepts an incoming withdrawal order.
mutation {
acceptWithdrawal(p2pPayment: "P2P_PAYMENT_GLOBAL_ID")
}p2pPayment
ID!
Yes
The global ID of the P2P payment to accept.
Returns Boolean indicating if the operation succeeded.
Cancel Withdrawal
Agent cancels a withdrawal order.
mutation {
cancelWithdrawal(p2pPayment: "P2P_PAYMENT_GLOBAL_ID")
}p2pPayment
ID!
Yes
The global ID of the P2P payment to cancel.
Returns Boolean indicating if the operation succeeded.
Mark Deposit as Received
Agent confirms a deposit has been received.
p2pPayment
ID!
Yes
The global ID of the P2P payment to confirm.
Returns Boolean indicating if the operation succeeded.
Mark Withdrawal as Paid
Agent marks a withdrawal as paid out.
p2pPayment
ID!
Yes
The global ID of the P2P payment.
paymentMethod
ID!
Yes
The global ID of the payment method used.
receipt
String
No
Optional receipt URL or reference for the payout.
Returns Boolean indicating if the operation succeeded.
Update Rates
Update the agent's deposit and/or withdrawal rates and margins. At least one argument must be provided.
depositRate
Decimal
No
The agent's local-currency rate for deposits (fiat in, stablecoin out).
withdrawalRate
Decimal
No
The agent's local-currency rate for withdrawals (stablecoin in, fiat out).
depositMargin
Decimal
No
Margin above the market buy rate for deposits. Ignored if depositRate is provided.
withdrawalMargin
Decimal
No
Margin below the market sell rate for withdrawals. Ignored if withdrawalRate is provided.
Returns Boolean indicating if the operation succeeded. Fails with REQUIRED_ATTRIBUTES_MISSING if no arguments are provided.
Rate / Margin Derivation
The deposit and withdrawal sides are handled independently. For each side, you can provide a rate, a margin, or neither — but not both (any margin sent alongside a rate on the same side is ignored).
Deposit side (against the market buy rate):
If
depositRateis provided →depositMargin = max(0, depositRate − marketBuyRate). AnydepositMarginsent with the request is ignored.If only
depositMarginis provided →depositRate = marketBuyRate + depositMargin.
Withdrawal side (against the market sell rate):
If
withdrawalRateis provided →withdrawalMargin = max(0, marketSellRate − withdrawalRate). AnywithdrawalMarginsent with the request is ignored.If only
withdrawalMarginis provided →withdrawalRate = marketSellRate − withdrawalMargin.
Derived margins are floored at zero — a deposit rate below the market buy rate (or a withdrawal rate above the market sell rate) results in a margin of 0 rather than a negative value.
Last updated