Argon

API Reference

Cancel payment

Cancel a payment that has not already been finalized.

POSThttps://api.argonpay.app/graphqlcancelPayment

Cancels a payment that is not already finalized (completed, expired, or cancelled). Takes txnid only. GraphQL-only — there is no REST wrapper in v2.

If the custodian has a callbackUrl, a cancellation webhook may be sent.

Endpoint

POST https://api.argonpay.app/graphql

Mutation

GraphQL
mutation CancelPayment($txnid: String!) {
cancelPayment(txnid: $txnid) {
code
message
transaction {
txnid
amount
status
network
createdAt
}
}
}

Arguments

NameTypeRequiredDescription
txnidString!YesTransaction ID to cancel

Example variables

JSON
{
"txnid": "YOUR_TXNID"
}

Webhook preview

Preview callback payload

Argonpay POSTs JSON to your custodian callbackUrl when a payment completes, expires, or is cancelled. Adjust the fields below to see the exact body shape, then optionally send a test request to your endpoint.

POST body preview
JSON
{
"txnid": "demo-txn-abc123",
"status": "completed",
"amount": 25.5,
"amountInToken": 25.5,
"network": "polygon",
"createdAt": "2026-07-13T17:22:58.995Z",
"secret": "your-custodian-secret",
"privateKey": "your-custodian-secret"
}