For the complete documentation index, see llms.txt. This page is also available as Markdown.

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")
}
Argument
Type
Required
Description

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")
}
Argument
Type
Required
Description

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.

Argument
Type
Required
Description

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.

Argument
Type
Required
Description

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.

Argument
Type
Required
Description

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 depositRate is provided → depositMargin = max(0, depositRate − marketBuyRate). Any depositMargin sent with the request is ignored.

  • If only depositMargin is provided → depositRate = marketBuyRate + depositMargin.

Withdrawal side (against the market sell rate):

  • If withdrawalRate is provided → withdrawalMargin = max(0, marketSellRate − withdrawalRate). Any withdrawalMargin sent with the request is ignored.

  • If only withdrawalMargin is 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.

The market buy and sell rates are Cashramp's reference rates for your agent's local currency at the moment the mutation is processed.

Last updated